From 77bd5797d3a8d0faffc464199b20d5a41a50a688 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Thu, 21 Jun 2012 18:56:18 -0300 Subject: [PATCH] tools/plot.c: clear sample mode screen with C --- tools/plot.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/plot.c b/tools/plot.c index 42a0dee..bbe3d6f 100644 --- a/tools/plot.c +++ b/tools/plot.c @@ -80,6 +80,13 @@ int plot(int x, int y) switch (event.type) { case SDL_KEYDOWN: switch (event.key.keysym.sym) { + case SDLK_c: + SDL_LockSurface(surf); + SDL_FillRect(surf, NULL, + SDL_MapRGB(surf->format, 0, 0, 0)); + SDL_UpdateRect(surf, 0, 0, 0, 0); + SDL_UnlockSurface(surf); + break; case SDLK_q: return 0; default: