File style cleanup for the SDL 2.0 release
This commit is contained in:
parent
2ac8624930
commit
0cb6385637
376 changed files with 17562 additions and 17773 deletions
|
@ -32,10 +32,10 @@ void render(SDL_Renderer *renderer,SDL_Texture *texture,SDL_Rect texture_dimensi
|
|||
//Clear render-target to blue.
|
||||
SDL_SetRenderDrawColor(renderer,0x00,0x00,0xff,0xff);
|
||||
SDL_RenderClear(renderer);
|
||||
|
||||
|
||||
//Render the texture.
|
||||
SDL_RenderCopy(renderer,texture,&texture_dimensions,&texture_dimensions);
|
||||
|
||||
|
||||
SDL_RenderPresent(renderer);
|
||||
}
|
||||
|
||||
|
@ -72,12 +72,12 @@ int main(int argc,char** argv)
|
|||
printf("SDL_Shape requires at least one bitmap file as argument.\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
|
||||
if(SDL_VideoInit(NULL) == -1) {
|
||||
printf("Could not initialize SDL video.\n");
|
||||
exit(-2);
|
||||
}
|
||||
|
||||
|
||||
num_pictures = argc - 1;
|
||||
pictures = (LoadedPicture *)malloc(sizeof(LoadedPicture)*num_pictures);
|
||||
for(i=0;i<num_pictures;i++)
|
||||
|
@ -105,7 +105,7 @@ int main(int argc,char** argv)
|
|||
pictures[i].mode.parameters.colorKey = black;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
window = SDL_CreateShapedWindow("SDL_Shape test",SHAPED_WINDOW_X,SHAPED_WINDOW_Y,SHAPED_WINDOW_DIMENSION,SHAPED_WINDOW_DIMENSION,SDL_WINDOW_RESIZABLE | SDL_WINDOW_SHOWN);
|
||||
if(window == NULL) {
|
||||
for(i=0;i<num_pictures;i++)
|
||||
|
@ -125,7 +125,7 @@ int main(int argc,char** argv)
|
|||
printf("Could not create rendering context for SDL_Shape window.\n");
|
||||
exit(-5);
|
||||
}
|
||||
|
||||
|
||||
for(i=0;i<num_pictures;i++)
|
||||
pictures[i].texture = NULL;
|
||||
for(i=0;i<num_pictures;i++) {
|
||||
|
@ -145,7 +145,7 @@ int main(int argc,char** argv)
|
|||
exit(-6);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
event_pending = 0;
|
||||
should_exit = 0;
|
||||
event_pending = SDL_PollEvent(&event);
|
||||
|
@ -184,7 +184,7 @@ int main(int argc,char** argv)
|
|||
SDL_Delay(time_left());
|
||||
next_time += TICK_INTERVAL;
|
||||
}
|
||||
|
||||
|
||||
//Free the textures.
|
||||
for(i=0;i<num_pictures;i++)
|
||||
SDL_DestroyTexture(pictures[i].texture);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue