Non null RenderContext...

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Non null RenderContext...

ThomasR
Hi,

How to get a non null RenderContext, or how to know when the RenderContext exists? Just adding the Canvas to a isShowing window doesn't seem to be enough. I really need to know things like textureWidthMax before I start processing.

Tom
Reply | Threaded
Open this post in threaded view
|

Re: Non null RenderContext...

gouessej
Administrator
Hey

It's not possible because the canvas has to pick a profile during its initialization and different profiles can support different maximum texture widths. A context can even have to be created several times during the life cycle of a canvas. You should get this information when the canvas has been fully initialized. Note that JogAmp's Ardor3D Continuation is able to resize the textures if they are too big.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Non null RenderContext...

ThomasR
Hi,

Is it possible to supply a profile (same as GraphicsConfiguration?) that remains fixed?  Just use the best profile the graphics hardware can support?  Very interesting that textures can be auto sized, but we wouldn't want to do that. We have algos to break large textures into tiles that are stitched together.

Tom
Reply | Threaded
Open this post in threaded view
|

Re: Non null RenderContext...

gouessej
Administrator
It's possible to provide a utility to decide which profile should be picked but a given profile doesn't contain this information, it's in the context. The default utility already does its best but you can't know the maximum texture size before the initialization. You should run your processing after this phase.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Non null RenderContext...

ThomasR
Is there a way to wait or listen for the initialization to be complete?
Reply | Threaded
Open this post in threaded view
|

Re: Non null RenderContext...

gouessej
Administrator
You can call JoglNewtWindow.getNewtWindow().isRealized(). The field "_inited" isn't exposed in the public API because it makes more sense to use a render queue or to call invoke(boolean, GLRunnable) once to be sure the initialization is complete.

I wanted to look at my source code to give you an example but Sourceforge is partially broken today, I'm fed up, I will end up by hosting everything on my own server that just works.
Julien Gouesse | Personal blog | Website