SDL_OPENGLBLIT confusion

I’m working on an iso-view/gl hybrid game, where the characters are rendered
3d, and backgrounds and textures are rendered as 2d iso tiles. I’ve been
experimenting with SDL_OPENGLBLIT, but have had varying degrees of success.
What order should the clear/fillrect/draw/gldraw/update/glupdate be in? I
can either get my iso map or the gl objects, or map-clear-gl objects
flicker, but not the map with the gl objects on top. What is the right
order for these 5 functions?

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
SDL_FillRect(screen, NULL, background);
DrawMap();
SDL_Flip(screen);
DrawGLCharacter();
SDL_GL_SwapBuffers();

Thanks,
Scott

I’m working on an iso-view/gl hybrid game, where the characters are rendered
3d, and backgrounds and textures are rendered as 2d iso tiles. I’ve been
experimenting with SDL_OPENGLBLIT, but have had varying degrees of success.
What order should the clear/fillrect/draw/gldraw/update/glupdate be in? I
can either get my iso map or the gl objects, or map-clear-gl objects
flicker, but not the map with the gl objects on top. What is the right
order for these 5 functions?

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
SDL_FillRect(screen, NULL, background);
DrawMap();
SDL_Flip(screen);
DrawGLCharacter();
SDL_GL_SwapBuffers();

You probably need to mess with the coordinate systems. Take a look at
the code SDL is using to update the screen, and then figure out what needs
to be done to render everything at the correct Z depth.

BTW, this is going to be fairly slow on most video cards. You may want to
consider pre-rendering your 3D characters.

The SDL video update code is in src/video/SDL_video.c

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software