mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-04 19:19:26 +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
|
if IsVisible and HandleAllocated then begin
|
||||||
UpdateFrameTimeDiff;
|
UpdateFrameTimeDiff;
|
||||||
if IsOpenGLRenderAllowed and ([csDestroying]*ComponentState=[]) then begin
|
if IsOpenGLRenderAllowed and ([csDestroying]*ComponentState=[]) then begin
|
||||||
if not MakeCurrent then exit;
|
if AutoResizeViewport then begin
|
||||||
if AutoResizeViewport then
|
if not MakeCurrent then exit;
|
||||||
LOpenGLViewport(Handle,0,0,Width,Height);
|
LOpenGLViewport(Handle,0,0,Width,Height);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
//LOpenGLClip(Handle);
|
//LOpenGLClip(Handle);
|
||||||
DoOnPaint;
|
DoOnPaint;
|
||||||
@ -589,7 +590,10 @@ end;
|
|||||||
|
|
||||||
procedure TCustomOpenGLControl.DoOnPaint;
|
procedure TCustomOpenGLControl.DoOnPaint;
|
||||||
begin
|
begin
|
||||||
if Assigned(OnPaint) then OnPaint(Self);
|
if Assigned(OnPaint) then begin
|
||||||
|
if not MakeCurrent then exit;
|
||||||
|
OnPaint(Self);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomOpenGLControl.SwapBuffers;
|
procedure TCustomOpenGLControl.SwapBuffers;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user