|
|||||||||
| Home >> All >> [ gl4java overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
gl4java
Class GLContext

java.lang.Objectgl4java.GLContext
- All Implemented Interfaces:
- java.lang.Runnable
- public class GLContext
- extends java.lang.Object
- implements java.lang.Runnable
- extends java.lang.Object
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 :
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
| 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 ... |
private int |
createwinh
|
private int |
createwinw
|
private int |
createwinx
MS-JDirect-Window data for the MS-JVM interface |
private int |
createwiny
|
private java.lang.Thread |
ctxThread
|
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 ... |
private boolean |
destroyWindow
|
protected long |
displayHandle
|
private GLFunc |
gl
Used to hold the user given GLFunc implementation |
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
|
private GLUFunc |
glu
Used to hold the user given GLUFunc implementation |
private static boolean |
isIBMJvm
|
protected boolean |
isInitialized
|
private static boolean |
isMicrosoftJvm
|
private static boolean |
isNetscapeJvm
|
private static java.lang.String |
jniEXTsuff
|
private static java.lang.String |
jvmVendor
|
private static java.lang.String |
jvmVersion
|
private static int |
jvmVersionMajor
|
private static int |
jvmVersionMinor
|
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 !! |
private java.lang.Thread |
nextThread
|
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 :-) |
private static java.lang.String |
osName
|
private static int |
osType
|
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 :-) |
(package private) long |
pData
Windows data AND flag is Window-Handel is read (for X11 also) ! |
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
|
private boolean |
threadRunning
|
private static boolean |
useMSJDirect
|
static java.lang.String |
version
the version of this java-class |
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(java.awt.Component comp,
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(java.awt.Component comp,
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()
Called on an object by the Virtual Machine at most once, at some point after the Object is determined unreachable but before it is destroyed. |
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. |
private static boolean |
gljCheckGLTypesNative()
|
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 .. |
private boolean |
gljDestroyNative(java.awt.Component canvas)
|
static boolean |
gljFetchGLFunctions(java.lang.String gllibname,
java.lang.String glulibname,
boolean force)
|
static boolean |
gljFetchOSGLFunctions(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 ! |
private static boolean |
gljFreeNative(java.awt.Component canvas,
long disp,
long thisWin,
long glContext)
if using JAWT, this function handles the JAWT unlock also |
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 ! |
private static java.lang.String |
gljGetNativeLibVendorNative()
|
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 ! |
private static java.lang.String |
gljGetNativeLibVersionNative()
|
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 ! |
private static boolean |
gljMakeCurrentNative(java.awt.Component canvas,
long disp,
long thisWin,
long glContext)
if using JAWT, this function handles the JAWT lock also |
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. |
private void |
gljResizeNative(boolean isOwnWindow,
long disp,
long thisWin,
int width,
int height)
|
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 |
private static boolean |
gljSwapNative(long disp,
long thisWin,
long glContext,
boolean doubleBuffer)
|
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 ... |
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 ! |
private static boolean |
lockJAWT(java.awt.Component canvas,
long thisWin,
boolean verbose)
|
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 ! |
private static boolean |
unlockJAWT(long thisWin,
boolean verbose)
|
protected 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()55
defGljMSWinLib
public static final java.lang.String defGljMSWinLib
- The default extra native library for Windows 95/NT && MS-JVM
- See Also:
- Constant Field Values
defGljLib
public static final java.lang.String defGljLib
- The default GLContext/GLFunc/GLUFunc native library for all
- See Also:
- Constant Field Values
defGLFuncClass
public static final java.lang.String defGLFuncClass
- The default GLFunc implementation
- See Also:
- Constant Field Values
defGLFunc14Class
public static final java.lang.String defGLFunc14Class
- See Also:
- Constant Field Values
defGLUFuncClass
public static final java.lang.String defGLUFuncClass
- The default GLUFunc implementation
- See Also:
- Constant Field Values
defGLUFunc14Class
public static final java.lang.String defGLUFunc14Class
- See Also:
- Constant Field Values
defNativeGLLibX11
public static final java.lang.String defNativeGLLibX11
- The default native GL library ... for X11
- See Also:
- Constant Field Values
defNativeGLLibMacOS9
public static final java.lang.String defNativeGLLibMacOS9
- The default native GL library ... for MacOS9
- See Also:
- Constant Field Values
defNativeGLLibMacOSX
public static final java.lang.String defNativeGLLibMacOSX
- The default native GL library ... for MacOSX
- See Also:
- Constant Field Values
defNativeGLLibWin32
public static final java.lang.String defNativeGLLibWin32
- The default native GL library ... for Win32
- See Also:
- Constant Field Values
defNativeGLULibX11
public static final java.lang.String defNativeGLULibX11
- The default native GLU library ... for X11
- See Also:
- Constant Field Values
defNativeGLULibMacOS9
public static final java.lang.String defNativeGLULibMacOS9
- The default native GLU library ... for MacOS9
- See Also:
- Constant Field Values
defNativeGLULibMacOSX
public static final java.lang.String defNativeGLULibMacOSX
- The default native GLU library ... for MacOSX
- See Also:
- Constant Field Values
defNativeGLULibWin32
public static final java.lang.String defNativeGLULibWin32
- The default native GLU library ... for Win32
- See Also:
- Constant Field Values
version
public static final java.lang.String version
- the version of this java-class
. . . Each is dezimal ! - See Also:
- Constant Field Values
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)55 ,gljInit()55
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)55 ,gljInit()55
sharedGLContextNative
protected long sharedGLContextNative
pixmapHandle
protected long pixmapHandle
- Xwindow data AND Windows data for the widget
- See Also:
createGLContext(java.awt.Graphics)55 ,gljInit()55
windowHandle
protected long windowHandle
displayHandle
protected long displayHandle
createwinw
private int createwinw
createwinh
private int createwinh
createwinx
private int createwinx
- MS-JDirect-Window data for the MS-JVM interface
- See Also:
createGLContext(java.awt.Graphics)55 ,gljInit()55
createwiny
private int createwiny
threadRunning
private boolean threadRunning
destroyWindow
private boolean destroyWindow
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:
gl4java.swing.GLJPanel#paint,createOffScreenCtx(java.awt.Component, gl4java.GLFunc, gl4java.GLUFunc, boolean, boolean, int, int, gl4java.GLContext)55
pData
long pData
- Windows data AND flag is Window-Handel is read (for X11 also) !
- See Also:
createGLContext(java.awt.Graphics)55 ,gljInit()55
glEnabled
protected boolean glEnabled
- Flag to check, if the OpenGL-Context is active !
- See Also:
isEnabled()55 ,setEnabled(boolean)55
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 !
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 !
glCaps
protected GLCapabilities glCaps
- The GLCapabilities ..
This is set via the constructor !
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:
gl4java.awt.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 :-)
- See Also:
- Constant Field Values
OsUnknown
public static final int OsUnknown
- Variable to tell is where windows or not (X11)
Usally X11 ;-))
Ok - lets give one to the Max :-)
- See Also:
- Constant Field Values
OsX11
public static final int OsX11
- Variable to tell is where windows or not (X11)
Usally X11 ;-))
Ok - lets give one to the Max :-)
- See Also:
- Constant Field Values
OsMac9
public static final int OsMac9
- Variable to tell is where windows or not (X11)
Usally X11 ;-))
Ok - lets give one to the Max :-)
- See Also:
- Constant Field Values
OsMacX
public static final int OsMacX
- Variable to tell is where windows or not (X11)
Usally X11 ;-))
Ok - lets give one to the Max :-)
- See Also:
- Constant Field Values
osType
private static int osType
isNetscapeJvm
private static boolean isNetscapeJvm
isMicrosoftJvm
private static boolean isMicrosoftJvm
isIBMJvm
private static boolean isIBMJvm
useMSJDirect
private static boolean useMSJDirect
jvmVendor
private static java.lang.String jvmVendor
jvmVersion
private static java.lang.String jvmVersion
jvmVersionMajor
private static int jvmVersionMajor
jvmVersionMinor
private static int jvmVersionMinor
osName
private static java.lang.String osName
jniEXTsuff
private static java.lang.String jniEXTsuff
gl
private GLFunc gl
- Used to hold the user given GLFunc implementation
glu
private GLUFunc glu
- Used to hold the user given GLUFunc implementation
ctxThread
private java.lang.Thread ctxThread
nextThread
private java.lang.Thread nextThread
| 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 !
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 !
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 !
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 !
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 !
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 !
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 !
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 !
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 !
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 !!!
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 !
| Method Detail |
getNativeGLContext
public final long getNativeGLContext()
- Get the native GL Context !
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 !
- Get the native Window Handle !
getSharedGLContext
public final GLContext getSharedGLContext()
- Get the optional shared GL Context !
getNativeOSType
public static int getNativeOSType()
- Get the native OS-Type !
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 !
isDoubleBuffer
public final boolean isDoubleBuffer()
- Query the visual property ... !
After a GLContext is created, this property can be queried !
getStencilBitNumber
public final int getStencilBitNumber()
- Query the visual property ... !
After a GLContext is created, this property can be queried !
getAccumSize
public final int getAccumSize()
- Query the visual property ... !
After a GLContext is created, this property can be queried !
isStereoView
public final boolean isStereoView()
- Query the visual property ... !
After a GLContext is created, this property can be queried !
isRGBA
public final boolean isRGBA()
- Query the visual property ... !
After a GLContext is created, this property can be queried !
isOwnWindowCreated
public final boolean isOwnWindowCreated()
- Query the visual property ... !
After a GLContext is created, this property can be queried !
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."); } - 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 :-).
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 namethese 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."); }
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 !
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(java.awt.Component comp, 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 !
createOffScreenCtx
public static final GLContext createOffScreenCtx(java.awt.Component comp, 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 !
finalize
protected void finalize()
throws java.lang.Throwable
- Description copied from class:
java.lang.Object - Called on an object by the Virtual Machine at most once,
at some point after the Object is determined unreachable
but before it is destroyed. You would think that this
means it eventually is called on every Object, but this is
not necessarily the case. If execution terminates
abnormally, garbage collection does not always happen.
Thus you cannot rely on this method to always work.
For finer control over garbage collection, use references
from the
java.lang.refpackage.Virtual Machines are free to not call this method if they can determine that it does nothing important; for example, if your class extends Object and overrides finalize to do simply
super.finalize().finalize() will be called by a java.lang.Thread that has no locks on any Objects, and may be called concurrently. There are no guarantees on the order in which multiple objects are finalized. This means that finalize() is usually unsuited for performing actions that must be thread-safe, and that your implementation must be use defensive programming if it is to always work.
If an Exception is thrown from finalize() during garbage collection, it will be patently ignored and the Object will still be destroyed.
It is allowed, although not typical, for user code to call finalize() directly. User invocation does not affect whether automatic invocation will occur. It is also permitted, although not recommended, for a finalize() method to "revive" an object by making it reachable from normal code again.
Unlike constructors, finalize() does not get called for an object's superclass unless the implementation specifically calls
super.finalize().The default implementation does nothing.
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
JAVADOC
gl4java.GLContext