I am trying to overlay graphics on top of my OpenGL render scene.
I have managed to get it up and running but the drop in FPS is somewhat too much.
I am currently using GLScene in combination with Graphics32.
What I do is to render the GLScene Rendering Context to a bitmap, apply that bitmap to a TImageView32, and do some final UI touches inside the TImage32.
The code I am using to render to a bitmap is the following, which also reduces FPS is:
procedure RenderToBitmap;
var b: TBitmap;
begin
b:=TBitmap.Create;
b:=GLSceneViewer.Buffer.CreateSnapShotBitmap; //TGLSceneViewer
ImgVwr32.Bitmap.Assign(b); //TImageViewer32
b.Free;
end;
I have tried some other code (see below), which gives me a realtime rendering, but I can not modify the "Bitmap" property of the ImageViewer32. In other words: The GLScene Rendering context is being rendered, but none of my own graphics is rendered. The code:
//The following line is put inside the FormCreate call
GLSceneViewer.Buffer.CreateRC(GetDC(ImgVwr32.Handle),false);
How can I properly overlay graphics on top of the rendering context, or copy the rendering context output, without losing FPS?