Guest User

Untitled

a guest
Feb 18th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. void Render() {
  2. glClearColor( 0, 0, 0, 0 );
  3. }
  4.  
  5. int main(int argc, char *argv[])
  6. {
  7. int rc = SDL_Init(SDL_INIT_VIDEO);
  8. assert(rc == 0);
  9.  
  10. /*SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);*/
  11. /*SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 4);*/
  12.  
  13. int width = 800;
  14. int height = 600;
  15. SDL_Surface *surface = SDL_SetVideoMode(width, height, 32, SDL_OPENGL | SDL_RESIZABLE | SDL_DOUBLEBUF);
  16. assert(surface != 0);
  17. SDL_WM_SetCaption("awesome", 0);
  18.  
  19. int done = 0;
  20. while (!done) {
  21. SDL_Event event;
  22. while (SDL_PollEvent(&event)) {
  23. switch (event.type) {
  24. case SDL_KEYDOWN:
  25. if (event.key.keysym.sym == SDLK_ESCAPE) done = 1;
  26. break;
  27. case SDL_QUIT:
  28. done = 1;
  29. break;
  30. }
  31. }
  32.  
  33. Render();
  34. }
  35.  
  36. SDL_Quit();
  37.  
  38. return 0;
  39. }
Add Comment
Please, Sign In to add comment