Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - achpile

Pages: [1] 2 3 ... 16
1
SFML projects / Re: Dispersio 2
« on: January 21, 2021, 06:49:18 am »

2
Audio / Re: Music stops playing sometimes
« on: January 20, 2021, 03:36:48 pm »
Oh, sorry. My bad... I'm using old SFML version for windows build....

3
Audio / Re: Music stops playing sometimes
« on: January 20, 2021, 02:54:35 pm »
I found this thread, but it looks dead
https://en.sfml-dev.org/forums/index.php?topic=25298

Did anyone found the solution?

4
Audio / [SOLVED, i am idiot] Music stops playing sometimes
« on: January 20, 2021, 02:48:35 pm »
Good day. I've encountered a weird bug, which I have no idea how to reproduce in "small example"...
It happened in windows (built with mingw 32bit).

So I start music like this:

track->stop();
track->openFromFile(...);
track->setLoop(loop);
track->play();
track->setPlayingOffset(cache->musics[current]);
 

After this I added the log:
Loop = true
Offset = 4739
Length = 96000
 

So the output is getLoop(), getPlayingOffset() and getDuration().

And sometimes it just stops playing... I added a log:

Track loop = true
Offset = 0
Length = 96000
Status = Stopped
 

Have anyone had this bug, or have any ideas what could cause it? Thanks

5
System / Re: We got a keyboard without any keys (1) (OSX Big Sur)
« on: December 29, 2020, 04:53:10 pm »
I just faced this issue. If you run app from terminal - go to Security settings -> Then something with keyboard icon, then in the list mark the checkbox (terminal). And it should work fine. SFML is not the issue, it's MacOS's "feature"

6
Graphics / Re: OSX - failed to compile fragment shader
« on: December 29, 2020, 09:54:03 am »
Removing the 'f' should be ok. Just '1.0' for literals.

Oh, silly me :D Thanks Laurent. Yeah, I guess i'm way too used to put 'f' and "0:1" confused me.  :D

7
Graphics / OSX - failed to compile fragment shader
« on: December 29, 2020, 09:32:16 am »
Good day. I'm not expirienced OSX user, so have no idea about it.

I'm getting this error:
Failed to compile fragment shader:
ERROR: 0:1: 'f' : syntax error: syntax error

Failed to compile fragment shader:
ERROR: 0:1: 'f' : syntax error: syntax error

Failed to compile fragment shader:
ERROR: 0:1: 'f' : syntax error: syntax error
 

SFML version is 2.5.1

There's no such error on Linux 32/64 nor Windows 32/64

Shaders are:

#define SHADER_INVERT                                         \
        "uniform sampler2D texture;                             " \
        "                                                       " \
        "void main() {                                          " \
        "    vec4 pixel = texture2D(texture, gl_TexCoord[0].xy);" \
        "                                                       " \
        "    pixel.r = 1.0f - pixel.r;                          " \
        "    pixel.g = 1.0f - pixel.g;                          " \
        "    pixel.b = 1.0f - pixel.b;                          " \
        "                                                       " \
        "    gl_FragColor = pixel;                              " \
        "}                                                      "



#define SHADER_WHITE                                          \
        "uniform sampler2D texture;                             " \
        "                                                       " \
        "void main() {                                          " \
        "    vec4 pixel = texture2D(texture, gl_TexCoord[0].xy);" \
        "                                                       " \
        "    pixel.r = 1.0f;                                    " \
        "    pixel.g = 1.0f;                                    " \
        "    pixel.b = 1.0f;                                    " \
        "                                                       " \
        "    gl_FragColor = pixel;                              " \
        "}                                                      "



#define SHADER_GREY                                           \
        "uniform sampler2D texture;                             " \
        "                                                       " \
        "void main() {                                          " \
        "    vec4 pixel = texture2D(texture, gl_TexCoord[0].xy);" \
        "                                                       " \
        "    gl_FragColor.r = (pixel.r+pixel.g+pixel.b) / 3.0f; " \
        "    gl_FragColor.g = gl_FragColor.r;                   " \
        "    gl_FragColor.b = gl_FragColor.r;                   " \
        "    gl_FragColor.a = pixel.a;                          " \
        "}                                                      "

 

