Mixing GX and direct framebuffer writing
Posted: Wed Jul 28, 2010 2:52 am
I started programming the Wii by just writing pixels directly to the framebuffer. I've sinced learned how to use GX to draw textured polygons, which makes blending run much faster than it does on the CPU. Now I want to combine the two methods.
I want to draw a scene using GX and then draw some "overlays," by which I mean some text or a cursor that will overwrite parts of the image produced by GX. Is this sensible? I tried simply writing to the framebuffer after I called GX_DrawDone, but this produces a weird effect where my "overlay" pixels flickered erratically, as if my direct framebuffer write was occurring simultaneously with the GX framebuffer copy. I tried to use VIDEO_ClearFrameBuffer as I had done before with direct writing, and while this fixed the overlay flickering, it made half of the screen black.
It seems like GX is running as I'm doing my framebuffer writes, even though I tried to do them afterward. If this is the case, how do I synchronize the two processes?
I want to draw a scene using GX and then draw some "overlays," by which I mean some text or a cursor that will overwrite parts of the image produced by GX. Is this sensible? I tried simply writing to the framebuffer after I called GX_DrawDone, but this produces a weird effect where my "overlay" pixels flickered erratically, as if my direct framebuffer write was occurring simultaneously with the GX framebuffer copy. I tried to use VIDEO_ClearFrameBuffer as I had done before with direct writing, and while this fixed the overlay flickering, it made half of the screen black.
It seems like GX is running as I'm doing my framebuffer writes, even though I tried to do them afterward. If this is the case, how do I synchronize the two processes?