summaryrefslogtreecommitdiff
path: root/src/gfx.c
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2003-12-19 19:31:57 +0000
committerIan C <ianc@noddybox.co.uk>2003-12-19 19:31:57 +0000
commit9443eab98692b668fd35fc2a7e2cfb043953dbc7 (patch)
treeeb7082f5bfec8b065949e9b0e068837315db3e46 /src/gfx.c
parenta43db151b99687a85932f8172f73151bfcb93e88 (diff)
Added start of simple GUI and tweaked font
Diffstat (limited to 'src/gfx.c')
-rw-r--r--src/gfx.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/src/gfx.c b/src/gfx.c
index 80e5b5c..57be20c 100644
--- a/src/gfx.c
+++ b/src/gfx.c
@@ -20,7 +20,7 @@
-------------------------------------------------------------------------
- Config file
+ Wrapper to SDL
*/
static const char ident[]="$Id$";
@@ -171,8 +171,6 @@ void GFXInit(void)
if (SDL_Init(SDL_INIT_TIMER|SDL_INIT_VIDEO))
Exit("Failed to init SDL: %s\n",SDL_GetError());
- printf("scale = %d\n",scale);
-
if (!(surface=SDL_SetVideoMode(SCR_W*scale,
SCR_H*scale,
0,
@@ -227,6 +225,33 @@ void GFXEndFrame(int delay)
}
+SDL_Event *GFXGetKey(void)
+{
+ static SDL_Event e;
+
+ while(SDL_PollEvent(&e))
+ {
+ if (e.type==SDL_KEYUP || e.type==SDL_KEYDOWN)
+ return &e;
+ }
+
+ return NULL;
+}
+
+
+SDL_Event *GFXWaitKey(void)
+{
+ static SDL_Event e;
+
+ do
+ {
+ SDL_WaitEvent(&e);
+ } while (e.type!=SDL_KEYUP);
+
+ return &e;
+}
+
+
void GFXPlot(int x, int y, Uint32 col)
{
LOCK;