I’m developping under SDL2 ( On Linux ),
First, to follow what that I will say:
I created a struct TileMap, this struct ( with my algorithm ) create a 2D map of 20x20 blocks ( each block is 32x32 px )
So, I have a problem using the SDL_GetTicks:
I created a variable: “int currTime = 0;”
In my main while, at the begin, I do: “currTime = SDL_GetTicks();”,
I don’t have any problems during the compiling, but when I’m running the output file ( “./a.out” ), my 32 firsts pixels are not displayed with my texture, but with the default color of my background ( white in fact ).
So, for resume: my first line of TileMap is remplace by the color of my background…
I’m sure that is SDL_GetTicks the problem because I tried to remove line by line the code that I added, and when I’m removing the “currTime = SDL_GetTicks();” line, the problem disappears… I also tried to move this line to the end of my while loop, but the problem is still here…
What is the problem ? Why do I have this ?
( P.S: I already had a similar problem with some other lines, but that was because I do an error on these line, but here, I follow a tutorial on YouTube for handling FPS… )
Sorry for my english, I’m french…