Jump to content
  • Advertisement
Sign in to follow this  
Alundra

OpenGL OpenGL 4.5 DSA and Dummy Window

This topic is 1523 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

Hi all,

OpenGL 4.5 allows DSA which is a great update.

My question is : DSA needs a dummy window like before or data can be created without ?

Thanks

Edited by Alundra

Share this post


Link to post
Share on other sites
Advertisement

Ok, dummy context still be created to init an OpenGL Renderer.

I hope a day OpenGL will update that do be like Direct3D11.

Share this post


Link to post
Share on other sites

I do that actually :

// Dummy window/gl-context.
SDL_Window* DummyWindow = SDL_CreateWindow( "DummyWindow", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 240, 320, SDL_WINDOW_HIDDEN | SDL_WINDOW_OPENGL );
SDL_GLContext DummyGLContext = SDL_GL_CreateContext( DummyWindow );

...
INITIALIZATION OF RENDERER COMMON DATA
...

// Destroy the dummy window/gl-context.
SDL_GL_DeleteContext( DummyGLContext );
SDL_DestroyWindow( DummyWindow );

Share this post


Link to post
Share on other sites

I don't understand why you are creating a "dummy" window and context.

Edited by Chris_F

Share this post


Link to post
Share on other sites

I initialize common engine data : box buffer for decal rendering, SSAO random texture, loading of shaders (converted from HLSL) and other stuff.

Then the user (or the editor) creates the RenderWindow which is the real context, the dummy is just there to init common data.

For the Direct3D 11 renderer the problem is not there because the device and device context is independent.

Edited by Alundra

Share this post


Link to post
Share on other sites

I initialize common engine data : box buffer for decal rendering, SSAO random texture, loading of shaders (converted from HLSL) and other stuff.

Then the user (or the editor) creates the RenderWindow which is the real context, the dummy is just there to init common data.

For the Direct3D 11 renderer the problem is not there because the device and device context is independent.

 

It's not true, for DX11 Device and Primary context are sill bound together, what is independent is swapchain, so you can create Device/Context combo without HWND, AFAIK this is not possible in OpenGL. In OpenGL every context needs a windows, since there is no concept of swapchains separated from rendering context / resource management (but more than one context CAN share that same window).

Share this post


Link to post
Share on other sites

Yea, it's more accurate, I was talking about the fact that Direct3D 11 split window and device/device context I was not clear how I said it.

I hope a day OpenGL will works like that to avoid a dummy context.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net 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!