Welcome, Guest
Username: Password: Remember me
Components and Libraries for Graphics 3D Development, discussions, problems and suggestions
  • Page:
  • 1

TOPIC:

pl_OpenGL - OpenGLCanvas.pas 2 years 10 months ago #15783

  • Peter Schneider
  • Peter Schneider's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 19
  • Thank you received: 0
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.

pl_OpenGL - OpenGLCanvas.pas 2 years 9 months ago #15785

  • Matis A.
  • Matis A.'s Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1021
  • Thank you received: 140
We put your suggestion to pl_OpenGL pkg

Lazarus TCanvas ?


 
PilotLogic Core Programmer

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

pl_OpenGL - OpenGLCanvas.pas 2 years 9 months ago #15788

  • Peter Schneider
  • Peter Schneider's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 19
  • Thank you received: 0

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.

pl_OpenGL - OpenGLCanvas.pas 2 years 9 months ago #15789

  • Matis A.
  • Matis A.'s Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1021
  • Thank you received: 140
NO
it's Typhon TCanvas
Is that correct ?
PilotLogic Core Programmer

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

pl_OpenGL - OpenGLCanvas.pas 2 years 9 months ago #15790

  • Peter Schneider
  • Peter Schneider's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 19
  • Thank you received: 0

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.

  • Page:
  • 1