PDA

View Full Version : OpenGL for FMX



Thyandyr
28-05-2017, 03:05 PM
Why did Embarcadero went with DirectX for FMX on Windows and OpenGL for other platforms?

Anyway I'm trying to make a game, that has side aspect-voxel-engine. I can work with OpenGL. Other than that the game would need to display and handle lot of text data. Tables, lists, etc. For that FMX would be perfect. At least to begin with so I do not have to do everything from scratch.

Anyone have knowledge or opinnions about these? Are there easy Delphi/OpenGL tools for building UI with text/lists etc.

What options I have combining the use of OpenGL on FMX form on Windows?

* Change FMX/Windows to use OpenGL instead of DirectX
* Place OpenGL panel on the form and use that. Rest of the form would use DirectX. Is this a mess, drawing one part with OpenGL and rest of the form with DirectX?

Of course I could just go with OpenGL, and VCL for easy interface.

laggyluk
28-05-2017, 07:40 PM
I've tried OpenGL + some LCL components (lazarus equivalent for VCL) on top of that but it was a mess. Didn't find any useful framework for drawing UI in OpenGL, it was another reason to ditch my project :P
Had some ideas about making gui as html page and render it to texture using chromium embedded osr mode but I've never got to actually try it.

Thyandyr
28-05-2017, 08:34 PM
I just figured I'll use VCL parallel with OpenGL for development, and if everything goes well, and I end up with enough worthy code, I'll make a proper gui by hand later.

I just want to get going and do the fun stuff without the need to build everything from scratch.

Akira13
29-05-2017, 12:42 AM
It's because FireMonkey is based directly on the codebase of DXScene by Eugene Kryukov. DXScene was itself just a proprietary fork of GLScene that used Direct3D 9 as a rendering backend instead of OpenGL. (And to be quite honest it was always just a lot worse than GLScene in every way, since like 80 to 90 percent of the useful aspects of the library were stripped out for the purposes of "simplification".)

So yeah, to make a long story short: FireMonkey is a fork of a bad fork. The only reason Embarcadero went back to using OpenGL on other platforms is because DirectX doesn't exist on those platforms. If you want something that works similarly to FMX but is way better, just use GLScene itself, which has always remained actively developed.

laggyluk
30-05-2017, 09:01 AM
So yeah, to make a long story short: FireMonkey is a fork of a bad fork. The only reason Embarcadero went back to using OpenGL on other platforms is because DirectX doesn't exist on those platforms. If you want something that works similarly to FMX but is way better, just use GLScene itself, which has always remained actively developed.
Well, I'd wish there was something like firemonkey for lazarus even if it's bad fork/work.

imcold
30-05-2017, 04:07 PM
Didn't find any useful framework for drawing UI in OpenGL, it was another reason to ditch my project :P

Would you be willing to try ImGui (https://github.com/ocornut/imgui) ? I'm working on the pascal bindings at the moment and imho they're already usable.

laggyluk
30-05-2017, 05:40 PM
Would you be willing to try ImGui (https://github.com/ocornut/imgui) ? I'm working on the pascal bindings at the moment and imho they're already usable.
Sure, looks pretty decent. Where do I get it? I mean the pascal bindings

imcold
30-05-2017, 05:58 PM
Cool! I started a thread here: http://www.pascalgamedevelopment.com/showthread.php?32580-ImGui-pascal-bindings

Thyandyr
31-05-2017, 08:29 AM
Would you be willing to try ImGui (https://github.com/ocornut/imgui) ? I'm working on the pascal bindings at the moment and imho they're already usable.

This seems to be what I was looking for.

Akira13
31-05-2017, 03:14 PM
Well, I'd wish there was something like firemonkey for lazarus even if it's bad fork/work.

There is. The Lazarus version of GLScene. Like I said, FireMonkey is based on DXScene which was itself based on GLScene.

laggyluk
31-05-2017, 03:52 PM
There is. The Lazarus version of GLScene. Like I said, FireMonkey is based on DXScene which was itself based on GLScene.
You mean I can make UI for my next project by dropping and layouting bunch of decent looking components on the form like in Firemonkey without paying 2k euros?

Akira13
31-05-2017, 06:18 PM
You mean I can make UI for my next project by dropping and layouting bunch of decent looking components on the form like in Firemonkey without paying 2k euros?

Which components specifically in FMX do you generally tend to use?

laggyluk
31-05-2017, 07:38 PM
Which components specifically in FMX do you generally tend to use?
layout, rectangle, label, edit, combo/dropdown, image, checkbox