Display System and Rendering Bindings

Hi,



I read a bit  about JMonkeyEngine so far, havent yet digged into API or Code so i have some kind of general Question:

I read that jogl and lwjgl are possible to use within monkeyengine, looking at the API Doc seems there are only lwjgl features impl.

so whats about jogl support ?



And next: Is there any need to use the Displaysystems Classes to use it ? For my application it would better to setup display by myself

and then use JMonkeyEngine, is this possible ? If its possible how to get into it ?



many thanks,

Jens

jME is designed to support different renderers, such as (but not limited to) LWJGL and JOGL. The one maintained by the jME team is LWJGL based though. However, there has been a JOGL port in the past, and there is a more recent effort, just search the forum for JOGL.



As for setting up the display, of course this will have to be done by jME if you intend to use a window created by jME. As an alternative however, you can embed jME in a Swing or SWT application (not sure if that last one works on a Mac already, but there's an ongoing effort right now for including OpenGL widgets (including LWJGL) in SWT itself)

llama said:

As for setting up the display, of course this will have to be done by jME if you intend to use a window created by jME. As an alternative however, you can embed jME in a Swing or SWT application (not sure if that last one works on a Mac already, but there's an ongoing effort right now for including OpenGL widgets (including LWJGL) in SWT itself)


Can someone explain why the setup have to be done by JMonkeyEngine ? In my case i have to have both Windowed and Fullscreen, also i have to switch between.

regards,
Jens

How would you plan to do this "setup" yourself? For jME to work, an OpenGL context has to be created. This is implementation specific, so this is abstracted in the DisplaySystem, which you can use to create a window (fullscreen or not), or another context such as the already mentioned AWT/Swing component. There is no "standard" way in Java to create an OpenGL context.

llama said:

How would you plan to do this "setup" yourself? For jME to work, an OpenGL context has to be created. This is implementation specific, so this is abstracted in the DisplaySystem, which you can use to create a window (fullscreen or not), or another context such as the already mentioned AWT/Swing component. There is no "standard" way in Java to create an OpenGL context.


Well, im not an JOGL or LWJGL noob  :D I've my own abstract layer for all this setup stuff ready. I would only like to use JMonkeyEngine within a implementaion. So how to do that ?

regards,
Jens

I kind of got that… the problem is still there's no standard way to pass an OpenGL context, so how could jME implement you passing one to it? You can try hacking it into LWJGLDisplaySystem, maybe if you can find a good generic (LWJGL) way for it we can even include it in jME.

Hmm,



may i missunderstood something. LWJGL is wide supported by JMonkeyEngine,right ? I thought it lack the JOGL related setup ?



For me i only want to know how to use JMonkeyEngine without any call to the DisplaySystem ?

In LWJGL you have to put all your stuff into paintGL() method may framework have something similar

but for each Binding. Too use JMonkeyEngine what should be called when the Method paintGl Method is first called ?

May i can setup most not only in a paintGL() method.



regards,

Jens

You'll need a display system. It's used for default renderstates, render to texture, etc.



There's no function in jME that tells jME to render to certain (LWJGL) GL context that you somehow created (because the jME framework is independant of LWGJL or JOGL etc.), if you want to hack that in, the best place is in the LWJGL implementation for jME, and then likely in LWJGLDisplaySystem.



paintGL(), as far as I can see in the LWJGL code, only has to do with AWT/LWJGL integration, you certainly don't have to put all your "stuff" there. jME has it's own AWT/Swing intergration (createCanvas() in DisplaySystem) which in the case of LWJGL of course uses LWJGL's AWTGLCanvas.



If for some reason you insist on creating this yourself, then it's time to start looking at the jME code, this conversation should have given you some hints where to look for how jME sets up it's display system. Look at BaseGame and follow the methods there for an example of jME is set up, and it's rendering loop, and how the rendering works.