openglcontrol: win32: share context

git-svn-id: trunk@38202 -
This commit is contained in:
mattias 2012-08-08 08:04:53 +00:00
parent 1264a95e7c
commit aa0c04ced6

View File

@ -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);