WebGL support & new demo! #27
salmonb
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey WebFX users,
We recently added WebGL support to WebFX, as illustrated by this new Cube demo:
Cube Demo
To get started with WebGL in WebFX, simply add this:
into your application code, and then run
webfx update
to get the dependency resolved.WebGL.getWebGLContext()
accepts a JavaFX canvas and returns aWebGLRenderingContext
(actually a WebFX mapper of it).Please note that you can't have both a 2D and WebGL context on the same canvas, so
canvas.getGraphicsContext2D()
will returnnull
after that, but you can superpose JavaFX nodes on top of the WebGL canvas, including a 2D canvas with transparency.The source code of the Cube demo is available here.
If you have any questions, you can post them in this discussion.
Beta Was this translation helpful? Give feedback.
All reactions