Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "SDL/SDL.h"
- #include "SDL/SDL_image.h"
- //Surface
- SDL_Surface *wateranimation1 = NULL;
- SDL_Surface *snowanimation1 = NULL;
- //Screen Surface
- SDL_Surface *Screen = NULL;
- //Main Function for thread
- int MainFunction(void *unused)
- {
- SDL_BlitSurface(wateranimation1,NULL,Screen,NULL);
- SDL_BlitSurface(snowanimation1,NULL,Screen,NULL);
- SDL_Flip(Screen);
- SDL_Delay(100);
- }
- //Main Entry
- int main(int argc ,char *argv[])
- {
- //On and Off Switch for Application
- bool done = false;
- //Image Loading
- wateranimation1 = IMG_Load("WaterAnimation1.png");
- snowanimation1 = IMG_Load("SnowAnimation1.png");
- //Screen Setup
- Screen = SDL_SetVideoMode(640,480,32,SDL_HWSURFACE);
- //Screen Title
- SDL_WM_SetCaption("SDL Layer Test",NULL);
- //Main Thread Creation
- SDL_Thread *MainThread;
- //Main Thread Setup
- MainThread = SDL_CreateThread(MainFunction,NULL);
- //Event Creation
- SDL_Event event;
- //Main Event Loop
- while(!done)
- {
- while(SDL_PollEvent(&event))
- {
- switch(event.type)
- {
- case SDL_QUIT:
- return 0;
- break;
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment