Drawing 2D HUD over 3D OpenGL sence with SDL

1k views Asked by At

I'm trying to draw a 2D HUD over a 3D Scene and therefor I'm useing the opengl rendering set up on SDL. So the question is : Is it possible to Draw 2D things with SDL over the 3D scene or do I need to draw them with opengl? Because I've experienced that if I create a SDL renderer the OpenGL scene will disappear and be overdrawn by the SDL renderer.

1

There are 1 answers

1
Midi On BEST ANSWER

IIRC, OpenGL has functions for drawing 2D elements. You could render the 3D to a texture and then render 2D over it. If you must use SDL, you'll need a method to copy an OpenGL texture to an SDL surface/texture.