Created
January 28, 2015 15:50
-
-
Save SharkyRawr/16971345f6f7cdb7af82 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool quit = false; | |
SDL_Event e; | |
Uint32 tick = SDL_GetTicks(), lastTick = tick; | |
while (!quit) { | |
SDL_SetRenderDrawColor(ren, 0, 0, 0, 255); | |
SDL_RenderClear(ren); | |
// Processing, drawing, advance time, etc... | |
while (SDL_PollEvent(&e)) { | |
if (e.type == SDL_QUIT) | |
quit = true; | |
if (e.type == SDL_KEYDOWN) { | |
switch (e.key.keysym.sym) { | |
case SDLK_ESCAPE: | |
{ | |
quit = true; | |
break; | |
} | |
} | |
} | |
SDL_RenderPresent(ren); | |
// Delays for fake-vsync, etc... | |
} | |
SDL_DestroyRenderer(ren); | |
SDL_DestroyWindow(win); | |
SDL_Quit(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment