Package panamagl.factory
Interface PanamaGLFactory
- All Superinterfaces:
PlatformMatcher
- All Known Implementing Classes:
APanamaGLFactory
A
} which picks the
first 
PanamaGLFactory generates components for a given platform (CPU, OS) and will ensure the
appropriate bindings as well as OpenGL way of implementing a rendering technic are applied a
target platform.
Platforms are resolved automatically through
invalid @link
{@link PanamaGLFactory.select()
PanamaGLFactory in classpath that PlatformMatcher.matches(Platform) hence the executing
computer.
PanamaGL component initialization starts while initializing a new GLCanvas for adding to
an existing UI. The canvas will initialize all subsequent required components in order and will
only require a GLEventListener to perform the application OpenGL calls through the
GL interface.
The initialization hence looks like :
GLEventAdapter listener = TeapotGLEventListener();
PanamaGLFactory factory = PanamaGLFactory.select();
GLCanvasSwing panel = new GLCanvasSwing();
panel.setGLEventListener(listener);
frame.add(panel);
Classes generated by the available factories are represented below :

- Author:
- Martin Pernollet
-
Method Summary
Modifier and TypeMethodDescriptionvoidDestroy theGLContextthat has been initialized (and cached) by this factory.newFBO(int width, int height) Initialize anFBOthat can be used by aOffscreenRendererto initialize GPU buffers for rendering offscreen.newGL()Initialize a platform dependentGLInitialize a platform dependentGLContextlater allowing to invoke OpenGL.newOffscreenRenderer(FBOReader reader) Initialize anOffscreenRendererthat can be used by aGLCanvasto render OpenGL.static PanamaGLFactoryselect()Returns the first factory that is is compatible with the currentPlatform.static PanamaGLFactoryvoidsetThreadRedirect(ThreadRedirect threadRedirect) If a thread redirection is defined and non null, it will be applied to theOffscreenRenderergenerated by this factory while callingnewOffscreenRenderer(FBOReader).Methods inherited from interface panamagl.platform.PlatformMatcher
matches
-
Method Details
-
newGL
-
newGLContext
GLContext newGLContext()Initialize a platform dependentGLContextlater allowing to invoke OpenGL. This method will both initialize the context and call itsGLContext.init()method that load the related native libraries and OpenGL function pointers required to configure the context.- Returns:
-
newFBO
Initialize anFBOthat can be used by aOffscreenRendererto initialize GPU buffers for rendering offscreen.- Parameters:
width-height-- Returns:
-
newOffscreenRenderer
Initialize anOffscreenRendererthat can be used by aGLCanvasto render OpenGL. The offscreen renderer will initializeGL,GLContextandFBOinstances with this factory. If aThreadRedirecthas been set on this factory, it will be set to the offscreen renderer to customize the thread to which the opengl rendering is applied. -
destroyContext
void destroyContext()Destroy theGLContextthat has been initialized (and cached) by this factory. -
setThreadRedirect
If a thread redirection is defined and non null, it will be applied to theOffscreenRenderergenerated by this factory while callingnewOffscreenRenderer(FBOReader). If it is null, theOffscreenRendererwill keep its default thread redirection. -
getThreadRedirect
ThreadRedirect getThreadRedirect() -
select
Returns the first factory that is is compatible with the currentPlatform. -
selectFor
-