Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## gl4java
Class GLContext

    java.lang.Object
      |
      +--gl4java.GLContext

All Implemented Interfaces:
  java.lang.Runnable

public class GLContext
extends java.lang.Object
implements java.lang.Runnable

The base manager class for the OpenGL language mapping for Java !

If you are interessting in further Documentation and/or the history of GL4Java follow the following link.

    The GL4Java Documentation

All native libraries and GLFunc* and GLUFunc* implementations can/should be loaded right here !

    doLoadNativeLibraries
    createGLFunc
    createGLUFunc

    To check the library versions, you can start the
    main
    function with java gl4java.GLContext

This class creates a GLContext in the constructor which fits to the native Window of the given Component !

    glc2glj - A simple c to java converter for C- and GL-types

The native libraries are plattform depended.

    The default native library's are:

    GL4JavaJauGljJNI    (jdk ==1.1),
    GL4JavaJauGljJNI12  (jdk ==1.2),
    GL4JavaJauGljJNI13  (jdk ==1.3)
    GL4JavaJauGljJNI14  (jdk >=1.4)

    To check wich version and vendors are currently used,
    just call while a GLContext is created :

    gljShowVersions

    Or just run at the command line:

    java gl4java.GLContext -info

Make sure that this library is installed in your library path. The library path is for Unices one path of the environment variable ´LD_LIBRARY_PATH´ and for Windows 32 ´c:/winnt/system32´ (WinNT) or 'c:/windows/system' (Windows 95) . Or it should be installed in the 'jre/bin' or 'Netscape/communicator/Program/java/bin' path !

To have a convinient usage, e.g. automatic resizing, GLContext and painting/gl-rendering, some classes in the package gl4java.awt may help you.

    E.g.: gl4java.awt.GLCanvas

    init to create the java-stuff and GL-inits
    display to render one frame, called by paint
    reshape to reshape (window resize)

    Or look for animation at
    gl4java.awt.GLAnimCanvas !

IF you remove/release a The component which is binded to this GLContext, you have to release the GLContext also - while calling:

    gljDestroy

before releasing/dispose it´s Window !

We also define our own OpenGL extension. This extension functions start with the prefix glj like you can see here:

    THIS FUNCTIONS ARE FOR USERS PURPOSES:
    ======================================

    doLoadNativeLibraries
    createGLFunc
    createGLUFunc
    gljIsInit
    gljMakeCurrent
    gljSwap
    gljFree
    gljDestroy
    gljGetNativeLibVersion
    gljGetClassVersion
    gljShowVersions
    gljCheckGL
    gljCheckGLTypes
    gljResize

You can see our example demo sources:

    olympicCvs.java as java source
    glLogoCvs.java as java source
    glDemosCvs.java as java source

If you are interessting in further Documentation, downloading the latest version, and/or the history of GL4Java click on the following link.

    The GL4Java Homepage

Version:
  2.00, 21. April 1999
Author:
  Sven Goethel

Field Summary
`protected java.awt.Component` | `_comp` the light- or heavy component where GL commands should be drawn
`protected java.awt.Component` | `_compHeavy` the heavy component where GL commands should be drawn if the _comp component is a swing (light) component, this component contains its heavy parent !
`protected java.awt.Container` | `containerWindow`
`protected boolean` | `createOwnWindow` We normally do not have to create an own Window ! This is the default visual property ...
`static java.lang.String` | `defGLFunc14Class`
`static java.lang.String` | `defGLFuncClass` The default GLFunc implementation
`static java.lang.String` | `defGljLib` The default GLContext/GLFunc/GLUFunc native library for all
`static java.lang.String` | `defGljMSWinLib` The default extra native library for Windows 95/NT && MS-JVM
`static java.lang.String` | `defGLUFunc14Class`
`static java.lang.String` | `defGLUFuncClass` The default GLUFunc implementation
`static java.lang.String` | `defNativeGLLibMacOS9` The default native GL library ...
`static java.lang.String` | `defNativeGLLibMacOSX` The default native GL library ...
`static java.lang.String` | `defNativeGLLibWin32` The default native GL library ...
`static java.lang.String` | `defNativeGLLibX11` The default native GL library ...
`static java.lang.String` | `defNativeGLULibMacOS9` The default native GLU library ...
`static java.lang.String` | `defNativeGLULibMacOSX` The default native GLU library ...
`static java.lang.String` | `defNativeGLULibWin32` The default native GLU library ...
`static java.lang.String` | `defNativeGLULibX11` The default native GLU library ...
`protected long` | `displayHandle`
`protected GLCapabilities` | `glCaps` The GLCapabilities ..
`protected long` | `glContext` We will store the GL Context right here.
`protected static int` | `glContextNumber`
`protected boolean` | `glEnabled` Flag to check, if the OpenGL-Context is active !
`static boolean` | `gljClassDebug` Flag's to enable/disable verbose Information.
`static boolean` | `gljNativeDebug`
`static boolean` | `gljThreadDebug`
`protected boolean` | `isInitialized`
`protected static boolean` | `libsLoaded` Flag is the native library is loaded.
`protected boolean` | `mustResize` The resize flag, which indicates a resize for the next paint function ! This flag will bes set in 'componentResized' and will be cleared after resize (glViewport) in sDisplay !!
`protected boolean` | `offScreenRenderer` Do we use offscreen rendering X11: pixmap eq window-ressources, window eq.
`protected java.awt.Dimension` | `offScrnSize` The custom set offscreen Size If this is set to != null, the offscreen pixmap is used in this size, not in the components-size (-> faster if smaller) Must be set via createOffScreenCtx
`static int` | `OsMac9` Variable to tell is where windows or not (X11) Usally X11 ;-)) Ok - lets give one to the Max :-)
`static int` | `OsMacX` Variable to tell is where windows or not (X11) Usally X11 ;-)) Ok - lets give one to the Max :-)
`static int` | `OsUnknown` Variable to tell is where windows or not (X11) Usally X11 ;-)) Ok - lets give one to the Max :-)
`static int` | `OsWindoof` Variable to tell is where windows or not (X11) Usally X11 ;-)) Ok - lets give one to the Max :-)
`static int` | `OsX11` Variable to tell is where windows or not (X11) Usally X11 ;-)) Ok - lets give one to the Max :-)
`protected long` | `pixmapHandle` Xwindow data AND Windows data for the widget
`protected GLContext` | `sharedGLContext` The context with witch display lists and textures will be shared.
`protected long` | `sharedGLContextNative`
`protected java.awt.Dimension` | `size`
`static java.lang.String` | `version` the version of this java-class ... Each is dezimal !
`protected long` | `windowHandle`

