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

java.lang.Object
  extended by javax.media.opengl.GLContext
      extended by com.jogamp.opengl.impl.GLContextImpl
          extended by com.jogamp.opengl.impl.macosx.cgl.MacOSXCGLContext
Direct Known Subclasses:
MacOSXExternalCGLContext, MacOSXJava2DCGLContext, MacOSXOnscreenCGLContext, MacOSXPbufferCGLContext

public abstract class MacOSXCGLContext
extends GLContextImpl


Field Summary
protected  boolean isNSContext
           
 
Fields inherited from class com.jogamp.opengl.impl.GLContextImpl
currentSwapInterval, DEBUG, drawable, drawableRead, extensionAvailability, gl, hasNativeES2Methods, lock, mappedContextTypeObjectLock, mappedExtensionAvailabilityCache, mappedGLProcAddress, mappedGLXProcAddress
 
Fields inherited from class javax.media.opengl.GLContext
CONTEXT_CURRENT, CONTEXT_CURRENT_NEW, CONTEXT_NOT_CURRENT, contextHandle, CTX_IS_ARB_CREATED, CTX_OPTION_ANY, CTX_OPTION_DEBUG, CTX_OPTION_FORWARD, CTX_PROFILE_COMPAT, CTX_PROFILE_CORE, CTX_PROFILE_ES, ctxMajorVersion, ctxMinorVersion, ctxOptions, ctxVersionString, DEBUG0, deviceVersionAvailable, GL_VERSIONS
 
Constructor Summary
protected MacOSXCGLContext(GLDrawableImpl drawable, GLContext shareWith)
           
 
Method Summary
 void bindPbufferToTexture()
          Pbuffer support; given that this is a GLContext associated with a pbuffer, binds this pbuffer to its texture target.
protected  void copyImpl(GLContext source, int mask)
           
protected  boolean create(boolean pbuffer, boolean floatingPoint)
          Creates and initializes an appropriate OpenGl Context (NS).
protected  long createContextARBImpl(long share, boolean direct, int ctp, int major, int minor)
          Platform dependent but harmonized implementation of the ARB_create_context mechanism to create a context.
This method is called from GLContextImpl.createContextARB(long, boolean, int[], int[], int[]).
The implementation shall verify this context with a MakeContextCurrent call.
The implementation shall leave the context current.
protected  void destroyContextARBImpl(long _context)
          Destroy the context created by GLContextImpl.createContextARBImpl(long, boolean, int, int, int).
protected  void destroyImpl()
           
 CGLExt getCGLExt()
           
 CGLExtProcAddressTable getCGLExtProcAddressTable()
           
protected  Map getExtensionNameMap()
           
protected  Map getFunctionNameMap()
           
 int getOffscreenContextPixelDataType()
          Only called for offscreen contexts; needed by glReadPixels
 int getOffscreenContextReadBuffer()
           
abstract  int getOpenGLMode()
           
 String getPlatformExtensionsString()
          Returns a non-null (but possibly empty) string containing the space-separated list of available platform-dependent (e.g., WGL, GLX) extensions.
 ProcAddressTable getPlatformExtProcAddressTable()
          Shall return the platform extension ProcAddressTable, ie for GLXExt, EGLExt, ..
 Object getPlatformGLExtensions()
           
 ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3)
           
 boolean isExtensionAvailable(String glExtensionName)
          Returns true if the specified OpenGL extension can be successfully called using this GL context given the current host (OpenGL client) and display (OpenGL server) configuration.
 boolean isGLReadDrawableAvailable()
          Return availability of GL read drawable.
protected  boolean isNSContext()
           
protected  void makeCurrentImpl(boolean newCreated)
           
 boolean offscreenImageNeedsVerticalFlip()
          On some platforms the mismatch between OpenGL's coordinate system (origin at bottom left) and the window system's coordinate system (origin at top left) necessitates a vertical flip of pixels read from offscreen contexts.
protected  void releaseImpl()
           
 void releasePbufferFromTexture()
          Pbuffer support; given that this is a GLContext associated with a pbuffer, releases this pbuffer from its texture target.
abstract  void setOpenGLMode(int mode)
           
protected  void setSwapIntervalImpl(int interval)
           
protected  void swapBuffers()
           
protected  void updateGLXProcAddressTable()
          Updates the platform's 'GLX' function cache
 
