diff options
author | Sven Gothel <[email protected]> | 2001-02-23 05:14:46 +0000 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2001-02-23 05:14:46 +0000 |
commit | 991622dd909d94b6ed83b84b744f0839b9ab6807 (patch) | |
tree | 3bcf3c79e8ea11358966710d0884a4416a74f8e6 | |
parent | 82cd20ed209f12e22e2f5a92719b3be2bb92d8ed (diff) |
Version 2.6.0.0
-rwxr-xr-x | CNativeCode/GLDrawableFactory_Win32_SunJDK13.c | 174 | ||||
-rw-r--r-- | CNativeCode/GLDrawableFactory_X11_SunJDK13.c | 106 | ||||
-rwxr-xr-x | Win32VC6/GL4JavaJauGljJNI13/GL4JavaJauGljJNI13.plg | 39 | ||||
-rw-r--r-- | demos/HodglimsNeHe/data/star.png | bin | 0 -> 7183 bytes | |||
-rw-r--r-- | demos/new-style.txt | 21 | ||||
-rw-r--r-- | docs/images/gl4javaLogo.png | bin | 0 -> 37707 bytes |
6 files changed, 340 insertions, 0 deletions
diff --git a/CNativeCode/GLDrawableFactory_Win32_SunJDK13.c b/CNativeCode/GLDrawableFactory_Win32_SunJDK13.c new file mode 100755 index 0000000..7a085d5 --- /dev/null +++ b/CNativeCode/GLDrawableFactory_Win32_SunJDK13.c @@ -0,0 +1,174 @@ +#include "gl4java_drawable_Win32SunJDK13GLDrawableFactory.h"
+#include <windows.h>
+
+/* FIXME: extend to support multiple monitors on Win2K/98 */
+static HDC getScreenDC(int screen)
+{
+ return CreateDC("DISPLAY", NULL, NULL, NULL);
+}
+
+static void freeScreenDC(HDC dc)
+{
+ DeleteDC(dc);
+}
+
+
+JNIEXPORT jboolean JNICALL
+Java_gl4java_drawable_Win32SunJDK13GLDrawableFactory_getVisualSupportsOpenGL(JNIEnv *env,
+ jclass unused,
+ jint screen,
+ jint pixId)
+{
+ HDC dc;
+ PIXELFORMATDESCRIPTOR pfd;
+ jboolean res;
+ dc = getScreenDC(screen);
+ DescribePixelFormat(dc, pixId, sizeof(PIXELFORMATDESCRIPTOR), &pfd);
+ res = (jboolean) (pfd.dwFlags & PFD_SUPPORT_OPENGL != 0);
+ freeScreenDC(dc);
+ return res;
+}
+
+JNIEXPORT jboolean JNICALL
+Java_gl4java_drawable_Win32SunJDK13GLDrawableFactory_getVisualDoubleBuffered(JNIEnv *env,
+ jclass unused,
+ jint screen,
+ jint pixId)
+{
+ HDC dc;
+ PIXELFORMATDESCRIPTOR pfd;
+ jboolean res;
+ dc = getScreenDC(screen);
+ DescribePixelFormat(dc, pixId, sizeof(PIXELFORMATDESCRIPTOR), &pfd);
+ res = (jboolean) (pfd.dwFlags & PFD_DOUBLEBUFFER != 0);
+ freeScreenDC(dc);
+ return res;
+}
+
+JNIEXPORT jboolean JNICALL
+Java_gl4java_drawable_Win32SunJDK13GLDrawableFactory_getVisualTrueColor(JNIEnv *env,
+ jclass unused,
+ jint screen,
+ jint pixId)
+{
+ HDC dc;
+ PIXELFORMATDESCRIPTOR pfd;
+ jboolean res;
+ dc = getScreenDC(screen);
+ DescribePixelFormat(dc, pixId, sizeof(PIXELFORMATDESCRIPTOR), &pfd);
+ res = (jboolean) (pfd.iPixelType == PFD_TYPE_RGBA);
+ freeScreenDC(dc);
+ return res;
+}
+
+JNIEXPORT jboolean JNICALL
+Java_gl4java_drawable_Win32SunJDK13GLDrawableFactory_getVisualStereo(JNIEnv *env,
+ jclass unused,
+ jint screen,
+ jint pixId)
+{
+ HDC dc;
+ PIXELFORMATDESCRIPTOR pfd;
+ jboolean res;
+ dc = getScreenDC(screen);
+ DescribePixelFormat(dc, pixId, sizeof(PIXELFORMATDESCRIPTOR), &pfd);
+ res = (jboolean) (pfd.dwFlags & PFD_STEREO != 0);
+ freeScreenDC(dc);
+ return res;
+}
+
+JNIEXPORT jint JNICALL
+Java_gl4java_drawable_Win32SunJDK13GLDrawableFactory_getVisualDepthBits(JNIEnv *env,
+ jclass unused,
+ jint screen,
+ jint pixId)
+{
+ HDC dc;
+ PIXELFORMATDESCRIPTOR pfd;
+ jint res;
+ dc = getScreenDC(screen);
+ DescribePixelFormat(dc, pixId, sizeof(PIXELFORMATDESCRIPTOR), &pfd);
+ res = pfd.cDepthBits;
+ freeScreenDC(dc);
+ return res;
+}
+
+JNIEXPORT jint JNICALL
+Java_gl4java_drawable_Win32SunJDK13GLDrawableFactory_getVisualStencilBits(JNIEnv *env,
+ jclass unused,
+ jint screen,
+ jint pixId)
+{
+ HDC dc;
+ PIXELFORMATDESCRIPTOR pfd;
+ jint res;
+ dc = getScreenDC(screen);
+ DescribePixelFormat(dc, pixId, sizeof(PIXELFORMATDESCRIPTOR), &pfd);
+ res = pfd.cStencilBits;
+ freeScreenDC(dc);
+ return res;
+}
+
+JNIEXPORT jint JNICALL
+Java_gl4java_drawable_Win32SunJDK13GLDrawableFactory_getVisualColorBits(JNIEnv *env,
+ jclass unused,
+ jint screen,
+ jint pixId)
+{
+ HDC dc;
+ PIXELFORMATDESCRIPTOR pfd;
+ jint res;
+ dc = getScreenDC(screen);
+ DescribePixelFormat(dc, pixId, sizeof(PIXELFORMATDESCRIPTOR), &pfd);
+ res = pfd.cColorBits;
+ freeScreenDC(dc);
+ return res;
+}
+
+JNIEXPORT jint JNICALL
+Java_gl4java_drawable_Win32SunJDK13GLDrawableFactory_getVisualColorShiftBits(JNIEnv *env,
+ jclass unused,
+ jint screen,
+ jint pixId)
+{
+ HDC dc;
+ PIXELFORMATDESCRIPTOR pfd;
+ jint res;
+ dc = getScreenDC(screen);
+ DescribePixelFormat(dc, pixId, sizeof(PIXELFORMATDESCRIPTOR), &pfd);
+ res = pfd.cRedShift+pfd.cGreenShift+pfd.cBlueShift+pfd.cAlphaShift;
+ freeScreenDC(dc);
+ return res;
+}
+
+JNIEXPORT jint JNICALL
+Java_gl4java_drawable_Win32SunJDK13GLDrawableFactory_getVisualAlphaBits(JNIEnv *env,
+ jclass unused,
+ jint screen,
+ jint pixId)
+{
+ HDC dc;
+ PIXELFORMATDESCRIPTOR pfd;
+ jint res;
+ dc = getScreenDC(screen);
+ DescribePixelFormat(dc, pixId, sizeof(PIXELFORMATDESCRIPTOR), &pfd);
+ res = pfd.cAlphaBits;
+ freeScreenDC(dc);
+ return res;
+}
+
+JNIEXPORT jint JNICALL
+Java_gl4java_drawable_Win32SunJDK13GLDrawableFactory_getVisualAccumBits(JNIEnv *env,
+ jclass unused,
+ jint screen,
+ jint pixId)
+{
+ HDC dc;
+ PIXELFORMATDESCRIPTOR pfd;
+ jint res;
+ dc = getScreenDC(screen);
+ DescribePixelFormat(dc, pixId, sizeof(PIXELFORMATDESCRIPTOR), &pfd);
+ res = pfd.cAccumBits;
+ freeScreenDC(dc);
+ return res;
+}
diff --git a/CNativeCode/GLDrawableFactory_X11_SunJDK13.c b/CNativeCode/GLDrawableFactory_X11_SunJDK13.c new file mode 100644 index 0000000..51e204c --- /dev/null +++ b/CNativeCode/GLDrawableFactory_X11_SunJDK13.c @@ -0,0 +1,106 @@ +#include "gl4java_drawable_X11SunJDK13GLDrawableFactory.h"
+#include "OpenGL_X11_common.h"
+
+JNIEXPORT jlong JNICALL
+Java_gl4java_drawable_X11SunJDK13GLDrawableFactory_glXChooseVisualID
+ (JNIEnv *env,
+ jclass unused,
+ jint screen,
+ jlong display,
+ jobject capsObj, jboolean verbose)
+{
+ Display *disp = (Display *) ( (PointerHolder)display );
+
+ XVisualInfo * visual=NULL;
+ int visualAttribList[32];
+ int done=0;
+
+ GLCapabilities glCaps;
+
+ jboolean ok = javaGLCapabilities2NativeGLCapabilities ( env,
+ capsObj, &glCaps );
+
+ if(JNI_TRUE!=ok)
+ {
+ fprintf(stderr,"GL4Java X11SunJDK13GLDrawableFactory ERROR: gl4java/GLCapabilities fields not accessible\n");
+ fflush(stderr);
+ return JNI_FALSE;
+ }
+
+ /* JAU: What the hell ..
+ The java given display is not alway functional .. ?
+
+ If running without this ugly thing,
+ the derived SimpleGLAnimApplet1 get's an X11 async reply
+ if the thing is initialized by the applet's init method !
+ */
+ disp = XOpenDisplay( NULL );
+ screen = DefaultScreen( disp );
+
+ if(JNI_TRUE==verbose)
+ fprintf(stdout," display=%p, screen=%d\n", disp, (int)screen);
+
+ while(!done && visual==NULL)
+ {
+ (void) setVisualAttribListByGLCapabilities( visualAttribList, &glCaps);
+
+ if(JNI_TRUE==verbose)
+ {
+ fprintf(stdout, "X11DrawableFactory.glXChooseVisual: try capabilities:\n");
+ printGLCapabilities ( &glCaps );
+ }
+
+ visual = glXChooseVisual( disp, screen, visualAttribList );
+
+ if(JNI_TRUE==verbose)
+ {
+ if(visual!=NULL)
+ {
+ fprintf(stdout, "X11DrawableFactory.glXChooseVisual: found visual(ID:%d(0x%X)):\n",
+ (int) visual->visualid,
+ (int) visual->visualid);
+ printVisualInfo ( disp, visual);
+ }
+ fflush(stdout);
+ }
+ /**
+ * Falling-Back the exact (min. requirement) parameters ..
+ */
+ if(visual==NULL && glCaps.stereo==STEREO_ON) {
+ glCaps.stereo=STEREO_OFF;
+ } else if(visual==NULL && glCaps.stencilBits>32) {
+ glCaps.stencilBits=32;
+ } else if(visual==NULL && glCaps.stencilBits>16) {
+ glCaps.stencilBits=16;
+ } else if(visual==NULL && glCaps.stencilBits>8) {
+ glCaps.stencilBits=8;
+ } else if(visual==NULL && glCaps.stencilBits>0) {
+ glCaps.stencilBits=0;
+ } else if(visual==NULL && glCaps.buffer==BUFFER_DOUBLE) {
+ glCaps.buffer=BUFFER_SINGLE;
+ } else done=1; /* forget it .. */
+ }
+
+ if(visual==NULL)
+ {
+ fprintf(stdout, "X11DrawableFactory.glXChooseVisual: no visual\n");
+ return 0;
+ }
+
+ (void ) setGLCapabilities ( disp, visual, &glCaps );
+
+ if(JNI_TRUE==verbose)
+ {
+ fprintf(stdout,"X11DrawableFactory.glXChooseVisual: writing capabilities to GLContext's java object\n");
+ fflush(stdout);
+ }
+
+ (void) nativeGLCapabilities2JavaGLCapabilities
+ (env, capsObj, &glCaps);
+
+ /* JAU: see above .. */
+ XCloseDisplay( disp );
+
+ return (jlong) (visual->visualid);
+}
+
diff --git a/Win32VC6/GL4JavaJauGljJNI13/GL4JavaJauGljJNI13.plg b/Win32VC6/GL4JavaJauGljJNI13/GL4JavaJauGljJNI13.plg new file mode 100755 index 0000000..be75c2a --- /dev/null +++ b/Win32VC6/GL4JavaJauGljJNI13/GL4JavaJauGljJNI13.plg @@ -0,0 +1,39 @@ +<html>
+<body>
+<pre>
+<h1>Erstellungsprotokoll</h1>
+<h3>
+--------------------Konfiguration: GL4JavaJauGljJNI13 - Win32 Release--------------------
+</h3>
+<h3>Befehlszeilen</h3>
+Erstellen der tempor�ren Datei "D:\TEMP\RSP1CC.tmp" mit Inhalten
+[
+/nologo /MT /W3 /GX /O2 /I "d:\java2\include" /I "d:\java2\include\win32" /I "..\..\CCLassHeaders" /I "..\..\CNativeCode" /D "NO_VSNPRINTF" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WIN32_" /D "_MSVC_" /D "_MT" /D "_GL_DYNAMIC_BINDING_" /Fo"../temp/" /Fd"../temp/" /FD /c
+"P:\java\GL4Java\GL4Java\CNativeCode\GLDrawableFactory_Win32_SunJDK13.c"
+]
+Creating command line "cl.exe @D:\TEMP\RSP1CC.tmp"
+Erstellen der tempor�ren Datei "D:\TEMP\RSP1CD.tmp" mit Inhalten
+[
+kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib opengl32.lib jawt.lib /nologo /subsystem:windows /dll /incremental:no /pdb:"../libs/GL4JavaJauGljJNI13.pdb" /machine:I386 /out:"../libs/GL4JavaJauGljJNI13.dll" /implib:"../libs/GL4JavaJauGljJNI13.lib" /libpath:"d:\java2\lib"
+\java\GL4Java\GL4Java\Win32VC6\temp\GLCallbackHelperJNI.obj
+\java\GL4Java\GL4Java\Win32VC6\temp\GLDrawableFactory_Win32_SunJDK13.obj
+\java\GL4Java\GL4Java\Win32VC6\temp\jawt_misc.obj
+\java\GL4Java\GL4Java\Win32VC6\temp\jni12tools.obj
+\java\GL4Java\GL4Java\Win32VC6\temp\OpenGL_misc.obj
+\java\GL4Java\GL4Java\Win32VC6\temp\OpenGL_Win32_common.obj
+\java\GL4Java\GL4Java\Win32VC6\temp\OpenGL_Win32_jawt.obj
+]
+Erstellen der Befehlzeile "link.exe @D:\TEMP\RSP1CD.tmp"
+<h3>Ausgabefenster</h3>
+Kompilierung l�uft...
+GLDrawableFactory_Win32_SunJDK13.c
+Linker-Vorgang l�uft...
+ Bibliothek ../libs/GL4JavaJauGljJNI13.lib und Objekt ../libs/GL4JavaJauGljJNI13.exp wird erstellt
+
+
+
+<h3>Ergebnisse</h3>
+GL4JavaJauGljJNI13.dll - 0 Fehler, 0 Warnung(en)
+</pre>
+</body>
+</html>
diff --git a/demos/HodglimsNeHe/data/star.png b/demos/HodglimsNeHe/data/star.png Binary files differnew file mode 100644 index 0000000..e933c74 --- /dev/null +++ b/demos/HodglimsNeHe/data/star.png diff --git a/demos/new-style.txt b/demos/new-style.txt new file mode 100644 index 0000000..6b8a0a8 --- /dev/null +++ b/demos/new-style.txt @@ -0,0 +1,21 @@ +# +# Using just gl4java.drawable.SunJDK13GLDrawableFactory's +# getGraphicsConfiguration method, if avaiable ! +# If avaiable, the fetched GraphicsConfiguration is used +# for the GL*Canvas creation .. +# +demos/gltestperf.java /* the gl performance test, + try argument --help */ +demos/MiscDemos/alpha3D.java /* the alpha value is set here .. */ +demos/HodglimsNeHe/Lesson8.java +demos/RonsDemos/dinoshade.java +demos/RonsDemos/shadowvol.java + +# +# Implementing the new GLEventListener +# The above feature is done automatically .. +# +demos/MiscDemos/gears.java +demos/MiscDemos/stencil.java /* the stencil value is set here .. */ +demos/MiscDemos/TestListener.java +demos/MiscDemos/TriangleRotate.java diff --git a/docs/images/gl4javaLogo.png b/docs/images/gl4javaLogo.png Binary files differnew file mode 100644 index 0000000..b07e212 --- /dev/null +++ b/docs/images/gl4javaLogo.png |