Skip to content
Permalink
Browse files

Screenshotting functionality works (F12 key).

  • Loading branch information...
anrieff committed Jun 24, 2018
1 parent c2b4ec5 commit 1cd2f6e02edb9af9be6a4e90d2ff1c834cf22844
Showing with 10 additions and 26 deletions.
  1. +10 −26 src/sdl.cpp
@@ -73,32 +73,6 @@ void displayVFB(Color vfb[VFB_MAX_SIZE][VFB_MAX_SIZE])
SDL_Flip(screen);
}

/// waits the user to indicate he wants to close the application (by either clicking on the "X" of the window,
/// or by pressing ESC)
void waitForUserExit(void)
{
SDL_Event ev;
while (1) {
while (SDL_WaitEvent(&ev)) {
switch (ev.type) {
case SDL_QUIT:
return;
case SDL_KEYDOWN:
{
switch (ev.key.keysym.sym) {
case SDLK_ESCAPE:
return;
default:
break;
}
}
default:
break;
}
}
}
}

/// returns the frame width
int frameWidth(void)
{
@@ -201,6 +175,16 @@ static void handleEvent(SDL_Event& ev)
}
}

/// waits the user to indicate he wants to close the application (by either clicking on the "X" of the window,
/// or by pressing ESC)
void waitForUserExit(void)
{
SDL_Event ev;
while (!wantToQuit && SDL_WaitEvent(&ev)) {
handleEvent(ev);
}
}

class MutexRAII {
SDL_mutex* mutex;
public:

0 comments on commit 1cd2f6e

Please sign in to comment.
You can’t perform that action at this time.