0

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.

Martin G
  • 17,357
  • 9
  • 82
  • 98
SilentStorm
  • 149
  • 1
  • 2
  • 10
  • I would just do it in OpenGL using an orthographic projection, pretty straight forward. – TPS Nov 12 '14 at 18:49

1 Answers1

1

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.

Midi
  • 57
  • 5