Loading code:
        shaders.white.loadFromMemory (SHADER_WHITE , sf::Shader::Fragment);
        shaders.grey.loadFromMemory  (SHADER_GREY  , sf::Shader::Fragment);
        shaders.invert.loadFromMemory(SHADER_INVERT, sf::Shader::Fragment);
 

Bonus question bonus not related to graphics, but related to Mac OS X:
After app start i got this:
"We got a keyboard without any keys (1)"

I use Mac mini with standart usb keyboard attached

8
SFML projects / Re: Dispersio 2
« on: December 10, 2020, 06:51:19 pm »
I know it's been a while, but project is finnaly close to be released :D
And steam store page is finally out! So now you can add it to your wishlist  :)

https://store.steampowered.com/app/1489850

9
SFML projects / Dispersio 3
« on: April 09, 2019, 01:00:37 pm »
Actually it's 3, but i renamed the 2 to 3, so it's 2 now  ;D
So i decided to take a short break on my previous project and i will probably release this one earlier - so I had to rename them  :D

This game will be very similar to the first one, but instead of different abilities on each level you will face different obstacles. I hope to make it as good as first one - and same hard as well  ;D

http://www.youtube.com/watch?v=fSVzTsDdxMg

10
Graphics / Re: sf::Rect
« on: September 11, 2018, 11:00:39 am »
Quote
There's no truth, only conventions.

Sad but true....
So I guess topic can be closed

11
Graphics / Re: sf::Rect
« on: September 11, 2018, 10:45:11 am »
Quote
It doesn't, because by convention, point (2, 2) belongs to pixel (2, 2).

But it also belongs to pixels (1,1), (1,2) and (2,1)

12
Graphics / Re: sf::Rect
« on: September 11, 2018, 10:27:38 am »
Well, this is not for integer coordinates. This is for pixels.
As i said in example - let's take a look at 2x2 rectangle.
And what is pixel? It's 1x1 square. So 2x2 square will contain 4 pixels (0,0), (1,0), (0,1) and (1,1)
But pixel is not a point - it's a square.

Will 2x2 rect contain pixel (2,2)? No
Will 2x2 rect contain point (2,2)? Yes

So this is not clear in Rect class - if you work with points or pixels. In function call it called a point, but actually it isn't.

And, well, if nobody cares about that - i won't too.

13
Graphics / Re: sf::Rect
« on: September 11, 2018, 09:30:52 am »
Just let's take a simple example....

I have rectangle. Based on 4 points. (0,0), (0,2), (2,2) and (2,0)

The length of each side is 2.
Does it contain point (0,0) ? Yes, it does.
Does it contain point (2,2) ? Yes, it does.

All you said is right only if you use sf::IntRect to store array dimentions, but not as a geometry object

14
Graphics / Re: sf::Rect
« on: September 11, 2018, 09:19:28 am »
Quote
If you can't understand that then think about arrays

Don't mix up the size of an array (amount of elements) and length of a line.
In geometry rectangle contains all 4 points. And all points on the edges.

PS: i'm not talking about which pixels are included and which are not. I was talking about FloatRect

15
Graphics / Re: sf::Rect
« on: September 10, 2018, 09:10:49 pm »
Imagine Left=0 and Width=5. The 5 horizontal points in your rectangle would then be 0, 1, 2, 3, 4.

Now imagine x=5. (x < Left + Width) becomes (5 < 0 + 5), which will evaluate to false. This is correct because the horizontal point 5 is not in the rectangle. If it were "<=" then it would incorrectly evaluate to true.

left = 0; width = 5;
width 5 is 0-1, 1-2, 2-3, 3-4, 4-5

width of 0-4 is 4, not 5.

Dude, learn math please before posting here

Pages: [1] 2 3 ... 16