DelphiDabber
DelphiDabber

Reputation: 295

Custom OpenGL rendering with FireMonkey

We have a platform using VCL TFrame as rendering surface for OpenGL.

Using FireMonkey, is there any way to achieve the same thing? I've found a few examples of an entire FMX.Forms.TForm being hijacked to render OpenGL to but that's not really what I want.

Is this really a "Sorry, no can do"? I've tried creating a dummy TForm and use it's DC to cerate an OpenGL rendering context and then blit over to a FMX.Types.TImage or somehting similar but I failed trying that approach as well.

Has anyone done this? Or is FireMonkey only for non-CAD applications?

Upvotes: 1

Views: 2582

Answers (1)

LaKraven
LaKraven

Reputation: 5869

As FireMonkey exists presently, there's no EASY way of talking directly to a FireMonkey OpenGL context (that's presuming you're using the hack to force OpenGL mode on Windows, as Direct2D/3D is used by default with no official option to switch to OGL).

What you can do, however, is create your own OpenGL context by talking directly to the OpenGL API (or by using a cross-platform middleware layer like GLEW or GLUT). There's absolutely nothing stopping a FireMonkey application from creating its own OpenGL context, even "parenting" the OGL Render Window to the inside of a FireMonkey 2D Form (doing the same on a 3D Form would be a hell of a challenge, though).

Good luck in whichever route you choose to take!

Upvotes: 2

Related Questions