Constructor Summary
`` | `GLContext(java.awt.Component comp, GLFunc glf, GLUFunc gluf)` Constructor First the GLContext is fetched from the Component itself ! To do so, the Component is set visible if it is not ! We use a visual with doubleBuffer and NO stereoView ! Do not force a new native window ! If a GLContext is fetched, it is current !
`` | `GLContext(java.awt.Component comp, GLFunc glf, GLUFunc gluf, boolean _doubleBuffer, boolean _stereoView)` Constructor First the GLContext is fetched from the Component itself ! To do so, the Component is set visible if it is not ! If a GLContext is fetched, it is current ! ! WARNING ! This flag is just for testing purpose !!!
`` | `GLContext(java.awt.Component comp, GLFunc glf, GLUFunc gluf, boolean _doubleBuffer, boolean _stereoView, boolean _rgba)` Constructor First the GLContext is fetched from the Component itself ! To do so, the Component is set visible if it is not ! If a GLContext is fetched, it is current !
`protected` | `GLContext(java.awt.Component comp, GLFunc glf, GLUFunc gluf, boolean _createOwnWindow, boolean _offScreenRenderer, boolean _doubleBuffer, boolean _stereoView, boolean _rgba, int _stencilBits, int _accumSize, GLContext _sharedGLContext, java.awt.Dimension _offScrnSize)` Constructor This privat constructor is for all possible compinations and is called from the customized constructors.
`` | `GLContext(java.awt.Component comp, GLFunc glf, GLUFunc gluf, boolean _createOwnWindow, boolean _doubleBuffer, boolean _stereoView, boolean _rgba, int _stencilBits)` Constructor First the GLContext is fetched from the Component itself ! To do so, the Component is set visible if it is not ! If a GLContext is fetched, it is current !
`` | `GLContext(java.awt.Component comp, GLFunc glf, GLUFunc gluf, boolean _createOwnWindow, boolean _doubleBuffer, boolean _stereoView, boolean _rgba, int _stencilBits, int _accumSize)` Constructor First the GLContext is fetched from the Component itself ! To do so, the Component is set visible if it is not ! If a GLContext is fetched, it is current !
`` | `GLContext(java.awt.Component comp, GLFunc glf, GLUFunc gluf, boolean _createOwnWindow, boolean _doubleBuffer, boolean _stereoView, boolean _rgba, int _stencilBits, int _accumSize, GLContext _sharedGLContext)` Constructor First the GLContext is fetched from the Component itself ! To do so, the Component is set visible if it is not ! If a GLContext is fetched, it is current !
`` | `GLContext(java.awt.Component comp, GLFunc glf, GLUFunc gluf, boolean _doubleBuffer, boolean _stereoView, boolean _rgba, int _stencilBits)` Constructor First the GLContext is fetched from the Component itself ! To do so, the Component is set visible if it is not ! If a GLContext is fetched, it is current !
`` | `GLContext(java.awt.Component comp, GLFunc glf, GLUFunc gluf, boolean _doubleBuffer, boolean _stereoView, boolean _rgba, int _stencilBits, int _accumSize)` Constructor First the GLContext is fetched from the Component itself ! To do so, the Component is set visible if it is not ! If a GLContext is fetched, it is current !
`protected` | `GLContext(java.awt.Component comp, GLFunc glf, GLUFunc gluf, boolean _createOwnWindow, boolean _offScreenRenderer, java.awt.Dimension _offScrnSize, GLCapabilities _glCaps, GLContext _sharedGLContext)` Constructor This privat constructor is for all possible compinations and is called from the customized constructors.
`` | `GLContext(java.awt.Component comp, GLFunc glf, GLUFunc gluf, GLCapabilities _glCaps, GLContext _sharedGLContext)` Constructor First the GLContext is fetched from the Component itself ! To do so, the Component is set visible if it is not ! If a GLContext is fetched, it is current !

