Jump to content
  • Advertisement
Orella

OpenGL SDL2 Draw scene to texture. SDL2 RenderTexture like SFML

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.

Thanks!

Share this post


Link to post
Share on other sites
Advertisement

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!