openglfx icon indicating copy to clipboard operation
openglfx copied to clipboard

Example code generator is no longer available

Open carlislefox opened this issue 1 year ago • 1 comments

This library looks like exactly what I have been looking for, but it is impenetrable without any code examples.

I've just spent a few hours getting my JavaFX project set up and working with the LibGDX backend (learning about module exports, isn't java fun) only to hit an issue where it appears there are no Application instances in the LibGDXExecutor.

I am sure there is a good reason for this, and something I should be doing, but the example code generator link is dead so with no examples or documentation I'm at somewhat of a loss...

carlislefox avatar Sep 25 '24 21:09 carlislefox

Forgot to pay for the domain :) Now it should work.


LibGDXExecutor is a "bridge" object between LibGDX and openglfx. It doesn't contain Application. You should think of openglfx as a node, not an window or application.

LibGDX also has a separate usage in openglfx:

// 1. Create JavaFX window as always
// ...

// 2. Create LibGDXCanvas with the game instance (ApplicationAdapter)
GLCanvas canvas = new LibGDXCanvas(new MyGdxGame())

// 3. Then add canvas to the JavaFX Scene
stage.setScene(new Scene(canvas));

Full example can be found here: https://github.com/husker-dev/openglfx/tree/9fb8c268f3397af8d46e591529da63c69984c839/modules/libgdx/src/examples/kotlin/com/huskerdev/openglfx/libgdx/test/game


Also note - don't use openglfx+JavaFX in your game for UI - it has some performance overhead. The best option is to use it as an editor or some debugging tool.

husker-dev avatar Sep 26 '24 07:09 husker-dev