com.jogamp.opengl.impl.macosx.cgl
Class MacOSXCGLDrawableFactory

java.lang.Object
  extended by javax.media.opengl.GLDrawableFactory
      extended by com.jogamp.opengl.impl.GLDrawableFactoryImpl
          extended by com.jogamp.opengl.impl.macosx.cgl.MacOSXCGLDrawableFactory
Direct Known Subclasses:
MacOSXAWTCGLDrawableFactory

public class MacOSXCGLDrawableFactory
extends GLDrawableFactoryImpl


Field Summary
 
Fields inherited from class com.jogamp.opengl.impl.GLDrawableFactoryImpl
DEBUG
 
Constructor Summary
MacOSXCGLDrawableFactory()
           
 
Method Summary
 boolean canCreateContextOnJava2DSurface(AbstractGraphicsDevice device)
           
 boolean canCreateExternalGLDrawable(AbstractGraphicsDevice device)
          Returns true if it is possible to create an external GLDrawable object via GLDrawableFactory.createExternalGLDrawable().
 boolean canCreateGLPbuffer(AbstractGraphicsDevice device)
          Returns true if it is possible to create a GLPbuffer.
 GLContext createContextOnJava2DSurface(Object graphics, GLContext shareWith)
           
 GLContext createExternalGLContext()
           Creates a GLContext object representing an existing OpenGL context in an external (third-party) OpenGL-based library.
 GLDrawable createExternalGLDrawable()
           Creates a GLDrawable object representing an existing OpenGL drawable in an external (third-party) OpenGL-based library.
protected  GLDrawableImpl createGLPbufferDrawableImpl(NativeWindow target)
          Target must implement SurfaceChangeable
protected  GLDrawableImpl createOffscreenDrawable(NativeWindow target)
           
protected  NativeWindow createOffscreenWindow(GLCapabilities capabilities, GLCapabilitiesChooser chooser, int width, int height)
          creates an offscreen NativeWindow, which must implement SurfaceChangeable as well, so the windowing system related implementation is able to set the surface handle.
 GLDrawableImpl createOnscreenDrawable(NativeWindow target)
           
protected  Buffer getGammaRamp()
          Gets the current gamma ramp.
protected  int getGammaRampLength()
          Returns the length of the computed gamma ramp for this OS and hardware.
 GLDynamicLookupHelper getGLDynamicLookupHelper(int profile)
          Returns the GLDynamicLookupHelper
protected  GLContextImpl getSharedContext()
           
protected  GLDrawableImpl getSharedDrawable()
           
protected  void resetGammaRamp(Buffer originalGammaRamp)
          Resets the gamma ramp, potentially using the specified Buffer as data to restore the original values.
protected  boolean setGammaRamp(float[] ramp)
          Sets the gamma ramp for the main screen.
protected  void shutdown()
           
 
Methods inherited from class com.jogamp.opengl.impl.GLDrawableFactoryImpl
createGLDrawable, createGLPbuffer, createGLPbufferDrawable, createGLPbufferDrawable, createOffscreenDrawable, getFactoryImpl, maybeDoSingleThreadedWorkaround, resetDisplayGamma, setDisplayGamma
 
Methods inherited from class javax.media.opengl.GLDrawableFactory
getFactory, getFactoryImpl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MacOSXCGLDrawableFactory

public MacOSXCGLDrawableFactory()
Method Detail

getGLDynamicLookupHelper

public GLDynamicLookupHelper getGLDynamicLookupHelper(int profile)
Description copied from class: GLDrawableFactoryImpl
Returns the GLDynamicLookupHelper

Specified by:
getGLDynamicLookupHelper in class GLDrawableFactoryImpl
Parameters:
profile - if EGL/ES, profile 1 refers to ES1 and 2 to ES2, otherwise the profile is ignored.

shutdown

protected void shutdown()
Specified by:
shutdown in class GLDrawableFactoryImpl

getSharedDrawable

protected final GLDrawableImpl getSharedDrawable()
Specified by:
getSharedDrawable in class GLDrawableFactoryImpl

getSharedContext

protected final GLContextImpl getSharedContext()
Specified by:
getSharedContext in class GLDrawableFactoryImpl

createOnscreenDrawable

public GLDrawableImpl createOnscreenDrawable(NativeWindow target)
Specified by:
createOnscreenDrawable in class GLDrawableFactoryImpl

createOffscreenDrawable

protected GLDrawableImpl createOffscreenDrawable(NativeWindow target)
Specified by:
createOffscreenDrawable in class GLDrawableFactoryImpl

canCreateGLPbuffer

public boolean canCreateGLPbuffer(AbstractGraphicsDevice device)
Description copied from class: GLDrawableFactory
Returns true if it is possible to create a GLPbuffer. Some older graphics cards do not have this capability.

Specified by:
canCreateGLPbuffer in class GLDrawableFactory

createGLPbufferDrawableImpl

