I am trying to animate a bmp file sprite sheet but it does not a sprite to the screen.
void setrects(SDL_Rect* clip)
{
clip[0].x = 0;
clip[0].y = 0;
}
int main( int argc, char* args )
{
//Start up SDL and create window
if( !init() )
{
printf( “Failed to initialize!\n” );
}
else
{
//Load media
if (!loadMedia())
{
printf(“Failed to load media!\n”);
}
else
{
SDL_Rect rects[10];
setrects(rects);
int frame = 0;
SDL_Rect rect;
rect.x = 462;
rect.y = 686;
SDL_Rect src;
src.x = 200;
src.y = 200;
//Apply the image
SDL_BlitSurface(gHelloWorld_one, &rects[frame], gScreenSurface, &rect);
frame++;
if (frame == 10)
{
frame = 0;
}