OpenGLContext: Make TOpenGLControl renderable by a thread. Issue #32116, patch from Pascal Riekenberg.

git-svn-id: trunk@55559 -
This commit is contained in:
juha 2017-07-22 07:22:30 +00:00
parent 69e95d6c6d
commit 712e063538

View File

@ -566,9 +566,10 @@ begin
if IsVisible and HandleAllocated then begin
UpdateFrameTimeDiff;
if IsOpenGLRenderAllowed and ([csDestroying]*ComponentState=[]) then begin
if not MakeCurrent then exit;
if AutoResizeViewport then
if AutoResizeViewport then begin
if not MakeCurrent then exit;
LOpenGLViewport(Handle,0,0,Width,Height);
end;
end;
//LOpenGLClip(Handle);
DoOnPaint;
@ -589,7 +590,10 @@ end;
procedure TCustomOpenGLControl.DoOnPaint;
begin
if Assigned(OnPaint) then OnPaint(Self);
if Assigned(OnPaint) then begin
if not MakeCurrent then exit;
OnPaint(Self);
end;
end;
procedure TCustomOpenGLControl.SwapBuffers;