Method Summary
`void` | `createGLContext(java.awt.Graphics g)` createGLContext gets the window handle and calls gljInit, so the gl-context will be initialised here.
`static GLFunc` | `createGLFunc(java.lang.String vendorClass)` Support of loading a vendors GLFunc implementation Try to load the Class, if succesfull we do return the instance of it.
`static GLUFunc` | `createGLUFunc(java.lang.String vendorClass)` Support of loading a vendors GLUFunc implementation Try to load the Class, if succesfull we do return the instance of it.
`static GLContext` | `createOffScreenCtx(GLFunc glf, GLUFunc gluf, boolean _stereoView, boolean _rgba, int _stencilBits, int _accumSize, GLContext _sharedGLContext)` Constructor Function for offscreen rendering ! First the GLContext is fetched from the Component itself ! To do so, the Component is set visible if it is not ! If a GLContext is fetched, it is current !
`static GLContext` | `createOffScreenCtx(GLFunc glf, GLUFunc gluf, boolean _stereoView, boolean _rgba, int _stencilBits, int _accumSize, GLContext _sharedGLContext, java.awt.Dimension _offScrnSize)` Constructor Function for offscreen rendering ! First the GLContext is fetched from the Component itself ! To do so, the Component is set visible if it is not ! If a GLContext is fetched, it is current !
`static boolean` | `doLoadNativeLibraries(java.lang.String gljLibName, java.lang.String nativeGLLibName, java.lang.String nativeGLULibName)` Support of loading the native library seperatly.
`protected void` | `finalize()`
`int` | `getAccumSize()` Query the visual property ...
`GLCapabilities` | `getGLCapabilities()` Query the visual property ...
`GLFunc` | `getGLFunc()` Used to return the user given GLFunc implementation
`GLUFunc` | `getGLUFunc()` Used to return the user given GLUFunc implementation
`static java.lang.String` | `getJVMVendor()`
`static java.lang.String` | `getJVMVersion()`
`static int` | `getJVMVersionMajor()`
`static int` | `getJVMVersionMinor()`
`long` | `getNativeGLContext()` Get the native GL Context !
`static int` | `getNativeGLContextNumber()`
`static java.lang.String` | `getNativeOSName()`
`static int` | `getNativeOSType()` Get the native OS-Type !
`long` | `getNativeWindoHandle()` Deprecated. The native window handle is no more accessible through this method since JDK >= 1.3 !
`GLContext` | `getSharedGLContext()` Get the optional shared GL Context !
`int` | `getStencilBitNumber()` Query the visual property ...
`boolean` | `gljCheckGL()`
`static boolean` | `gljCheckGLTypes()` native C function to check the gl types.
`boolean` | `gljDestroy()` gljDestroy destroy´s the GL Context This function should be called when removing a GLContext !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Call gljFree befor this method, to be sure ..
`static boolean` | `gljFetchGLFunctions(java.lang.String gllibname, java.lang.String glulibname, boolean force)` This functions fetches/dispatches the GL/GLU functions, which must be allready loaded via the doLoadNativeLibraries function !
`boolean` | `gljFree()` gljFree free´s the GL Context This MUST be called at last in your display function !
`boolean` | `gljFree(boolean force)` gljFree free´s the GL Context This MUST be called at last in your display function !
`static java.lang.String` | `gljGetClassVendor()` function to achieve the java-class vendor ! now it is possible to check the java-class at runtime !
`static java.lang.String` | `gljGetClassVersion()` function to achieve the java-class version ! now it is possible to check the java-class at runtime !
`static long` | `gljGetCurrentContext()` gljGetCurrentContext fetches the current native GL-Context, which is attached to this _native_ thread !
`static java.lang.String` | `gljGetNativeLibVendor()` native C function to achieve the native lib vendor ! now it is possible to check the native-lib at runtime !
`static java.lang.String` | `gljGetNativeLibVersion()` native C function to achieve the native lib version ! now it is possible to check the native-lib at runtime !
`java.lang.String` | `gljGetVersions()` function to achieve complete version info Be sure that the native library must be loaded !
`java.lang.String` | `gljGetVersions(boolean verbose)`
`protected void` | `gljInit()` Initializes the gl-context.
`boolean` | `gljIsCurrent()` gljIsCurrent checks if the current Thread holds the GL context of this GLContext instance !
`boolean` | `gljIsInit()` Checks if the gl-context is Initializes If returns true, gljInit is allready called and a valid gl-context is achieved.
`boolean` | `gljIsRequested()` gljIsRequested checks if the this GLContext instance's native context is requested by another thread !
`boolean` | `gljMakeCurrent()` gljMakeCurrent checks whether GL4Java is initializes AND makes the GL-Context current for this thread.
`boolean` | `gljMakeCurrent(boolean freeContextFirst)` Deprecated. The argument freeContextFirst is obsolete !
`static void` | `gljReadPixelGL2AWT(int pack_rowlen, int pack_x, int pack_y, int x, int y, int width, int height, int format, int type, int bufferName, byte[] pixelGLDest)` This functions reads the pixel from the GL frame and puts it into the pixelDest array, while using hardware correct AWT and GL pixel format, using GL_BGR and BufferedImage.TYPE_3BYTE_BGR !
`static void` | `gljReadPixelGL2AWT(int pack_rowlen, int pack_x, int pack_y, int x, int y, int width, int height, int format, int type, int bufferName, int[] pixelDest)` This functions reads the pixel from the GL frame and puts it into the pixelDest array, while converting them correctly to the AWT pixel format, using GL_BGRA and BufferedImage.TYPE_INT_ARGB !
`static void` | `gljReadPixelGL2AWT(int pack_rowlen, int pack_x, int pack_y, int x, int y, int width, int height, int format, int type, int bufferName, short[] pixelDest)` This functions reads the pixel from the GL frame and puts it into the pixelDest array, while converting them correctly to the AWT pixel format, using GL_RGB and BufferedImage.TYPE_USHORT_565_RGB !
`void` | `gljResize(int width, int height)` Resizes the gl-viewport Should be called, if the component is resized.
`java.awt.Frame` | `gljShowVersions()` function to show complete version info into an extra Frame Be sure that the native library must be loaded !
`boolean` | `gljSwap()` swap method are for double buffering
`static boolean` | `gljTestGLProc(java.lang.String name, boolean verbose)` This functions checks the existence of the GL functions !
`protected boolean` | `hasJAWTSurfaceChanged(long thisWin)` native C function of GLJ Library, which query if the JAWT Surface has changed ! Use this after gljMakeCurrent -> jawt_lock ! If true, we need a new GLContext !
`boolean` | `isDoubleBuffer()` Query the visual property ...
`boolean` | `isEnabled()` This function queries, if the GL-Context is enabled !
`static boolean` | `isMicrosoftJVM()`
`static boolean` | `isNetscapeJVM()`
`boolean` | `isOwnWindowCreated()` Query the visual property ...
`boolean` | `isRGBA()` Query the visual property ...
`boolean` | `isStereoView()` Query the visual property ...
`protected static boolean` | `loadJAWT()` Routine which causes jawt.dll/libjawt.so to be loaded if that is how the window handles are being obtained.
`static boolean` | `loadNativeLibraries(java.lang.String gljLibName, java.lang.String glLibName, java.lang.String gluLibName)` Deprecated. The arguments glLibName and gluLibName are obsolete, because all glj/gl/glu stuff resides within the gljLib ! Now you can use doLoadNativeLibraries !
`static void` | `main(java.lang.String[] args)` Test to load the native library, GLFunc and GLUFunc implementation ! If succesfull, a Frame will created and the GL-Infos (vendor, ...) are shown in it !
`protected boolean` | `openOpenGLNative(java.awt.Component canvas)` native C function to open the OpenGLwidget
`void` | `run()` For MSJVM Only ! This functions fetches the window-handle within a special thread !
`void` | `setEnabled(boolean b)` This function enables, disables the GL-Context ! If false is given, the openGL renderer/context is disabled and disconected (gljFree is called, if initialized) ! If disabled, all GL Functions are disabled but the Destroy & Free are not !
`void` | `setGLFunc(GLFunc _gl)` Used to set the user given GLFunc implementation
`void` | `setGLUFunc(GLUFunc _glu)` Used to set the user given GLUFunc implementation
`void` | `setVisible(boolean visible)` Own setVisible This one set's us visible - and wait's for that result !
`protected static boolean` | `useJAWT()` native C function of GLJ Library, which query if it uses the JDK 1.3 JAWT interface to fetch the native window handle

