The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Using SDL to render UI for a 3D game
gdunbar


Joined: 27 Jun 2016
Posts: 1
Hi,

I have an existing 3D game, supporting Windows and iOS (and hopefully Mac soon). I am considering porting the UI code over to SDL, mainly for the purpose of simplifying and unifying the code. I have no desire to change the 3D rendering at this point (Direct3D 9 for Windows, OpenGL ES for iOS, OpenGL for Mac). SDL seems to support all of the functionality I need to draw a UI, but I'm having a little trouble figuring out how to mix the 3D code and 2D UI code.

Ideally, when rendering a frame, I would render the 3D game world, then switch over to SDL to render the 2D UI code on top of it. Searching the SDL documentation and Internet, it isn't entirely clear how to do this, or even if it is supported.

I could ask some specific questions at this point, but maybe just leave things general at this point. Is it possible to do what I want? What's the best way to do it?

Thanks,
Geoff