diff --git a/minui/graphics.c b/minui/graphics.c
index 05e8763..06c5fdf 100644
--- a/minui/graphics.c
+++ b/minui/graphics.c
@@ -43,6 +43,7 @@
 static GGLContext *gr_context = 0;
 static GGLSurface gr_font_texture;
 static GGLSurface gr_framebuffer[2];
+static GGLSurface gr_mem_surface;
 static unsigned gr_active_fb = 0;
 
 static int gr_fb_fd = -1;
@@ -55,7 +56,7 @@
     int fd;
     struct fb_fix_screeninfo fi;
     void *bits;
-    
+
     fd = open("/dev/graphics/fb0", O_RDWR);
     if (fd < 0) {
         perror("cannot open fb0");
@@ -87,9 +88,9 @@
     fb->stride = vi.xres;
     fb->data = bits;
     fb->format = GGL_PIXEL_FORMAT_RGB_565;
-    
+
     fb++;
-    
+
     fb->version = sizeof(*fb);
     fb->width = vi.xres;
     fb->height = vi.yres;
@@ -100,6 +101,15 @@
     return fd;
 }
 
+static void get_memory_surface(GGLSurface* ms) {
+  ms->version = sizeof(*ms);
+  ms->width = vi.xres;
+  ms->height = vi.yres;
+  ms->stride = vi.xres;
+  ms->data = malloc(vi.xres * vi.yres * 2);
+  ms->format = GGL_PIXEL_FORMAT_RGB_565;
+}
+
 static void set_active_framebuffer(unsigned n)
 {
     if (n > 1) return;
@@ -113,14 +123,16 @@
 void gr_flip(void)
 {
     GGLContext *gl = gr_context;
-    
-        /* currently active buffer becomes the backbuffer */
-    gl->colorBuffer(gl, gr_framebuffer + gr_active_fb);
 
-        /* swap front and back buffers */
+    /* swap front and back buffers */
     gr_active_fb = (gr_active_fb + 1) & 1;
 
-        /* inform the display driver */
+    /* copy data from the in-memory surface to the buffer we're about
+     * to make active. */
+    memcpy(gr_framebuffer[gr_active_fb].data, gr_mem_surface.data,
+           vi.xres * vi.yres * 2);
+
+    /* inform the display driver */
     set_active_framebuffer(gr_active_fb);
 }
 
@@ -147,13 +159,13 @@
     unsigned off;
 
     y -= font->ascent;
-  
+
     gl->bindTexture(gl, &font->texture);
     gl->texEnvi(gl, GGL_TEXTURE_ENV, GGL_TEXTURE_ENV_MODE, GGL_REPLACE);
     gl->texGeni(gl, GGL_S, GGL_TEXTURE_GEN_MODE, GGL_ONE_TO_ONE);
     gl->texGeni(gl, GGL_T, GGL_TEXTURE_GEN_MODE, GGL_ONE_TO_ONE);
     gl->enable(gl, GGL_TEXTURE_2D);
-    
+
     while((off = *s++)) {
         off -= 32;
         if (off < 96) {
@@ -209,10 +221,10 @@
     unsigned char *in, data;
 
     gr_font = calloc(sizeof(*gr_font), 1);
-    ftex = &gr_font->texture; 
+    ftex = &gr_font->texture;
 
     bits = malloc(font.width * font.height);
-    
+
     ftex->version = sizeof(*ftex);
     ftex->width = font.width;
     ftex->height = font.height;
@@ -225,7 +237,7 @@
         memset(bits, (data & 0x80) ? 255 : 0, data & 0x7f);
         bits += (data & 0x7f);
     }
-    
+
     gr_font->cwidth = font.cwidth;
     gr_font->cheight = font.cheight;
     gr_font->ascent = font.cheight - 2;
@@ -254,13 +266,16 @@
         return -1;
     }
 
+    get_memory_surface(&gr_mem_surface);
+
     fprintf(stderr, "framebuffer: fd %d (%d x %d)\n",
             gr_fb_fd, gr_framebuffer[0].width, gr_framebuffer[0].height);
 
         /* start with 0 as front (displayed) and 1 as back (drawing) */
     gr_active_fb = 0;
     set_active_framebuffer(0);
-    gl->colorBuffer(gl, gr_framebuffer + 1);
+    gl->colorBuffer(gl, &gr_mem_surface);
+
 
     gl->activeTexture(gl, 0);
     gl->enable(gl, GGL_BLEND);
@@ -273,7 +288,9 @@
 {
     close(gr_fb_fd);
     gr_fb_fd = -1;
-    
+
+    free(gr_mem_surface.data);
+
     ioctl(gr_vt_fd, KDSETMODE, (void*) KD_TEXT);
     close(gr_vt_fd);
     gr_vt_fd = -1;
@@ -291,5 +308,5 @@
 
 gr_pixel *gr_fb_data(void)
 {
-    return (unsigned short *) gr_framebuffer[1 - gr_active_fb].data;
+    return (unsigned short *) gr_mem_surface.data;
 }
