× Components and Libraries for Graphics 3D Development, discussions, problems and suggestions

Question pl_OpenGL - OpenGLCanvas.pas

  • Peter Schneider
  • Peter Schneider's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 months 4 days ago #15783 by Peter Schneider
pl_OpenGL - OpenGLCanvas.pas was created by Peter Schneider
Hi,

in OpenGLCanvas.pas  the Lazarus TCanvas is overwritten by a OpenGL Canvas.
In TOGLCanvas (starts at line 109) there's missing a function to overwrite the original Canvas function GetPixel()

add in line 116:
      function GetPixel(X, Y: Integer):TColor; override;


Then add in line 245:

function TOGLCanvas.GetPixel(X, Y: Integer):TColor;
begin
  glPointSize( 1);
  glReadPixels( X, Y, 1, 1, GL_RGB, GL_UNSIGNED_BYTE, @Result);
end;

Thanks,
Peter

Please Log in or Create an account to join the conversation.

More
7 months 3 days ago #15785 by Matis A.
Replied by Matis A. on topic pl_OpenGL - OpenGLCanvas.pas
We put your suggestion to pl_OpenGL pkg

Lazarus TCanvas ?


 

PilotLogic Core Programmer

Please Log in or Create an account to join the conversation.

  • Peter Schneider
  • Peter Schneider's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 months 3 days ago #15788 by Peter Schneider
Replied by Peter Schneider on topic pl_OpenGL - OpenGLCanvas.pas

We put your suggestion to pl_OpenGL pkg

Lazarus TCanvas ?
 


Yes, the Lazarus Canvas is replaced by the OpenGL Canvas

Please take a look at:
constructor TOpenGLCanvas.Create(AOwner: TComponent);
...
...
    FOldCanvas := Canvas;
    Canvas := TOGLCanvas.Create;

Please Log in or Create an account to join the conversation.

More
7 months 3 days ago #15789 by Matis A.
Replied by Matis A. on topic pl_OpenGL - OpenGLCanvas.pas
NO
it's Typhon TCanvas
Is that correct ?

PilotLogic Core Programmer

Please Log in or Create an account to join the conversation.

  • Peter Schneider
  • Peter Schneider's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 months 3 days ago #15790 by Peter Schneider
Replied by Peter Schneider on topic pl_OpenGL - OpenGLCanvas.pas

NO
it's Typhon TCanvas
Is that correct ?
 


The code I've sent (in my first post ..) is for unit OpenGLCanvas.pas
It adds missing function GetPixel()  to the Typhon's  TOGLCanvas, yes.
 

Please Log in or Create an account to join the conversation.