mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-08 03:57:30 +02:00
openglcontrol: win32: share context
git-svn-id: trunk@38202 -
This commit is contained in:
parent
1264a95e7c
commit
aa0c04ced6
@ -407,7 +407,7 @@ function LOpenGLCreateContext(AWinControl: TWinControl;
|
||||
var
|
||||
Params: TCreateWindowExParams;
|
||||
pfd: PIXELFORMATDESCRIPTOR;
|
||||
Info: PWGLControlInfo;
|
||||
Info, SharedInfo: PWGLControlInfo;
|
||||
|
||||
ReturnedFormats: UINT;
|
||||
VisualAttrList: PInteger;
|
||||
@ -490,6 +490,12 @@ begin
|
||||
Info^.WGLContext:=wglCreateContext(Info^.DC);
|
||||
if Info^.WGLContext=0 then
|
||||
raise Exception.Create('LOpenGLCreateContext wglCreateContext failed');
|
||||
|
||||
// share context objects
|
||||
if Assigned(SharedControl) then begin
|
||||
SharedInfo:=GetWGLControlInfo(SharedControl.Handle);
|
||||
if Assigned(SharedInfo) then wglShareLists(SharedInfo^.WGLContext, Info^.WGLContext);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure LOpenGLDestroyContextInfo(AWinControl: TWinControl);
|
||||
|
Loading…
Reference in New Issue
Block a user