- Posts: 19
- Thank you received: 0
- Forum
- CodeTyphon Studio
- CodeTyphon Studio Components and Libraries
- Graphics 3D Development
- pl_OpenGL - OpenGLCanvas.pas
×
Components and Libraries for Graphics 3D Development, discussions, problems and suggestions
Question pl_OpenGL - OpenGLCanvas.pas
- Peter Schneider
-
Topic Author
- Offline
- New Member
-
Less
More
1 year 2 months 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
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.
- Matis A.
-
- Away
- Moderator
-
1 year 2 months ago #15785
by Matis A.
PilotLogic Core Programmer
Replied by Matis A. on topic pl_OpenGL - OpenGLCanvas.pas
We put your suggestion to pl_OpenGL pkg
Lazarus TCanvas ?
Lazarus TCanvas ?
PilotLogic Core Programmer
Please Log in or Create an account to join the conversation.
- Peter Schneider
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 19
- Thank you received: 0
1 year 2 months ago #15788
by Peter Schneider
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;
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.
- Matis A.
-
- Away
- Moderator
-
1 year 2 months ago #15789
by Matis A.
PilotLogic Core Programmer
Replied by Matis A. on topic pl_OpenGL - OpenGLCanvas.pas
NO
it's Typhon TCanvas
Is that correct ?
it's Typhon TCanvas
Is that correct ?
PilotLogic Core Programmer
Please Log in or Create an account to join the conversation.
- Peter Schneider
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 19
- Thank you received: 0
1 year 2 months ago #15790
by Peter Schneider
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.
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.