protected GLDrawableImpl createGLPbufferDrawableImpl(NativeWindow target)
Description copied from class: GLDrawableFactoryImpl
Target must implement SurfaceChangeable

Specified by:
createGLPbufferDrawableImpl in class GLDrawableFactoryImpl

createOffscreenWindow

protected NativeWindow createOffscreenWindow(GLCapabilities capabilities,
                                             GLCapabilitiesChooser chooser,
                                             int width,
                                             int height)
Description copied from class: GLDrawableFactoryImpl
creates an offscreen NativeWindow, which must implement SurfaceChangeable as well, so the windowing system related implementation is able to set the surface handle.

Specified by:
createOffscreenWindow in class GLDrawableFactoryImpl

createExternalGLContext

public GLContext createExternalGLContext()
Description copied from class: GLDrawableFactory

Creates a GLContext object representing an existing OpenGL context in an external (third-party) OpenGL-based library. This GLContext object may be used to draw into this preexisting context using its GL and GLU objects. New contexts created through GLDrawables may share textures and display lists with this external context.

The underlying OpenGL context must be current on the current thread at the time this method is called. The user is responsible for the maintenance of the underlying OpenGL context; calls to makeCurrent and release on the returned GLContext object have no effect. If the underlying OpenGL context is destroyed, the destroy method should be called on the GLContext. A new GLContext object should be created for each newly-created underlying OpenGL context.

Specified by:
createExternalGLContext in class GLDrawableFactory

canCreateExternalGLDrawable

public boolean canCreateExternalGLDrawable(AbstractGraphicsDevice device)
Description copied from class: GLDrawableFactory
Returns true if it is possible to create an external GLDrawable object via GLDrawableFactory.createExternalGLDrawable().

Specified by:
canCreateExternalGLDrawable in class GLDrawableFactory

createExternalGLDrawable

public GLDrawable createExternalGLDrawable()
Description copied from class: GLDrawableFactory

Creates a GLDrawable object representing an existing OpenGL drawable in an external (third-party) OpenGL-based library. This GLDrawable object may be used to create new, fully-functional GLContexts on the OpenGL drawable. This is useful when interoperating with a third-party OpenGL-based library and it is essential to not perturb the state of the library's existing context, even to the point of not sharing textures or display lists with that context.

An underlying OpenGL context must be current on the desired drawable and the current thread at the time this method is called. The user is responsible for the maintenance of the underlying drawable. If one or more contexts are created on the drawable using GLDrawable.createContext(javax.media.opengl.GLContext), and the drawable is deleted by the third-party library, the user is responsible for calling GLContext.destroy() on these contexts.

Calls to setSize, getWidth and getHeight are illegal on the returned GLDrawable. If these operations are required by the user, they must be performed by the third-party library.

It is legal to create both an external GLContext and GLDrawable representing the same third-party OpenGL entities. This can be used, for example, to query current state information using the external GLContext and then create and set up new GLContexts using the external GLDrawable.

This functionality may not be available on all platforms and GLDrawableFactory.canCreateExternalGLDrawable(javax.media.nativewindow.AbstractGraphicsDevice) should be called first to see if it is present. For example, on X11 platforms, this API requires the presence of GLX 1.3 or later.

Specified by:
createExternalGLDrawable in class GLDrawableFactory

canCreateContextOnJava2DSurface

public boolean canCreateContextOnJava2DSurface(AbstractGraphicsDevice device)
Specified by:
canCreateContextOnJava2DSurface in class GLDrawableFactoryImpl

createContextOnJava2DSurface

public GLContext createContextOnJava2DSurface(Object graphics,
                                              GLContext shareWith)
                                       throws GLException
Specified by:
createContextOnJava2DSurface in class GLDrawableFactoryImpl
Throws:
GLException

getGammaRampLength

protected int getGammaRampLength()
Returns the length of the computed gamma ramp for this OS and hardware. Returns 0 if gamma changes are not supported.

Overrides:
getGammaRampLength in class GLDrawableFactoryImpl

setGammaRamp

protected boolean setGammaRamp(float[] ramp)
Description copied from class: GLDrawableFactoryImpl
Sets the gamma ramp for the main screen. Returns false if gamma ramp changes were not supported.

Overrides:
setGammaRamp in class GLDrawableFactoryImpl

getGammaRamp

protected Buffer getGammaRamp()
Description copied from class: GLDrawableFactoryImpl
Gets the current gamma ramp. This is basically an opaque value used only on some platforms to reset the gamma ramp to its original settings.

Overrides:
getGammaRamp in class GLDrawableFactoryImpl

resetGammaRamp

protected void resetGammaRamp(Buffer originalGammaRamp)
Description copied from class: GLDrawableFactoryImpl
Resets the gamma ramp, potentially using the specified Buffer as data to restore the original values.

Overrides:
resetGammaRamp in class GLDrawableFactoryImpl


Copyright 2010 JogAmp Community.