SDL2 Draw scene to texture. SDL2 RenderTexture like SFML

Started by
2 comments, last by Orella 6 years, 7 months ago

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.

Thanks!

Advertisement

A quick google search gave this tutorial on GitHub

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. 

This topic is closed to new replies.

Advertisement