OpenGL - share existing textures with future contexts?

I have an application where I draw frames for texture using FBO extensions.

These frames will be displayed in different windows open while the application is running. This means that textures can be created and combined before the OpenGL context to create any new window and is called wglShareLists.

I currently need to do glReadPixels, glMapBufferRangeand glTexSubImageto move the texture to different window contexts, which is pretty inefficient.

Any ideas on how to improve this? Should I create several (maximum number of windows at any time - 4) OpenGL contexts and hidden windows during program startup? What would be the overhead?

Or even better, is there a way to make textures shared between existing and future OpenGL contexts?

+2
source share
1 answer

OpenGL (, , ), ( , ). , - , . . , , , , , ID = 1? , , A , B - , A B. .

, : OpenGL , PIXELFORMATDESCRIPTOR . , HDC wglMakeCurrent. , wglMakeCurrent HRC.

+11

Source: https://habr.com/ru/post/1538124/


All Articles