Multiple Window Rendering using same texture buffer in same Application

#1

Hey hi ,
I have a Scenario , where

I created first window and initialized the OpenGL 3.3 Context and i’m able to render the texture on Window,

but now I have Created another second window with OpenGL initialized , so it’s having it’s own HDC, HGLRC and HWND so i want to use the texture buffer from first window , to render in second window.

it’s running in Same process ,

first window rendering with its own HGLRC , HWND and HDC,
but now the texture loaded by first window to texture buffer , i have to reuse in second window which having it’s own HGLRC , HWND and HDC,

how do i share texture buffer between two rendering contexts within same process but between different threads , in which all thread have capabilities to render
on it’s own window.

so here every window have it’s own Opengl initialization for context , and can able to render on its own window
problem to solve is to share the texture between these two rendering threads which render same texture buffer .

#2

See these sections in the wiki:

[ul]
[li]Platform specifics: Windows#wglShareLists [/li][li]Creating an OpenGL Context (WGL)#Create Context with Attributes [/li][li]OpenGL and multithreading [/li][/ul]

#3

hello,
i found this link : https://caseymuratori.com/blog_0026

but i was unable to found below two functions in wgl

CGLuint wglAcquireDCFramebuffer(HDC hDC);
void wglReleaseDCFramebuffer(HDC hDC, CGLuint framebuffer);

even they dint have any documentation for wglAcquireDCFramebuffer and wglReleaseDCFramebuffer.

please can anyone tell me, what are they ,even they exist also ?
sicne in caseymuratori.com , he has stated to fix multiple monitor and multiple window

#4

[QUOTE=Dark Photon;1293060]See these sections in the wiki:

[ul]
[li]Platform specifics: Windows#wglShareLists
[/li][li]Creating an OpenGL Context (WGL)#Create Context with Attributes
[/li][li]OpenGL and multithreading
[/li][/ul][/QUOTE]

i looked through above links , but all they describe to wglmakecurrent every time per context for different window rendering .
but i have two different context in two thread and how should i share the texture buffer from main rendering thread to child rendering thread,
both thread render on it’s own window,
but the main thread upload the :->data to PBO :->create texture :-> and Render,
but the,
tchild window should able to acess the texture buffer created by main rendering thread just to render on its window.

#5

Yes, exactly. Why can’t you create two contexts that share GL objects using either:

[ol]
[li]The “hShareContext” argument of wglCreateContextAttribsARB(), OR [/li][li]Calling wglShareLists() immediately after creating the two contexts? [/li][/ol]
That’s why I pointed you to those links. Sorry it wasn’t obvious.

Just be sure to create and share your contexts first. Then create GL objects through them.