mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 07:17:23 +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
|
var
|
||||||
Params: TCreateWindowExParams;
|
Params: TCreateWindowExParams;
|
||||||
pfd: PIXELFORMATDESCRIPTOR;
|
pfd: PIXELFORMATDESCRIPTOR;
|
||||||
Info: PWGLControlInfo;
|
Info, SharedInfo: PWGLControlInfo;
|
||||||
|
|
||||||
ReturnedFormats: UINT;
|
ReturnedFormats: UINT;
|
||||||
VisualAttrList: PInteger;
|
VisualAttrList: PInteger;
|
||||||
@ -490,6 +490,12 @@ begin
|
|||||||
Info^.WGLContext:=wglCreateContext(Info^.DC);
|
Info^.WGLContext:=wglCreateContext(Info^.DC);
|
||||||
if Info^.WGLContext=0 then
|
if Info^.WGLContext=0 then
|
||||||
raise Exception.Create('LOpenGLCreateContext wglCreateContext failed');
|
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;
|
end;
|
||||||
|
|
||||||
procedure LOpenGLDestroyContextInfo(AWinControl: TWinControl);
|
procedure LOpenGLDestroyContextInfo(AWinControl: TWinControl);
|
||||||
|
Loading…
Reference in New Issue
Block a user