mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-03 07:19:38 +01:00
OpenGLContext: Make TOpenGLControl renderable by a thread. Issue #32116, patch from Pascal Riekenberg.
git-svn-id: trunk@55559 -
This commit is contained in:
parent
69e95d6c6d
commit
712e063538
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user