Methods inherited from class com.jogamp.opengl.impl.GLContextImpl
copy, createContextARB, createGL, createImpl, destroy, getBufferSizeTracker, getBufferStateTracker, getContextFQN, getContextFQN, getDrawableImpl, getFloatingPointMode, getGL, getGLDrawable, getGLExtensionsString, getGLProcAddressTable, getGLReadDrawable, getGLStateTracker, getSwapInterval, hasNativeES2Methods, hasWaiters, isExtensionCacheInitialized, isFunctionAvailable, isSynchronized, makeCurrent, makeCurrentLocking, mapToRealGLExtensionName, mapToRealGLFunctionName, release, resetProcAddressTable, resetStates, setBufferSizeTracker, setGL, setGLFunctionAvailability, setGLReadDrawable, setSwapInterval, setSynchronized, update
 
Methods inherited from class javax.media.opengl.GLContext
append, compose8bit, composed8BitToString, decrementGLVersion, getAttachedObject, getAttachedObject, getAvailableGLVersion, getAvailableGLVersion, getAvailableGLVersionAsString, getAvailableGLVersionsSet, getComposed8bit, getCurrent, getCurrentGL, getDeviceVersionAvailableKey, getGLVersion, getGLVersion, getGLVersionMajor, getGLVersionMinor, getHandle, getMaxMajor, getMaxMinor, getThreadName, hasGLSL, isCreated, isCreatedWithARBMethod, isCurrent, isGL2, isGL2Available, isGL2ES1, isGL2ES2, isGL2GL3, isGL3, isGL3Available, isGL3bc, isGL3bcAvailable, isGL4, isGL4Available, isGL4bc, isGL4bcAvailable, isGLCompatibilityProfile, isGLCoreProfile, isGLEmbeddedProfile, isGLES, isGLES1, isGLES1Available, isGLES2, isGLES2Available, isGLForwardCompatible, isGLVersionAvailable, isValidGLVersion, mapAvailableGLVersion, putAttachedObject, putAttachedObject, setAvailableGLVersionsSet, setCurrent, toHexString, toHexString, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

isNSContext

protected boolean isNSContext
Constructor Detail

MacOSXCGLContext

protected MacOSXCGLContext(GLDrawableImpl drawable,
                           GLContext shareWith)
Method Detail

getPlatformGLExtensions

public Object getPlatformGLExtensions()
Specified by:
getPlatformGLExtensions in class GLContextImpl

isNSContext

protected boolean isNSContext()

getCGLExt

public CGLExt getCGLExt()

getPlatformExtProcAddressTable

public final ProcAddressTable getPlatformExtProcAddressTable()
Description copied from class: GLContextImpl
Shall return the platform extension ProcAddressTable, ie for GLXExt, EGLExt, ..

Specified by:
getPlatformExtProcAddressTable in class GLContextImpl

getCGLExtProcAddressTable

public final CGLExtProcAddressTable getCGLExtProcAddressTable()

getFunctionNameMap

protected Map getFunctionNameMap()
Specified by:
getFunctionNameMap in class GLContextImpl

getExtensionNameMap

protected Map getExtensionNameMap()
Specified by:
getExtensionNameMap in class GLContextImpl

createContextARBImpl

protected long createContextARBImpl(long share,
                                    boolean direct,
                                    int ctp,
                                    int major,
                                    int minor)
Description copied from class: GLContextImpl
Platform dependent but harmonized implementation of the ARB_create_context mechanism to create a context.
This method is called from GLContextImpl.createContextARB(long, boolean, int[], int[], int[]).
The implementation shall verify this context with a MakeContextCurrent call.
The implementation shall leave the context current.

Specified by:
createContextARBImpl in class GLContextImpl
Parameters:
share - the shared context or null
direct - flag if direct is requested
ctp - ARB_create_context related, see references below
major - major number
minor - minor number
Returns:
the valid context if successfull, or null
See Also:
GLContextImpl.makeCurrent(), GLContext.CTX_PROFILE_COMPAT, GLContext.CTX_OPTION_FORWARD, GLContext.CTX_OPTION_DEBUG, GLContextImpl.makeCurrentImpl(boolean), #create, GLContextImpl.createContextARB(long, boolean, int[], int[], int[]), GLContextImpl.createContextARBImpl(long, boolean, int, int, int), GLContextImpl.destroyContextARBImpl(long)

destroyContextARBImpl

protected void destroyContextARBImpl(long _context)
Description copied from class: GLContextImpl
Destroy the context created by GLContextImpl.createContextARBImpl(long, boolean, int, int, int).

