Guest User

Untitled

a guest
Dec 12th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <SDL/SDL.h>
  3.  
  4. #undef main
  5.  
  6. int main(){
  7. SDL_Event event;
  8. SDL_Surface * surface;
  9.  
  10. SDL_INIT(SDL_INIT_EVERYTHING);
  11. atexit(SDL_QUIT);
  12.  
  13. surface = SDL_SetVideoMode(1366, 768, 32, SDL_HWSURFACE|SDL_DOUBLEBUF);
  14.  
  15. for(;;){
  16. if(SDL_PollEvent(&event)){
  17. //Clicks and other stuff
  18. switch(event.type){
  19. case SDL_QUIT:
  20. return 0;
  21. case SDL_KEYDOWN:
  22. switch(event.key.keysym.sym){
  23. case SDLK_ESCAPE:
  24. return 0;
  25. continue;
  26. }
  27. SDL_FillRect(surface, NULL, 0x0);
  28. SDL_LockSurface(surface);
  29.  
  30. //Rendering and other stuff
  31. SDL_UnlockSurface(surface);
  32. SDL_Flip(surface);
  33. }
  34.  
  35. return 0;
  36. }
Add Comment
Please, Sign In to add comment