Methods inherited from class java.lang.Object
`clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### isInitialized

    protected boolean isInitialized

### libsLoaded

    protected static boolean libsLoaded

  Flag is the native library is loaded. The native library is loaded at startup. If we failed loading the lib., gljMakeCurrent and gljIsInit will return false.
  See Also:
    `gljIsInit()`

### defGljMSWinLib

    public static final java.lang.String defGljMSWinLib

  The default extra native library for Windows 95/NT && MS-JVM

### defGljLib

    public static final java.lang.String defGljLib

  The default GLContext/GLFunc/GLUFunc native library for all

### defGLFuncClass

    public static final java.lang.String defGLFuncClass

  The default GLFunc implementation

### defGLFunc14Class

    public static final java.lang.String defGLFunc14Class

### defGLUFuncClass

    public static final java.lang.String defGLUFuncClass

  The default GLUFunc implementation

### defGLUFunc14Class

    public static final java.lang.String defGLUFunc14Class

### defNativeGLLibX11

    public static final java.lang.String defNativeGLLibX11

  The default native GL library ... for X11

### defNativeGLLibMacOS9

    public static final java.lang.String defNativeGLLibMacOS9

  The default native GL library ... for MacOS9

### defNativeGLLibMacOSX

    public static final java.lang.String defNativeGLLibMacOSX

  The default native GL library ... for MacOSX

### defNativeGLLibWin32

    public static final java.lang.String defNativeGLLibWin32

  The default native GL library ... for Win32

### defNativeGLULibX11

    public static final java.lang.String defNativeGLULibX11

  The default native GLU library ... for X11

### defNativeGLULibMacOS9

    public static final java.lang.String defNativeGLULibMacOS9

  The default native GLU library ... for MacOS9

### defNativeGLULibMacOSX

    public static final java.lang.String defNativeGLULibMacOSX

  The default native GLU library ... for MacOSX

### defNativeGLULibWin32

    public static final java.lang.String defNativeGLULibWin32

  The default native GLU library ... for Win32

### version

    public static final java.lang.String version

  the version of this java-class ... Each is dezimal !

### gljClassDebug

    public static boolean gljClassDebug

  Flag's to enable/disable verbose Information. Usually for debugging.

### gljThreadDebug

    public static boolean gljThreadDebug

### gljNativeDebug

    public static boolean gljNativeDebug

### glContext

    protected long glContext

  We will store the GL Context right here.
  See Also:
    `createGLContext(java.awt.Graphics)`, `gljInit()`

### glContextNumber

    protected static int glContextNumber

### sharedGLContext

    protected GLContext sharedGLContext

  The context with witch display lists and textures will be shared.
  See Also:
    `createGLContext(java.awt.Graphics)`, `gljInit()`

### sharedGLContextNative

    protected long sharedGLContextNative

### pixmapHandle

    protected long pixmapHandle

  Xwindow data AND Windows data for the widget
  See Also:
    `createGLContext(java.awt.Graphics)`, `gljInit()`

### windowHandle

    protected long windowHandle

### displayHandle

    protected long displayHandle

### containerWindow

    protected java.awt.Container containerWindow

### offScrnSize

    protected java.awt.Dimension offScrnSize

  The custom set offscreen Size If this is set to != null, the offscreen pixmap is used in this size, not in the components-size (-> faster if smaller) Must be set via createOffScreenCtx
  See Also:
    `JComponent.paint(java.awt.Graphics)`, `createOffScreenCtx(gl4java.GLFunc, gl4java.GLUFunc, boolean, boolean, int, int, gl4java.GLContext)`

### glEnabled

    protected boolean glEnabled

  Flag to check, if the OpenGL-Context is active !
  See Also:
    `isEnabled()`, `setEnabled(boolean)`

### offScreenRenderer

    protected boolean offScreenRenderer

  Do we use offscreen rendering X11: pixmap eq window-ressources, window eq. GLXPixmap a GLXDrawable glContext eq. GLXContext This is set via the constructor !
  See Also:
    `GLContext(java.awt.Component, gl4java.GLFunc, gl4java.GLUFunc, boolean, boolean, java.awt.Dimension, gl4java.GLCapabilities, gl4java.GLContext)`

### createOwnWindow

    protected boolean createOwnWindow

  We normally do not have to create an own Window ! This is the default visual property ... ! But some machines, like SGI's Irix, must use an own created overlapped window ! For these machines, a compiler flag is set, so that this value is alsways set to true ! This is set via the constructor !
  See Also:
    `isOwnWindowCreated()`, `GLContext(java.awt.Component, gl4java.GLFunc, gl4java.GLUFunc, boolean, boolean, java.awt.Dimension, gl4java.GLCapabilities, gl4java.GLContext)`

### glCaps

    protected GLCapabilities glCaps

  The GLCapabilities .. This is set via the constructor !
  See Also:
    `GLContext(java.awt.Component, gl4java.GLFunc, gl4java.GLUFunc, boolean, boolean, java.awt.Dimension, gl4java.GLCapabilities, gl4java.GLContext)`

### mustResize

    protected boolean mustResize

  The resize flag, which indicates a resize for the next paint function ! This flag will bes set in 'componentResized' and will be cleared after resize (glViewport) in sDisplay !!
  See Also:
    `GLCanvas.sDisplay()`

### size

    protected java.awt.Dimension size

### _comp

    protected java.awt.Component _comp

  the light- or heavy component where GL commands should be drawn

### _compHeavy

    protected java.awt.Component _compHeavy

  the heavy component where GL commands should be drawn if the _comp component is a swing (light) component, this component contains its heavy parent !

### OsWindoof

    public static final int OsWindoof

  Variable to tell is where windows or not (X11) Usally X11 ;-)) Ok - lets give one to the Max :-)

### OsUnknown

    public static final int OsUnknown

  Variable to tell is where windows or not (X11) Usally X11 ;-)) Ok - lets give one to the Max :-)

### OsX11

    public static final int OsX11

  Variable to tell is where windows or not (X11) Usally X11 ;-)) Ok - lets give one to the Max :-)

### OsMac9

    public static final int OsMac9

  Variable to tell is where windows or not (X11) Usally X11 ;-)) Ok - lets give one to the Max :-)

### OsMacX

    public static final int OsMacX

  Variable to tell is where windows or not (X11) Usally X11 ;-)) Ok - lets give one to the Max :-)

Constructor Detail

### GLContext

    protected GLContext(java.awt.Component comp,
                        GLFunc glf,
                        GLUFunc gluf,
                        boolean _createOwnWindow,
                        boolean _offScreenRenderer,
                        java.awt.Dimension _offScrnSize,
                        GLCapabilities _glCaps,
                        GLContext _sharedGLContext)

  Constructor This privat constructor is for all possible compinations and is called from the customized constructors. First the GLContext is fetched from the Component itself ! To do so, the Component is set visible if it is not ! If a GLContext is fetched, it is current !
  Parameters:
    `comp` - the users component for the gl-context
    `glf` - the users selected GLFunc implementation
    `glf` - the users selected GLUFunc implementation
    `_createOwnWindow` - the flag for the visual property
    `_offScreenRenderer` - the flag for the visual property
    `_offScrnSize` - the fixed offscreen pixmap size
    `_glCaps` - the GLCapabilities
    `_sharedGLContext` - the shared GLContext

### GLContext

    protected GLContext(java.awt.Component comp,
                        GLFunc glf,
                        GLUFunc gluf,
                        boolean _createOwnWindow,
                        boolean _offScreenRenderer,
                        boolean _doubleBuffer,
                        boolean _stereoView,
                        boolean _rgba,
                        int _stencilBits,
                        int _accumSize,
                        GLContext _sharedGLContext,
                        java.awt.Dimension _offScrnSize)

  Constructor This privat constructor is for all possible compinations and is called from the customized constructors. First the GLContext is fetched from the Component itself ! To do so, the Component is set visible if it is not ! If a GLContext is fetched, it is current !
  Parameters:
    `comp` - the users component for the gl-context
    `glf` - the users selected GLFunc implementation
    `glf` - the users selected GLUFunc implementation
    `_createOwnWindow` - the flag for the visual property
    `_offScreenRenderer` - the flag for the visual property
    `_doubleBuffer` - the flag for the visual property
    `_stereoView` - the flag for the visual property
    `_rgba` - the flag for the visual property
    `_stencilBits` - the flag for the visual property
    `_accumSize` - the flag for the visual property
    `_sharedGLContext` - the shared GLContext
    `_offScrnSize` - the fixed offscreen pixmap size

### GLContext

    public GLContext(java.awt.Component comp,
                     GLFunc glf,
                     GLUFunc gluf,
                     GLCapabilities _glCaps,
                     GLContext _sharedGLContext)

  Constructor First the GLContext is fetched from the Component itself ! To do so, the Component is set visible if it is not ! If a GLContext is fetched, it is current !
  Parameters:
    `comp` - the users component for the gl-context
    `glf` - the users selected GLFunc implementation
    `glf` - the users selected GLUFunc implementation
    `_glCaps` - the GLCapabilities
    `_sharedGLContext` - the shared GLContext

### GLContext

    public GLContext(java.awt.Component comp,
                     GLFunc glf,
                     GLUFunc gluf,
                     boolean _createOwnWindow,
                     boolean _doubleBuffer,
                     boolean _stereoView,
                     boolean _rgba,
                     int _stencilBits,
                     int _accumSize,
                     GLContext _sharedGLContext)

  Constructor First the GLContext is fetched from the Component itself ! To do so, the Component is set visible if it is not ! If a GLContext is fetched, it is current !
  Parameters:
    `comp` - the users component for the gl-context
    `glf` - the users selected GLFunc implementation
    `glf` - the users selected GLUFunc implementation
    `_createOwnWindow` - the flag for the visual property
    `_doubleBuffer` - the flag for the visual property
    `_stereoView` - the flag for the visual property
    `_rgba` - the flag for the visual property
    `_stencilBits` - the flag for the visual property
    `_accumSize` - the flag for the visual property
    `_sharedGLContext` - the shared GLContext

### GLContext

    public GLContext(java.awt.Component comp,
                     GLFunc glf,
                     GLUFunc gluf,
                     boolean _createOwnWindow,
                     boolean _doubleBuffer,
                     boolean _stereoView,
                     boolean _rgba,
                     int _stencilBits,
                     int _accumSize)

  Constructor First the GLContext is fetched from the Component itself ! To do so, the Component is set visible if it is not ! If a GLContext is fetched, it is current !
  Parameters:
    `comp` - the users component for the gl-context
    `glf` - the users selected GLFunc implementation
    `glf` - the users selected GLUFunc implementation
    `_createOwnWindow` - the flag for the visual property
    `_doubleBuffer` - the flag for the visual property
    `_stereoView` - the flag for the visual property
    `_rgba` - the flag for the visual property
    `_stencilBits` - the flag for the visual property
    `_accumSize` - the flag for the visual property

### GLContext

    public GLContext(java.awt.Component comp,
                     GLFunc glf,
                     GLUFunc gluf,
                     boolean _createOwnWindow,
                     boolean _doubleBuffer,
                     boolean _stereoView,
                     boolean _rgba,
                     int _stencilBits)

  Constructor First the GLContext is fetched from the Component itself ! To do so, the Component is set visible if it is not ! If a GLContext is fetched, it is current !
  Parameters:
    `comp` - the users component for the gl-context
    `glf` - the users selected GLFunc implementation
    `glf` - the users selected GLUFunc implementation
    `_createOwnWindow` - the flag for the visual property
    `_doubleBuffer` - the flag for the visual property
    `_stereoView` - the flag for the visual property
    `_rgba` - the flag for the visual property
    `_stencilBits` - the flag for the visual property

### GLContext

    public GLContext(java.awt.Component comp,
                     GLFunc glf,
                     GLUFunc gluf,
                     boolean _doubleBuffer,
                     boolean _stereoView,
                     boolean _rgba,
                     int _stencilBits,
                     int _accumSize)

  Constructor First the GLContext is fetched from the Component itself ! To do so, the Component is set visible if it is not ! If a GLContext is fetched, it is current !
  Parameters:
    `comp` - the users component for the gl-context
    `glf` - the users selected GLFunc implementation
    `glf` - the users selected GLUFunc implementation
    `_doubleBuffer` - the flag for the visual property
    `_stereoView` - the flag for the visual property
    `_rgba` - the flag for the visual property
    `_stencilBits` - the flag for the visual property

### GLContext

    public GLContext(java.awt.Component comp,
                     GLFunc glf,
                     GLUFunc gluf,
                     boolean _doubleBuffer,
                     boolean _stereoView,
                     boolean _rgba,
                     int _stencilBits)

  Constructor First the GLContext is fetched from the Component itself ! To do so, the Component is set visible if it is not ! If a GLContext is fetched, it is current !
  Parameters:
    `comp` - the users component for the gl-context
    `glf` - the users selected GLFunc implementation
    `glf` - the users selected GLUFunc implementation
    `_doubleBuffer` - the flag for the visual property
    `_stereoView` - the flag for the visual property
    `_rgba` - the flag for the visual property
    `_stencilBits` - the flag for the visual property

### GLContext

    public GLContext(java.awt.Component comp,
                     GLFunc glf,
                     GLUFunc gluf,
                     boolean _doubleBuffer,
                     boolean _stereoView,
                     boolean _rgba)

  Constructor First the GLContext is fetched from the Component itself ! To do so, the Component is set visible if it is not ! If a GLContext is fetched, it is current !
  Parameters:
    `comp` - the users component for the gl-context
    `glf` - the users selected GLFunc implementation
    `glf` - the users selected GLUFunc implementation
    `_doubleBuffer` - the flag for the visual property
    `_stereoView` - the flag for the visual property
    `_rgba` - the flag for the visual property
    `_stencilBits` - the flag for the visual property

### GLContext

    public GLContext(java.awt.Component comp,
                     GLFunc glf,
                     GLUFunc gluf,
                     boolean _doubleBuffer,
                     boolean _stereoView)

  Constructor First the GLContext is fetched from the Component itself ! To do so, the Component is set visible if it is not ! If a GLContext is fetched, it is current ! ! WARNING ! This flag is just for testing purpose !!!
  Parameters:
    `comp` - the users component for the gl-context
    `glf` - the users selected GLFunc implementation
    `glf` - the users selected GLUFunc implementation
    `_doubleBuffer` - the flag for the visual property
    `_stereoView` - the flag for the visual property

### GLContext

    public GLContext(java.awt.Component comp,
                     GLFunc glf,
                     GLUFunc gluf)

  Constructor First the GLContext is fetched from the Component itself ! To do so, the Component is set visible if it is not ! We use a visual with doubleBuffer and NO stereoView ! Do not force a new native window ! If a GLContext is fetched, it is current !
  Parameters:
    `comp` - the users component for the gl-context
    `glf` - the users selected GLFunc implementation
    `glf` - the users selected GLUFunc implementation

Method Detail

### getNativeGLContext

    public final long getNativeGLContext()

  Get the native GL Context !
  See Also:
    `glContext`

### getNativeGLContextNumber

    public static final int getNativeGLContextNumber()

### getNativeWindoHandle

    public final long getNativeWindoHandle()

  Deprecated. The native window handle is no more accessible through this method since JDK >= 1.3 !

  Get the native Window Handle !
  See Also:
    `windowHandle`

### getSharedGLContext

    public final GLContext getSharedGLContext()

  Get the optional shared GL Context !
  See Also:
    `sharedGLContext`

### getNativeOSType

    public static int getNativeOSType()

  Get the native OS-Type !
  See Also:
    `OsWindoof`, `OsUnknown`, `OsX11`, `OsMac9`, `OsMacX`

### getNativeOSName

    public static java.lang.String getNativeOSName()

### getGLCapabilities

    public final GLCapabilities getGLCapabilities()

  Query the visual property ... ! After a GLContext is created, this property can be queried !
  See Also:
    `glCaps`, `GLContext(java.awt.Component, gl4java.GLFunc, gl4java.GLUFunc, boolean, boolean, java.awt.Dimension, gl4java.GLCapabilities, gl4java.GLContext)`

### isDoubleBuffer

    public final boolean isDoubleBuffer()

  Query the visual property ... ! After a GLContext is created, this property can be queried !
  See Also:
    `glCaps`, `GLContext(java.awt.Component, gl4java.GLFunc, gl4java.GLUFunc, boolean, boolean, java.awt.Dimension, gl4java.GLCapabilities, gl4java.GLContext)`

### getStencilBitNumber

    public final int getStencilBitNumber()

  Query the visual property ... ! After a GLContext is created, this property can be queried !
  See Also:
    `glCaps`, `GLContext(java.awt.Component, gl4java.GLFunc, gl4java.GLUFunc, boolean, boolean, java.awt.Dimension, gl4java.GLCapabilities, gl4java.GLContext)`

### getAccumSize

    public final int getAccumSize()

  Query the visual property ... ! After a GLContext is created, this property can be queried !
  See Also:
    `glCaps`, `GLContext(java.awt.Component, gl4java.GLFunc, gl4java.GLUFunc, boolean, boolean, java.awt.Dimension, gl4java.GLCapabilities, gl4java.GLContext)`

### isStereoView

    public final boolean isStereoView()

  Query the visual property ... ! After a GLContext is created, this property can be queried !
  See Also:
    `glCaps`, `GLContext(java.awt.Component, gl4java.GLFunc, gl4java.GLUFunc, boolean, boolean, java.awt.Dimension, gl4java.GLCapabilities, gl4java.GLContext)`

### isRGBA

    public final boolean isRGBA()

  Query the visual property ... ! After a GLContext is created, this property can be queried !
  See Also:
    `glCaps`, `GLContext(java.awt.Component, gl4java.GLFunc, gl4java.GLUFunc, boolean, boolean, java.awt.Dimension, gl4java.GLCapabilities, gl4java.GLContext)`

### isOwnWindowCreated

    public final boolean isOwnWindowCreated()

  Query the visual property ... ! After a GLContext is created, this property can be queried !
  See Also:
    `createOwnWindow`, `GLContext(java.awt.Component, gl4java.GLFunc, gl4java.GLUFunc, boolean, boolean, java.awt.Dimension, gl4java.GLCapabilities, gl4java.GLContext)`

### loadNativeLibraries

    public static final boolean loadNativeLibraries(java.lang.String gljLibName,
                                                    java.lang.String glLibName,
                                                    java.lang.String gluLibName)

  Deprecated. The arguments glLibName and gluLibName are obsolete, because all glj/gl/glu stuff resides within the gljLib ! Now you can use doLoadNativeLibraries !

  Support of loading the native library seperatly. Link with the default native OpenGL library. If we cannot link, an exception is thrown. The name of the library is named e.g.: "GL4JavaJauGljJNI" at the Java level, or "libGL4JavaJauGljJNI.so" at the solaris level, or "GL4JavaJauGljJNI.dll" at the win32 level :-).

  The user must call loadNativeLibrary ! E.g. he can add the default loader like this:

      static {
      if(GLContext.loadNativeLibraries(null, null, null)==false)
      System.out.println("could not load def. native libs.");
      }

  Parameters:
    `gljLibName` - The name of the GLContex/GLFunc/GLUFunc native library. If gljLibName==null, the default library will be used !
    `glLibName` - deprecated
    `gluLibName` - deprecated
  Returns:
    boolean, true if succesfull !
  See Also:
    `defGljLib`

### doLoadNativeLibraries

    public static final boolean doLoadNativeLibraries(java.lang.String gljLibName,
                                                      java.lang.String nativeGLLibName,
                                                      java.lang.String nativeGLULibName)

  Support of loading the native library seperatly. Link with the given OpenGL library. If we cannot link, an exception is thrown. You can also specify the OpenGL and GLU library by the environment variables:

      GLTOOL_USE_GLLIB	- OpenGL library name
      GLTOOL_USE_GLULIB	- GLU    library name

  these environment variables does _always_ overrides any given ones at this point !! The name of the library is named e.g.: "GL4JavaJauGljJNI" at the Java level, or "libGL4JavaJauGljJNI.so" at the solaris level, or "GL4JavaJauGljJNI.dll" at the win32 level :-).

  The user must call doLoadNativeLibrary ! E.g. he can add the default loader like this:

      static {
      if(GLContext.doLoadNativeLibraries(null, null, null)==false)
      System.out.println("could not load def. native libs.");
      }

  Parameters:
    `gljLibName` - The name of the GLContex/GLFunc/GLUFunc native library. If gljLibName==null, the default library will be used !
    `nativeGLLibName` - The name of the native GL library. If nativeGLLibName==null, the default library will be used !
    `nativeGLULibName` - The name of the native GLU library. If nativeGLULibName==null, the default library will be used !
  Returns:
    boolean, true if succesfull !
  See Also:
    `defGljLib`, `defNativeGLLibX11`, `defNativeGLLibMacOS9`, `defNativeGLLibMacOSX`, `defNativeGLLibWin32`, `defNativeGLULibX11`, `defNativeGLULibMacOS9`, `defNativeGLULibMacOSX`, `defNativeGLULibWin32`

### main

    public static void main(java.lang.String[] args)

  Test to load the native library, GLFunc and GLUFunc implementation ! If succesfull, a Frame will created and the GL-Infos (vendor, ...) are shown in it !
  Parameters:
    `args,` - a list of args, -GLLib -GLULib -gljlib gl4java-glj-lib native library -glclass gl4java-gl-class java GLFunc implementation -gluclass gl4java-glu-class java GLUFunc implementation -info creates a GLContext and prints all avaiable information of GL/GLU and GL4Java -infotxt like -info, but exits straight after -info ! without any arguments, a help screen is shown

### getJVMVersion

    public static java.lang.String getJVMVersion()

### getJVMVersionMajor

    public static int getJVMVersionMajor()

### getJVMVersionMinor

    public static int getJVMVersionMinor()

### getJVMVendor

    public static java.lang.String getJVMVendor()

### isNetscapeJVM

    public static boolean isNetscapeJVM()

### isMicrosoftJVM

    public static boolean isMicrosoftJVM()

### createOffScreenCtx

    public static final GLContext createOffScreenCtx(GLFunc glf,
                                                     GLUFunc gluf,
                                                     boolean _stereoView,
                                                     boolean _rgba,
                                                     int _stencilBits,
                                                     int _accumSize,
                                                     GLContext _sharedGLContext)

  Constructor Function for offscreen rendering ! First the GLContext is fetched from the Component itself ! To do so, the Component is set visible if it is not ! If a GLContext is fetched, it is current !
  Parameters:
    `glf` - the users selected GLFunc implementation
    `glf` - the users selected GLUFunc implementation
    `_stereoView` - the flag for the visual property
    `_rgba` - the flag for the visual property
    `_stencilBits` - the flag for the visual property
    `_sharedGLContext` - the shared GLContext
  Returns:
    the created offscreen context

### createOffScreenCtx

    public static final GLContext createOffScreenCtx(GLFunc glf,
                                                     GLUFunc gluf,
                                                     boolean _stereoView,
                                                     boolean _rgba,
                                                     int _stencilBits,
                                                     int _accumSize,
                                                     GLContext _sharedGLContext,
                                                     java.awt.Dimension _offScrnSize)

  Constructor Function for offscreen rendering ! First the GLContext is fetched from the Component itself ! To do so, the Component is set visible if it is not ! If a GLContext is fetched, it is current !
  Parameters:
    `glf` - the users selected GLFunc implementation
    `glf` - the users selected GLUFunc implementation
    `_stereoView` - the flag for the visual property
    `_rgba` - the flag for the visual property
    `_stencilBits` - the flag for the visual property
    `_sharedGLContext` - the shared GLContext
    `_offScrnSize` - the fixed offscreen pixmap size
  Returns:
    the created offscreen context

### finalize

    protected void finalize()
                     throws java.lang.Throwable

  Overrides:
    `finalize` in class `java.lang.Object`
  See Also:
    `gljDestroy()`

### setGLFunc

    public final void setGLFunc(GLFunc _gl)

  Used to set the user given GLFunc implementation

### setGLUFunc

    public final void setGLUFunc(GLUFunc _glu)

  Used to set the user given GLUFunc implementation

### getGLFunc

    public final GLFunc getGLFunc()

  Used to return the user given GLFunc implementation

### getGLUFunc

    public final GLUFunc getGLUFunc()

  Used to return the user given GLUFunc implementation

### createGLFunc

    public static final GLFunc createGLFunc(java.lang.String vendorClass)

  Support of loading a vendors GLFunc implementation Try to load the Class, if succesfull we do return the instance of it. Else null is returned ! The Class-Name is: "GL4Java." + vendorClass + ".class" !
  Parameters:
    `vendorClass` - The name of the GLFunc implementation. If vendorSuffix==null, the default implementation "GLFuncJauJNI" (-> GL4Java.GLFuncJauJNI.class ) will be used !
  Returns:
    GLFunc, the implementation's instance if exists and valid, or null
  See Also:
    `defGLFuncClass`

### createGLUFunc

    public static final GLUFunc createGLUFunc(java.lang.String vendorClass)

  Support of loading a vendors GLUFunc implementation Try to load the Class, if succesfull we do return the instance of it. Else null is returned ! The Class-Name is: "GL4Java." + vendorClass + ".class" !
  Parameters:
    `vendorClass` - The name of the GLUFunc implementation. If vendorSuffix==null, the default implementation "GLUFuncJauJNI" (-> GL4Java.GLUFuncJauJNI.class ) will be used !
  Returns:
    GLUFunc, the implementation's instance if exists and valid, or null
  See Also:
    `defGLUFuncClass`

### setVisible

    public void setVisible(boolean visible)

  Own setVisible This one set's us visible - and wait's for that result !
  Parameters:
    `visible` - boolean: visible==true, hide==false
  Returns:
    void

### createGLContext

    public final void createGLContext(java.awt.Graphics g)

  createGLContext gets the window handle and calls gljInit, so the gl-context will be initialised here. this method will be invoked by the constructor this method is left public - this time, to allow the user to to it again later - if it was not succesfull !
  Parameters:
    `g` - the graphics reference, where we will get the native window handle from.
  Returns:
    void
  See Also:
    `GLContext(java.awt.Component, gl4java.GLFunc, gl4java.GLUFunc, boolean, boolean, java.awt.Dimension, gl4java.GLCapabilities, gl4java.GLContext)`

### gljInit

    protected final void gljInit()
                          throws GL4JavaInitException

  Initializes the gl-context. gljInit is called by createGLContext (which is calles by the first paint)! Also gljInit will call the init method after GL initialisation, so the user can override ´init´ to initialize his own stuff !
  Returns:
    void
  Throws:
    `GL4Java.GL4JavaInitException` - this class throws an exception if the native call to create a OpenGL context failed.
  See Also:
    `createGLContext(java.awt.Graphics)`, `GLCanvas.paint(java.awt.Graphics)`, `GLCanvas.init()`

### run

    public void run()

  For MSJVM Only ! This functions fetches the window-handle within a special thread !
  Specified by:
    `run` in interface `java.lang.Runnable`

### gljIsInit

    public final boolean gljIsInit()

  Checks if the gl-context is Initializes If returns true, gljInit is allready called and a valid gl-context is achieved. No glMakeCurrent is done - like gljMakeCurrent (important for more gl-context) !

  The user can use this method to check if he can start rendering and to be sure his initialisation (init) is done !

  If you use gl4java.awt.GLCanvas, you should use the cvsIsInit method !

  Returns:
    boolean
  See Also:
    `gljInit()`, `GLCanvas.cvsIsInit()`

### gljResize

    public final void gljResize(int width,
                                int height)

  Resizes the gl-viewport Should be called, if the component is resized. The user should take advantage of this functionality. Be sure to resize not within the event-method of the ComponentHandler, you better resize while normal painting. This can be done while using a boolean flag ;-) Look at GLComponent !

### useJAWT

    protected static final boolean useJAWT()

  native C function of GLJ Library, which query if it uses the JDK 1.3 JAWT interface to fetch the native window handle

### loadJAWT

    protected static final boolean loadJAWT()

  Routine which causes jawt.dll/libjawt.so to be loaded if that is how the window handles are being obtained.

### hasJAWTSurfaceChanged

    protected final boolean hasJAWTSurfaceChanged(long thisWin)

  native C function of GLJ Library, which query if the JAWT Surface has changed ! Use this after gljMakeCurrent -> jawt_lock ! If true, we need a new GLContext !

### openOpenGLNative

    protected final boolean openOpenGLNative(java.awt.Component canvas)

  native C function to open the OpenGLwidget

### gljCheckGLTypes

    public static final boolean gljCheckGLTypes()

  native C function to check the gl types. At this time, all GL* types will be checked if they fit's in the used java JNI types. this checks is allready performed, while the GL context is fetched with gljInit ! BUT we used this function, to perform a check without an X11-connection to our AIX host ;-)) So a call to this function is not needed !

### gljCheckGL

    public final boolean gljCheckGL()

### gljIsCurrent

    public final boolean gljIsCurrent()

  gljIsCurrent checks if the current Thread holds the GL context of this GLContext instance !
  Returns:
    boolean
  See Also:
    `gljIsRequested()`, `gljMakeCurrent()`, `getNativeGLContext()`, `gljGetCurrentContext()`

### gljIsRequested

    public final boolean gljIsRequested()

  gljIsRequested checks if the this GLContext instance's native context is requested by another thread !
  Returns:
    boolean
  See Also:
    `gljIsCurrent()`, `gljMakeCurrent()`, `getNativeGLContext()`, `gljGetCurrentContext()`

### gljMakeCurrent

    public final boolean gljMakeCurrent()

  gljMakeCurrent checks whether GL4Java is initializes AND makes the GL-Context current for this thread.

  This functions now optimizes the context-switch ! The context is changed, only if :

      - another thread has requested this context -> release it
      this gives the other thread a chance to get it ..

      - this thread does not own the current context

  You MUST encapsulate your OpenGL call's within:

      - gljMakeCurrent()
      YOUR OpenGL commands here !
      - gljFree()

  Returns:
    boolean
  See Also:
    `gljSwap()`, `GLCanvas.display()`, `GLCanvas.sDisplay()`

### gljMakeCurrent

    public final boolean gljMakeCurrent(boolean freeContextFirst)

  Deprecated. The argument freeContextFirst is obsolete !

  gljMakeCurrent checks whether GL4Java is initializes AND makes the GL-Context current for this thread. It's more save to use ´gljMakeCurrent´, instead of ´gljMakeCurrentNative´, because we do check if GL is initalised !
  Parameters:
    `freeContextFirst` - is obsolete !
  Returns:
    boolean

### gljGetCurrentContext

    public static final long gljGetCurrentContext()

  gljGetCurrentContext fetches the current native GL-Context, which is attached to this _native_ thread !
  Returns:
    int

### gljDestroy

    public final boolean gljDestroy()

  gljDestroy destroy´s the GL Context This function should be called when removing a GLContext !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Call gljFree befor this method, to be sure ..
  Returns:
    void
  See Also:
    `gljMakeCurrent()`, `gljFree()`, `gljSwap()`

### gljFree

    public final boolean gljFree()

  gljFree free´s the GL Context This MUST be called at last in your display function !

  This functions now optimizes the context-switch ! The context is changed, only if :

      - another thread has requested this context -> release it

  Returns:
    boolean
  See Also:
    `gljFree()`, `gljIsCurrent()`, `gljIsRequested()`, `gljMakeCurrent()`, `gljSwap()`, `GLCanvas.display()`, `GLCanvas.sDisplay()`

### gljFree

    public final boolean gljFree(boolean force)

  gljFree free´s the GL Context This MUST be called at last in your display function !

  This functions now optimizes the context-switch ! The context is changed, only if one of the following is true:

      - another thread has requested this context
      - the force flag is true
      - this thread is the AWT thread
      - the component of this context does _not_ implement GLRunnable
      - the calling thread is not the thread, this GLRunnable component holds !

  Returns:
    boolean
  See Also:
    `gljIsCurrent()`, `gljIsRequested()`, `gljMakeCurrent()`, `gljSwap()`, `GLRunnable.run()`

### gljSwap

    public final boolean gljSwap()

  swap method are for double buffering

### setEnabled

    public void setEnabled(boolean b)

  This function enables, disables the GL-Context ! If false is given, the openGL renderer/context is disabled and disconected (gljFree is called, if initialized) ! If disabled, all GL Functions are disabled but the Destroy & Free are not !
  Returns:
    boolean
  See Also:
    `gljMakeCurrent()`, `gljDestroy()`, `gljFree()`

### isEnabled

    public boolean isEnabled()

  This function queries, if the GL-Context is enabled !
  Returns:
    boolean
  See Also:
    `setEnabled(boolean)`, `gljMakeCurrent()`

### gljFetchGLFunctions

    public static final boolean gljFetchGLFunctions(java.lang.String gllibname,
                                                    java.lang.String glulibname,
                                                    boolean force)

  This functions fetches/dispatches the GL/GLU functions, which must be allready loaded via the doLoadNativeLibraries function !
  See Also:
    `doLoadNativeLibraries(java.lang.String, java.lang.String, java.lang.String)`

### gljTestGLProc

    public static final boolean gljTestGLProc(java.lang.String name,
                                              boolean verbose)

  This functions checks the existence of the GL functions !

### gljReadPixelGL2AWT

    public static final void gljReadPixelGL2AWT(int pack_rowlen,
                                                int pack_x,
                                                int pack_y,
                                                int x,
                                                int y,
                                                int width,
                                                int height,
                                                int format,
                                                int type,
                                                int bufferName,
                                                int[] pixelDest)

  This functions reads the pixel from the GL frame and puts it into the pixelDest array, while converting them correctly to the AWT pixel format, using GL_BGRA and BufferedImage.TYPE_INT_ARGB !

### gljReadPixelGL2AWT

    public static final void gljReadPixelGL2AWT(int pack_rowlen,
                                                int pack_x,
                                                int pack_y,
                                                int x,
                                                int y,
                                                int width,
                                                int height,
                                                int format,
                                                int type,
                                                int bufferName,
                                                short[] pixelDest)

  This functions reads the pixel from the GL frame and puts it into the pixelDest array, while converting them correctly to the AWT pixel format, using GL_RGB and BufferedImage.TYPE_USHORT_565_RGB !

### gljReadPixelGL2AWT

    public static final void gljReadPixelGL2AWT(int pack_rowlen,
                                                int pack_x,
                                                int pack_y,
                                                int x,
                                                int y,
                                                int width,
                                                int height,
                                                int format,
                                                int type,
                                                int bufferName,
                                                byte[] pixelGLDest)

  This functions reads the pixel from the GL frame and puts it into the pixelDest array, while using hardware correct AWT and GL pixel format, using GL_BGR and BufferedImage.TYPE_3BYTE_BGR !

### gljGetNativeLibVendor

    public static final java.lang.String gljGetNativeLibVendor()

  native C function to achieve the native lib vendor ! now it is possible to check the native-lib at runtime !

### gljGetNativeLibVersion

    public static final java.lang.String gljGetNativeLibVersion()

  native C function to achieve the native lib version ! now it is possible to check the native-lib at runtime !

### gljGetClassVersion

    public static final java.lang.String gljGetClassVersion()

  function to achieve the java-class version ! now it is possible to check the java-class at runtime !

### gljGetClassVendor

    public static final java.lang.String gljGetClassVendor()

  function to achieve the java-class vendor ! now it is possible to check the java-class at runtime !

### gljGetVersions

    public final java.lang.String gljGetVersions()

  function to achieve complete version info Be sure that the native library must be loaded !

### gljGetVersions

    public final java.lang.String gljGetVersions(boolean verbose)

### gljShowVersions

    public final java.awt.Frame gljShowVersions()

  function to show complete version info into an extra Frame Be sure that the native library must be loaded !

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD