It pushes me against the wall.
I have a very simple SDL2 program.
It has an array of 3 SDL_Texture pointers.
These textures are filled as follows:
SDL_Texture *myarray[15];
SDL_Surface *surface;
for(int i=0;i<3;i++)
{
char filename[] = "X.bmp";
filename[0] = i + '0';
surface = SDL_LoadBMP(filename);
myarray[i] = SDL_CreateTextureFromSurface(myrenderer,surface);
SDL_FreeSurface(surface);
}
It works, no errors.
In the main loop (which is a regular event loop waiting for SDL_QUIT, keystrokes, and a custom event that SDL_Timer puts in the event queue every second), I just do (for the timer triggered event):
idx = (idx+1) % 3;
SDL_RenderClear(myrenderer);
SDL_RenderCopy(myrenderer, myarray[idx], NULL, NULL);
SDL_RendererPresent(myrenderer);
0.bmp 1.bmp, (2.bmp) .
.
2 , .
2- 3- , .
3 , 3 .
. , , .
BMP.
2.bmp , SDL_SaveBMP() , , . , .
BMP OSX (XCode5) Windows (V++ 2012 Express).
PI.
, / ( ), " ".
www.libsdl.org (, , ..).
- , ?
P.S.
PI, .