Advertisement Jump to content

OpenGL SDL2 Draw scene to texture. SDL2 RenderTexture like SFML

This topic is 495 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been developing a 2D Engine using SFML + ImGui.

Here you can see an image

The editor is rendered using ImGui and the scene window is a sf::RenderTexture where I draw the GameObjects and then is converted to ImGui::Image to render it in the editor.

Now I need to create a 3D Engine during this year in my Bachelor Degree but using SDL2 + ImGui and I want to recreate what I did with the 2D Engine. 

I've managed to render the editor like I did in the 2D Engine using this example that comes with ImGui. 

3D Editor preview

But I don't know how to create an equivalent of sf::RenderTexture in SDL2, so I can draw the 3D scene there and convert it to ImGui::Image to show it in the editor.

If you can provide code will be better. And if you want me to provide any specific code tell me.


Share this post

Link to post
Share on other sites

Never found that while searching. Anyways seems that I cannot mix OpenGL with SDL_Renderer: proof. If you see the "example" link I'm using OpenGL. 

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!