#130568 - blue_knight - Tue Jun 05, 2007 9:18 am
So I am using the 3D hardware to render 2D quads for a multi-level isometric map renderer. In an emulator everything renders correctly (Dualis, Ideas, NO$GBA). On the DS hardware I see flickering as I'm rendering. Oringally my loop looked kind of like this (pseudo code):
I tried glFlush(0) as well, but no matter what I did even I rendered a certain number of pixels on a scanline I'd get flickering. Basically if I render a map and zoom out (so the map only takes a portion of the screen) then no flickering - it's not the number of quads rendered (I track that, I'm nowhere near the limit).
So I figured that it must be drawing at the wrong time, so I setup a vblank handler and do the scene setup (calculate quad positions/tcs, culling, etc. based on camera position) in the main loop - creating a renderlist of sorts -and then render that list in the vblank. Otherwise the loop is exactly the same. But I still get the same flickering - and it still renders correctly in all the emulators.
So my question: is there a way to get rid of the flickering without double buffering the 3D rendering? If not, can anyone give me any pointers on the best way to accomplish that.
Code: |
int main() { //Setup video mode //Setup vbanks //Load Textures. //Load Texture palette while (1) { //Render quads //wait for vblank to actually render 3D geo. swiWaitForVBlank(); }; } |
I tried glFlush(0) as well, but no matter what I did even I rendered a certain number of pixels on a scanline I'd get flickering. Basically if I render a map and zoom out (so the map only takes a portion of the screen) then no flickering - it's not the number of quads rendered (I track that, I'm nowhere near the limit).
So I figured that it must be drawing at the wrong time, so I setup a vblank handler and do the scene setup (calculate quad positions/tcs, culling, etc. based on camera position) in the main loop - creating a renderlist of sorts -and then render that list in the vblank. Otherwise the loop is exactly the same. But I still get the same flickering - and it still renders correctly in all the emulators.
So my question: is there a way to get rid of the flickering without double buffering the 3D rendering? If not, can anyone give me any pointers on the best way to accomplish that.