Specified by:
destroyContextARBImpl in class GLContextImpl
See Also:
GLContextImpl.makeCurrent(), GLContextImpl.makeCurrentImpl(boolean), #create, GLContextImpl.createContextARB(long, boolean, int[], int[], int[]), GLContextImpl.createContextARBImpl(long, boolean, int, int, int), GLContextImpl.destroyContextARBImpl(long)

isGLReadDrawableAvailable

public final boolean isGLReadDrawableAvailable()
Description copied from class: GLContext
Return availability of GL read drawable.

Specified by:
isGLReadDrawableAvailable in class GLContext
Returns:
true if a GL read drawable is supported with your driver, otherwise false.

create

protected boolean create(boolean pbuffer,
                         boolean floatingPoint)
Creates and initializes an appropriate OpenGl Context (NS). Should only be called by makeCurrentImpl().


makeCurrentImpl

protected void makeCurrentImpl(boolean newCreated)
                        throws GLException
Specified by:
makeCurrentImpl in class GLContextImpl
Throws:
GLException

releaseImpl

protected void releaseImpl()
                    throws GLException
Specified by:
releaseImpl in class GLContextImpl
Throws:
GLException

destroyImpl

protected void destroyImpl()
                    throws GLException
Specified by:
destroyImpl in class GLContextImpl
Throws:
GLException

copyImpl

protected void copyImpl(GLContext source,
                        int mask)
                 throws GLException
Specified by:
copyImpl in class GLContextImpl
Throws:
GLException

updateGLXProcAddressTable

protected final void updateGLXProcAddressTable()
Description copied from class: GLContextImpl
Updates the platform's 'GLX' function cache

Specified by:
updateGLXProcAddressTable in class GLContextImpl

getPlatformExtensionsString

public String getPlatformExtensionsString()
Description copied from class: GLContext
Returns a non-null (but possibly empty) string containing the space-separated list of available platform-dependent (e.g., WGL, GLX) extensions. Can only be called while this context is current.

Overrides:
getPlatformExtensionsString in class GLContextImpl

swapBuffers

protected void swapBuffers()

setSwapIntervalImpl

protected void setSwapIntervalImpl(int interval)
Overrides:
setSwapIntervalImpl in class GLContextImpl

glAllocateMemoryNV

public ByteBuffer glAllocateMemoryNV(int arg0,
                                     float arg1,
                                     float arg2,
                                     float arg3)
Specified by:
glAllocateMemoryNV in class GLContextImpl

isExtensionAvailable

public boolean isExtensionAvailable(String glExtensionName)
Description copied from class: GLContextImpl
Returns true if the specified OpenGL extension can be successfully called using this GL context given the current host (OpenGL client) and display (OpenGL server) configuration. See GLBase.isExtensionAvailable(String) for more details.

Overrides:
isExtensionAvailable in class GLContextImpl
Parameters:
glExtensionName - the name of the OpenGL extension (e.g., "GL_VERTEX_PROGRAM_ARB").

getOffscreenContextPixelDataType

public int getOffscreenContextPixelDataType()
Description copied from class: GLContextImpl
Only called for offscreen contexts; needed by glReadPixels

Specified by:
getOffscreenContextPixelDataType in class GLContextImpl

getOffscreenContextReadBuffer

public int getOffscreenContextReadBuffer()

offscreenImageNeedsVerticalFlip

public boolean offscreenImageNeedsVerticalFlip()
Description copied from class: GLContextImpl
On some platforms the mismatch between OpenGL's coordinate system (origin at bottom left) and the window system's coordinate system (origin at top left) necessitates a vertical flip of pixels read from offscreen contexts.

Specified by:
offscreenImageNeedsVerticalFlip in class GLContextImpl

bindPbufferToTexture

public void bindPbufferToTexture()
Description copied from class: GLContextImpl
Pbuffer support; given that this is a GLContext associated with a pbuffer, binds this pbuffer to its texture target.

Specified by:
bindPbufferToTexture in class GLContextImpl

releasePbufferFromTexture

public void releasePbufferFromTexture()
Description copied from class: GLContextImpl
Pbuffer support; given that this is a GLContext associated with a pbuffer, releases this pbuffer from its texture target.

Specified by:
releasePbufferFromTexture in class GLContextImpl

setOpenGLMode

public abstract void setOpenGLMode(int mode)

getOpenGLMode

public abstract int getOpenGLMode()


Copyright 2010 JogAmp Community.