aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--C2J/manual/glf-enum-manualCoded.java17
-rwxr-xr-xC2J/manual/glf-manualCodedImplJNI.c30
-rwxr-xr-xC2J/manual/glf-manualCodedImplJNI.java46
-rwxr-xr-xCNativeCode/GLF_JNI12_funcs.c1319
-rwxr-xr-xCNativeCode/GLF_JNI_funcs.c1319
-rw-r--r--CNativeCode/GLF_funcs.c.skel11
-rw-r--r--CNativeCode/Tool_JNI12_funcs.c70
-rw-r--r--CNativeCode/Tool_JNI_funcs.c70
-rwxr-xr-xCNativeCode/glf.c1741
-rwxr-xr-xCNativeCode/glf.h160
-rw-r--r--Doxyfile813
-rw-r--r--demos/GLFDemos/glf3dtext.html16
-rwxr-xr-xdemos/GLFDemos/glf3dtext.java366
-rw-r--r--demos/GLFDemos/glf3dtext2.html16
-rw-r--r--demos/GLFDemos/glf3dtext2.java378
-rw-r--r--demos/GLFDemos/glf3dtext2_plugin13.html48
-rw-r--r--demos/GLFDemos/glf3dtext_plugin13.html48
-rw-r--r--demos/GLFDemos/index.html24
-rw-r--r--demos/GLFDemos/index_plugin13.html26
-rw-r--r--demos/MiscDemos/GearsVS.html13
-rw-r--r--demos/MiscDemos/GearsVS.java501
-rw-r--r--demos/MiscDemos/GearsVS_plugin13.html45
-rw-r--r--demos/MiscDemos/jahuwaldt/gl/GLTools.java494
-rw-r--r--demos/MiscDemos/jahuwaldt/gl/Matrix.java499
-rw-r--r--demos/MiscDemos/jahuwaldt/gl/VirtualSphere.java255
-rwxr-xr-xgl4java/utils/glf/GLF.java102
-rwxr-xr-xgl4java/utils/glf/GLFEnum.java57
-rwxr-xr-xgl4java/utils/glf/GLFFuncJNI.java671
28 files changed, 9155 insertions, 0 deletions
diff --git a/C2J/manual/glf-enum-manualCoded.java b/C2J/manual/glf-enum-manualCoded.java
new file mode 100644
index 0000000..b09d115
--- /dev/null
+++ b/C2J/manual/glf-enum-manualCoded.java
@@ -0,0 +1,17 @@
+/**
+ * @(#) GLFEnum.java
+ */
+
+
+package gl4java.utils.glf;
+
+/**
+ * The base interface for GLF enumerates,
+ * which provides you all the C-API style enumerates
+ *
+ * @version 1.00, 23. Mai 2001
+ * @author Sven Goethel
+ */
+public interface GLFEnum
+{
+
diff --git a/C2J/manual/glf-manualCodedImplJNI.c b/C2J/manual/glf-manualCodedImplJNI.c
new file mode 100755
index 0000000..c16703b
--- /dev/null
+++ b/C2J/manual/glf-manualCodedImplJNI.c
@@ -0,0 +1,30 @@
+
+static const char * _glf_lib_vendor_="Roman Podobedov, Sven Goethel";
+static const char * _glf_lib_version_="1.4.0.0";
+
+JNIEXPORT jstring JNICALL
+Java_gl4java_utils_glf_GLFFuncJNI_getNativeVendor ( JNIEnv *env, jobject obj )
+{
+ return (*env)->NewStringUTF(env, _glf_lib_vendor_);
+}
+
+JNIEXPORT jstring JNICALL
+Java_gl4java_utils_glf_GLFFuncJNI_getNativeVersion ( JNIEnv *env, jobject obj )
+{
+ return (*env)->NewStringUTF(env, _glf_lib_version_);
+}
+
+JNIEXPORT jint JNICALL
+Java_gl4java_utils_glf_GLFFuncJNI_glfLoadFontNative (
+ JNIEnv *env, jobject obj, jlong filed)
+{
+ return (jint) glfLoadFont ( (FILE *) ((PointerHolder)filed) );
+}
+
+JNIEXPORT jint JNICALL
+Java_gl4java_utils_glf_GLFFuncJNI_glfLoadBFontNative (
+ JNIEnv *env, jobject obj, jlong filed)
+{
+ return (jint) glfLoadBFont ( (FILE *) ((PointerHolder)filed) );
+}
+
diff --git a/C2J/manual/glf-manualCodedImplJNI.java b/C2J/manual/glf-manualCodedImplJNI.java
new file mode 100755
index 0000000..d18db08
--- /dev/null
+++ b/C2J/manual/glf-manualCodedImplJNI.java
@@ -0,0 +1,46 @@
+/**
+ * @(#) GLFFuncJNI.java
+ */
+
+
+package gl4java.utils.glf;
+
+import java.net.*;
+
+/**
+ * The default implementation class for GLF native function mapping
+ *
+ * @version 2.00, 21. April 1999
+ * @author Sven Goethel
+ */
+public abstract class GLFFuncJNI
+ implements GLFEnum
+{
+
+public abstract int glfLoadFont ( String fontname );
+
+public abstract int glfLoadFont ( URL baseURL, String fontURI );
+
+public abstract int glfLoadBFont ( String fontname );
+
+public abstract int glfLoadBFont ( URL baseURL, String fontURI );
+
+public final native String getNativeVendor ( ) ;
+public final native String getNativeVersion ( ) ;
+
+public final String getClassVendor ( )
+{ return "Jausoft - Sven Goethel Software Development"; }
+
+public final String getClassVersion ( )
+{ return "1.4.0.0"; }
+
+/**
+ * Load Vector font to memory, by (FILE *) fontf
+ */
+protected final native int glfLoadFontNative (long fontf);
+
+/**
+ * Load Bitmap font to memory, by (FILE *) fontf
+ */
+protected final native int glfLoadBFontNative (long fontf);
+
diff --git a/CNativeCode/GLF_JNI12_funcs.c b/CNativeCode/GLF_JNI12_funcs.c
new file mode 100755
index 0000000..4b672b5
--- /dev/null
+++ b/CNativeCode/GLF_JNI12_funcs.c
@@ -0,0 +1,1319 @@
+/* WARNING ! WARNING *** THIS FILE IS GENERATED BY C2J !!!
+
+ DO NOT MAKE ANY CHANGES *** MAKE CHANGES IN THE SKELETON FILES !!!
+*/
+
+
+#include "OpenGL_misc.h"
+
+#include "gl4java_utils_glf_GLFFuncJNI.h"
+
+#include "jnitools.h"
+#include "glf.h"
+
+/**
+ * herein lies the native JAVA methods for the GLF functions.
+ */
+
+
+static const char * _glf_lib_vendor_="Roman Podobedov, Sven Goethel";
+static const char * _glf_lib_version_="1.4.0.0";
+
+JNIEXPORT jstring JNICALL
+Java_gl4java_utils_glf_GLFFuncJNI_getNativeVendor ( JNIEnv *env, jobject obj )
+{
+ return (*env)->NewStringUTF(env, _glf_lib_vendor_);
+}
+
+JNIEXPORT jstring JNICALL
+Java_gl4java_utils_glf_GLFFuncJNI_getNativeVersion ( JNIEnv *env, jobject obj )
+{
+ return (*env)->NewStringUTF(env, _glf_lib_version_);
+}
+
+JNIEXPORT jint JNICALL
+Java_gl4java_utils_glf_GLFFuncJNI_glfLoadFontNative (
+ JNIEnv *env, jobject obj, jlong filed)
+{
+ return (jint) glfLoadFont ( (FILE *) ((PointerHolder)filed) );
+}
+
+JNIEXPORT jint JNICALL
+Java_gl4java_utils_glf_GLFFuncJNI_glfLoadBFontNative (
+ JNIEnv *env, jobject obj, jlong filed)
+{
+ return (jint) glfLoadBFont ( (FILE *) ((PointerHolder)filed) );
+}
+
+/**
+ * C2J Parser Version 2.2
+ * Jausoft - Sven Goethel Software Development
+ * Reading from file: glf-proto-auto.orig.h . . .
+ * Destination-Class: gl4java_utils_glf_GLFFuncJNI !
+ */
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfInit ( ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfInit (
+ JNIEnv *env, jobject obj)
+ {
+
+ glfInit (
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfClose ( ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfClose (
+ JNIEnv *env, jobject obj)
+ {
+
+ glfClose (
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ int glfUnloadFont ( ) ;
+ * </pre>
+ */
+ JNIEXPORT jint JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfUnloadFont (
+ JNIEnv *env, jobject obj)
+ {
+ jint ret;
+
+
+ ret = (jint) glfUnloadFont (
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ int glfUnloadBFont ( ) ;
+ * </pre>
+ */
+ JNIEXPORT jint JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfUnloadBFont (
+ JNIEnv *env, jobject obj)
+ {
+ jint ret;
+
+
+ ret = (jint) glfUnloadBFont (
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ int glfUnloadFontD ( int font_descriptor ) ;
+ * </pre>
+ */
+ JNIEXPORT jint JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfUnloadFontD (
+ JNIEnv *env, jobject obj,
+ jint font_descriptor)
+ {
+ jint ret;
+
+
+ ret = (jint) glfUnloadFontD (
+ (int) font_descriptor
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ int glfUnloadBFontD ( int bmf_descriptor ) ;
+ * </pre>
+ */
+ JNIEXPORT jint JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfUnloadBFontD (
+ JNIEnv *env, jobject obj,
+ jint bmf_descriptor)
+ {
+ jint ret;
+
+
+ ret = (jint) glfUnloadBFontD (
+ (int) bmf_descriptor
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawWiredSymbol ( char s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDrawWiredSymbol (
+ JNIEnv *env, jobject obj,
+ jbyte s)
+ {
+
+ glfDrawWiredSymbol (
+ (char) s
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawWiredString ( const char * s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDrawWiredString (
+ JNIEnv *env, jobject obj,
+ jstring s)
+ {
+ char *ptr0 = NULL;
+
+ ptr0 = jnitoolsGetJavaString(env, s);
+ glfDrawWiredString (
+ (const char *) ptr0
+ );
+
+ free(ptr0);
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawSolidSymbol ( char s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDrawSolidSymbol (
+ JNIEnv *env, jobject obj,
+ jbyte s)
+ {
+
+ glfDrawSolidSymbol (
+ (char) s
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawSolidString ( const char * s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDrawSolidString (
+ JNIEnv *env, jobject obj,
+ jstring s)
+ {
+ char *ptr0 = NULL;
+
+ ptr0 = jnitoolsGetJavaString(env, s);
+ glfDrawSolidString (
+ (const char *) ptr0
+ );
+
+ free(ptr0);
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDraw3DWiredSymbol ( char s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDraw3DWiredSymbol (
+ JNIEnv *env, jobject obj,
+ jbyte s)
+ {
+
+ glfDraw3DWiredSymbol (
+ (char) s
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDraw3DWiredString ( const char * s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDraw3DWiredString (
+ JNIEnv *env, jobject obj,
+ jstring s)
+ {
+ char *ptr0 = NULL;
+
+ ptr0 = jnitoolsGetJavaString(env, s);
+ glfDraw3DWiredString (
+ (const char *) ptr0
+ );
+
+ free(ptr0);
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDraw3DSolidSymbol ( char s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDraw3DSolidSymbol (
+ JNIEnv *env, jobject obj,
+ jbyte s)
+ {
+
+ glfDraw3DSolidSymbol (
+ (char) s
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDraw3DSolidString ( const char * s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDraw3DSolidString (
+ JNIEnv *env, jobject obj,
+ jstring s)
+ {
+ char *ptr0 = NULL;
+
+ ptr0 = jnitoolsGetJavaString(env, s);
+ glfDraw3DSolidString (
+ (const char *) ptr0
+ );
+
+ free(ptr0);
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ int glfBeginBFont ( int Font_Descriptor ) ;
+ * </pre>
+ */
+ JNIEXPORT jint JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfBeginBFont (
+ JNIEnv *env, jobject obj,
+ jint Font_Descriptor)
+ {
+ jint ret;
+
+
+ ret = (jint) glfBeginBFont (
+ (int) Font_Descriptor
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfEndBFont ( ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfEndBFont (
+ JNIEnv *env, jobject obj)
+ {
+
+ glfEndBFont (
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawBSymbol ( char s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDrawBSymbol (
+ JNIEnv *env, jobject obj,
+ jbyte s)
+ {
+
+ glfDrawBSymbol (
+ (char) s
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawBString ( const char * s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDrawBString (
+ JNIEnv *env, jobject obj,
+ jstring s)
+ {
+ char *ptr0 = NULL;
+
+ ptr0 = jnitoolsGetJavaString(env, s);
+ glfDrawBString (
+ (const char *) ptr0
+ );
+
+ free(ptr0);
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawBMaskSymbol ( char s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDrawBMaskSymbol (
+ JNIEnv *env, jobject obj,
+ jbyte s)
+ {
+
+ glfDrawBMaskSymbol (
+ (char) s
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawBMaskString ( const char * s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDrawBMaskString (
+ JNIEnv *env, jobject obj,
+ jstring s)
+ {
+ char *ptr0 = NULL;
+
+ ptr0 = jnitoolsGetJavaString(env, s);
+ glfDrawBMaskString (
+ (const char *) ptr0
+ );
+
+ free(ptr0);
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawWiredSymbolF ( int font_descriptor , char s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDrawWiredSymbolF (
+ JNIEnv *env, jobject obj,
+ jint font_descriptor,
+ jbyte s)
+ {
+
+ glfDrawWiredSymbolF (
+ (int) font_descriptor,
+ (char) s
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawWiredStringF ( int font_descriptor , const char * s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDrawWiredStringF (
+ JNIEnv *env, jobject obj,
+ jint font_descriptor,
+ jstring s)
+ {
+ char *ptr1 = NULL;
+
+ ptr1 = jnitoolsGetJavaString(env, s);
+ glfDrawWiredStringF (
+ (int) font_descriptor,
+ (const char *) ptr1
+ );
+
+ free(ptr1);
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawSolidSymbolF ( int font_descriptor , char s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDrawSolidSymbolF (
+ JNIEnv *env, jobject obj,
+ jint font_descriptor,
+ jbyte s)
+ {
+
+ glfDrawSolidSymbolF (
+ (int) font_descriptor,
+ (char) s
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawSolidStringF ( int font_descriptor , const char * s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDrawSolidStringF (
+ JNIEnv *env, jobject obj,
+ jint font_descriptor,
+ jstring s)
+ {
+ char *ptr1 = NULL;
+
+ ptr1 = jnitoolsGetJavaString(env, s);
+ glfDrawSolidStringF (
+ (int) font_descriptor,
+ (const char *) ptr1
+ );
+
+ free(ptr1);
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDraw3DWiredSymbolF ( int font_descriptor , char s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDraw3DWiredSymbolF (
+ JNIEnv *env, jobject obj,
+ jint font_descriptor,
+ jbyte s)
+ {
+
+ glfDraw3DWiredSymbolF (
+ (int) font_descriptor,
+ (char) s
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDraw3DWiredStringF ( int font_descriptor , const char * s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDraw3DWiredStringF (
+ JNIEnv *env, jobject obj,
+ jint font_descriptor,
+ jstring s)
+ {
+ char *ptr1 = NULL;
+
+ ptr1 = jnitoolsGetJavaString(env, s);
+ glfDraw3DWiredStringF (
+ (int) font_descriptor,
+ (const char *) ptr1
+ );
+
+ free(ptr1);
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDraw3DSolidSymbolF ( int font_descriptor , char s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDraw3DSolidSymbolF (
+ JNIEnv *env, jobject obj,
+ jint font_descriptor,
+ jbyte s)
+ {
+
+ glfDraw3DSolidSymbolF (
+ (int) font_descriptor,
+ (char) s
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDraw3DSolidStringF ( int font_descriptor , const char * s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDraw3DSolidStringF (
+ JNIEnv *env, jobject obj,
+ jint font_descriptor,
+ jstring s)
+ {
+ char *ptr1 = NULL;
+
+ ptr1 = jnitoolsGetJavaString(env, s);
+ glfDraw3DSolidStringF (
+ (int) font_descriptor,
+ (const char *) ptr1
+ );
+
+ free(ptr1);
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfGetStringBoundsF ( int fd , const char * s , float * minx , float * miny , float * maxx , float * maxy ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfGetStringBoundsF (
+ JNIEnv *env, jobject obj,
+ jint fd,
+ jstring s,
+ jfloatArray minx,
+ jfloatArray miny,
+ jfloatArray maxx,
+ jfloatArray maxy)
+ {
+ char *ptr1 = NULL;
+ jboolean isCopiedArray2 = JNI_FALSE;
+ jfloat *ptr2 = NULL;
+ jboolean isCopiedArray3 = JNI_FALSE;
+ jfloat *ptr3 = NULL;
+ jboolean isCopiedArray4 = JNI_FALSE;
+ jfloat *ptr4 = NULL;
+ jboolean isCopiedArray5 = JNI_FALSE;
+ jfloat *ptr5 = NULL;
+
+ ptr1 = jnitoolsGetJavaString(env, s);
+ if(minx!=NULL)
+ {
+ ptr2 = (jfloat *) (*env)->GetPrimitiveArrayCritical(env, minx, &isCopiedArray2);
+ }
+ if(miny!=NULL)
+ {
+ ptr3 = (jfloat *) (*env)->GetPrimitiveArrayCritical(env, miny, &isCopiedArray3);
+ }
+ if(maxx!=NULL)
+ {
+ ptr4 = (jfloat *) (*env)->GetPrimitiveArrayCritical(env, maxx, &isCopiedArray4);
+ }
+ if(maxy!=NULL)
+ {
+ ptr5 = (jfloat *) (*env)->GetPrimitiveArrayCritical(env, maxy, &isCopiedArray5);
+ }
+ glfGetStringBoundsF (
+ (int) fd,
+ (const char *) ptr1,
+ (float *) ptr2,
+ (float *) ptr3,
+ (float *) ptr4,
+ (float *) ptr5
+ );
+
+ free(ptr1);
+ if(minx!=NULL)
+ {
+ (*env)->ReleasePrimitiveArrayCritical(env, minx, ptr2, (isCopiedArray2 == JNI_TRUE)?0:JNI_ABORT);
+ }
+ if(miny!=NULL)
+ {
+ (*env)->ReleasePrimitiveArrayCritical(env, miny, ptr3, (isCopiedArray3 == JNI_TRUE)?0:JNI_ABORT);
+ }
+ if(maxx!=NULL)
+ {
+ (*env)->ReleasePrimitiveArrayCritical(env, maxx, ptr4, (isCopiedArray4 == JNI_TRUE)?0:JNI_ABORT);
+ }
+ if(maxy!=NULL)
+ {
+ (*env)->ReleasePrimitiveArrayCritical(env, maxy, ptr5, (isCopiedArray5 == JNI_TRUE)?0:JNI_ABORT);
+ }
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfGetStringBounds ( const char * s , float * minx , float * miny , float * maxx , float * maxy ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfGetStringBounds (
+ JNIEnv *env, jobject obj,
+ jstring s,
+ jfloatArray minx,
+ jfloatArray miny,
+ jfloatArray maxx,
+ jfloatArray maxy)
+ {
+ char *ptr0 = NULL;
+ jboolean isCopiedArray1 = JNI_FALSE;
+ jfloat *ptr1 = NULL;
+ jboolean isCopiedArray2 = JNI_FALSE;
+ jfloat *ptr2 = NULL;
+ jboolean isCopiedArray3 = JNI_FALSE;
+ jfloat *ptr3 = NULL;
+ jboolean isCopiedArray4 = JNI_FALSE;
+ jfloat *ptr4 = NULL;
+
+ ptr0 = jnitoolsGetJavaString(env, s);
+ if(minx!=NULL)
+ {
+ ptr1 = (jfloat *) (*env)->GetPrimitiveArrayCritical(env, minx, &isCopiedArray1);
+ }
+ if(miny!=NULL)
+ {
+ ptr2 = (jfloat *) (*env)->GetPrimitiveArrayCritical(env, miny, &isCopiedArray2);
+ }
+ if(maxx!=NULL)
+ {
+ ptr3 = (jfloat *) (*env)->GetPrimitiveArrayCritical(env, maxx, &isCopiedArray3);
+ }
+ if(maxy!=NULL)
+ {
+ ptr4 = (jfloat *) (*env)->GetPrimitiveArrayCritical(env, maxy, &isCopiedArray4);
+ }
+ glfGetStringBounds (
+ (const char *) ptr0,
+ (float *) ptr1,
+ (float *) ptr2,
+ (float *) ptr3,
+ (float *) ptr4
+ );
+
+ free(ptr0);
+ if(minx!=NULL)
+ {
+ (*env)->ReleasePrimitiveArrayCritical(env, minx, ptr1, (isCopiedArray1 == JNI_TRUE)?0:JNI_ABORT);
+ }
+ if(miny!=NULL)
+ {
+ (*env)->ReleasePrimitiveArrayCritical(env, miny, ptr2, (isCopiedArray2 == JNI_TRUE)?0:JNI_ABORT);
+ }
+ if(maxx!=NULL)
+ {
+ (*env)->ReleasePrimitiveArrayCritical(env, maxx, ptr3, (isCopiedArray3 == JNI_TRUE)?0:JNI_ABORT);
+ }
+ if(maxy!=NULL)
+ {
+ (*env)->ReleasePrimitiveArrayCritical(env, maxy, ptr4, (isCopiedArray4 == JNI_TRUE)?0:JNI_ABORT);
+ }
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfSetSymbolSpace ( float sp ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfSetSymbolSpace (
+ JNIEnv *env, jobject obj,
+ jfloat sp)
+ {
+
+ glfSetSymbolSpace (
+ (float) sp
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ float glfGetSymbolSpace ( ) ;
+ * </pre>
+ */
+ JNIEXPORT jfloat JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfGetSymbolSpace (
+ JNIEnv *env, jobject obj)
+ {
+ jfloat ret;
+
+
+ ret = (jfloat) glfGetSymbolSpace (
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfSetSpaceSize ( float sp ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfSetSpaceSize (
+ JNIEnv *env, jobject obj,
+ jfloat sp)
+ {
+
+ glfSetSpaceSize (
+ (float) sp
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ float glfGetSpaceSize ( ) ;
+ * </pre>
+ */
+ JNIEXPORT jfloat JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfGetSpaceSize (
+ JNIEnv *env, jobject obj)
+ {
+ jfloat ret;
+
+
+ ret = (jfloat) glfGetSpaceSize (
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfSetSymbolDepth ( float dpth ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfSetSymbolDepth (
+ JNIEnv *env, jobject obj,
+ jfloat dpth)
+ {
+
+ glfSetSymbolDepth (
+ (float) dpth
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ float glfGetSymbolDepth ( ) ;
+ * </pre>
+ */
+ JNIEXPORT jfloat JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfGetSymbolDepth (
+ JNIEnv *env, jobject obj)
+ {
+ jfloat ret;
+
+
+ ret = (jfloat) glfGetSymbolDepth (
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ int glfSetCurrentFont ( int Font_Descriptor ) ;
+ * </pre>
+ */
+ JNIEXPORT jint JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfSetCurrentFont (
+ JNIEnv *env, jobject obj,
+ jint Font_Descriptor)
+ {
+ jint ret;
+
+
+ ret = (jint) glfSetCurrentFont (
+ (int) Font_Descriptor
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ int glfSetCurrentBFont ( int Font_Descriptor ) ;
+ * </pre>
+ */
+ JNIEXPORT jint JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfSetCurrentBFont (
+ JNIEnv *env, jobject obj,
+ jint Font_Descriptor)
+ {
+ jint ret;
+
+
+ ret = (jint) glfSetCurrentBFont (
+ (int) Font_Descriptor
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ int glfGetCurrentFont ( ) ;
+ * </pre>
+ */
+ JNIEXPORT jint JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfGetCurrentFont (
+ JNIEnv *env, jobject obj)
+ {
+ jint ret;
+
+
+ ret = (jint) glfGetCurrentFont (
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ int glfGetCurrentBFont ( ) ;
+ * </pre>
+ */
+ JNIEXPORT jint JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfGetCurrentBFont (
+ JNIEnv *env, jobject obj)
+ {
+ jint ret;
+
+
+ ret = (jint) glfGetCurrentBFont (
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfSetAnchorPoint ( int anchp ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfSetAnchorPoint (
+ JNIEnv *env, jobject obj,
+ jint anchp)
+ {
+
+ glfSetAnchorPoint (
+ (int) anchp
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfSetContourColor ( float r , float g , float b , float a ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfSetContourColor (
+ JNIEnv *env, jobject obj,
+ jfloat r,
+ jfloat g,
+ jfloat b,
+ jfloat a)
+ {
+
+ glfSetContourColor (
+ (float) r,
+ (float) g,
+ (float) b,
+ (float) a
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfEnable ( int what ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfEnable (
+ JNIEnv *env, jobject obj,
+ jint what)
+ {
+
+ glfEnable (
+ (int) what
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDisable ( int what ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDisable (
+ JNIEnv *env, jobject obj,
+ jint what)
+ {
+
+ glfDisable (
+ (int) what
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfSetConsoleParam ( int width , int height ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfSetConsoleParam (
+ JNIEnv *env, jobject obj,
+ jint width,
+ jint height)
+ {
+
+ glfSetConsoleParam (
+ (int) width,
+ (int) height
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ int glfSetConsoleFont ( int Font_Descriptor ) ;
+ * </pre>
+ */
+ JNIEXPORT jint JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfSetConsoleFont (
+ JNIEnv *env, jobject obj,
+ jint Font_Descriptor)
+ {
+ jint ret;
+
+
+ ret = (jint) glfSetConsoleFont (
+ (int) Font_Descriptor
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfConsoleClear ( ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfConsoleClear (
+ JNIEnv *env, jobject obj)
+ {
+
+ glfConsoleClear (
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfPrint ( const char * s , int lenght ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfPrint (
+ JNIEnv *env, jobject obj,
+ jstring s,
+ jint lenght)
+ {
+ char *ptr0 = NULL;
+
+ ptr0 = jnitoolsGetJavaString(env, s);
+ glfPrint (
+ (const char *) ptr0,
+ (int) lenght
+ );
+
+ free(ptr0);
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfPrintString ( const char * s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfPrintString (
+ JNIEnv *env, jobject obj,
+ jstring s)
+ {
+ char *ptr0 = NULL;
+
+ ptr0 = jnitoolsGetJavaString(env, s);
+ glfPrintString (
+ (const char *) ptr0
+ );
+
+ free(ptr0);
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfPrintChar ( char s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfPrintChar (
+ JNIEnv *env, jobject obj,
+ jbyte s)
+ {
+
+ glfPrintChar (
+ (char) s
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfConsoleDraw ( ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfConsoleDraw (
+ JNIEnv *env, jobject obj)
+ {
+
+ glfConsoleDraw (
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfSetCursorBlinkRate ( int Rate ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfSetCursorBlinkRate (
+ JNIEnv *env, jobject obj,
+ jint Rate)
+ {
+
+ glfSetCursorBlinkRate (
+ (int) Rate
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfStringCentering ( GLboolean center ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfStringCentering (
+ JNIEnv *env, jobject obj,
+ jboolean center)
+ {
+
+ glfStringCentering (
+ (GLboolean) center
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ GLboolean glfGetStringCentering ( ) ;
+ * </pre>
+ */
+ JNIEXPORT jboolean JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfGetStringCentering (
+ JNIEnv *env, jobject obj)
+ {
+ jboolean ret;
+
+
+ ret = (jboolean) glfGetStringCentering (
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfBitmapStringCentering ( GLboolean center ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfBitmapStringCentering (
+ JNIEnv *env, jobject obj,
+ jboolean center)
+ {
+
+ glfBitmapStringCentering (
+ (GLboolean) center
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ GLboolean glfBitmapGetStringCentering ( ) ;
+ * </pre>
+ */
+ JNIEXPORT jboolean JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfBitmapGetStringCentering (
+ JNIEnv *env, jobject obj)
+ {
+ jboolean ret;
+
+
+ ret = (jboolean) glfBitmapGetStringCentering (
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfStringDirection ( GLuint direction ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfStringDirection (
+ JNIEnv *env, jobject obj,
+ jint direction)
+ {
+
+ glfStringDirection (
+ (GLuint) direction
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ GLuint glfGetStringDirection ( ) ;
+ * </pre>
+ */
+ JNIEXPORT jint JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfGetStringDirection (
+ JNIEnv *env, jobject obj)
+ {
+ jint ret;
+
+
+ ret = (jint) glfGetStringDirection (
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfSetRotateAngle ( float angle ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfSetRotateAngle (
+ JNIEnv *env, jobject obj,
+ jfloat angle)
+ {
+
+ glfSetRotateAngle (
+ (float) angle
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfSetBRotateAngle ( float angle ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfSetBRotateAngle (
+ JNIEnv *env, jobject obj,
+ jfloat angle)
+ {
+
+ glfSetBRotateAngle (
+ (float) angle
+ );
+
+ }
+
+/* C2J Parser Version 2.2: Java program parsed successfully. */
diff --git a/CNativeCode/GLF_JNI_funcs.c b/CNativeCode/GLF_JNI_funcs.c
new file mode 100755
index 0000000..2d4dde4
--- /dev/null
+++ b/CNativeCode/GLF_JNI_funcs.c
@@ -0,0 +1,1319 @@
+/* WARNING ! WARNING *** THIS FILE IS GENERATED BY C2J !!!
+
+ DO NOT MAKE ANY CHANGES *** MAKE CHANGES IN THE SKELETON FILES !!!
+*/
+
+
+#include "OpenGL_misc.h"
+
+#include "gl4java_utils_glf_GLFFuncJNI.h"
+
+#include "jnitools.h"
+#include "glf.h"
+
+/**
+ * herein lies the native JAVA methods for the GLF functions.
+ */
+
+
+static const char * _glf_lib_vendor_="Roman Podobedov, Sven Goethel";
+static const char * _glf_lib_version_="1.4.0.0";
+
+JNIEXPORT jstring JNICALL
+Java_gl4java_utils_glf_GLFFuncJNI_getNativeVendor ( JNIEnv *env, jobject obj )
+{
+ return (*env)->NewStringUTF(env, _glf_lib_vendor_);
+}
+
+JNIEXPORT jstring JNICALL
+Java_gl4java_utils_glf_GLFFuncJNI_getNativeVersion ( JNIEnv *env, jobject obj )
+{
+ return (*env)->NewStringUTF(env, _glf_lib_version_);
+}
+
+JNIEXPORT jint JNICALL
+Java_gl4java_utils_glf_GLFFuncJNI_glfLoadFontNative (
+ JNIEnv *env, jobject obj, jlong filed)
+{
+ return (jint) glfLoadFont ( (FILE *) ((PointerHolder)filed) );
+}
+
+JNIEXPORT jint JNICALL
+Java_gl4java_utils_glf_GLFFuncJNI_glfLoadBFontNative (
+ JNIEnv *env, jobject obj, jlong filed)
+{
+ return (jint) glfLoadBFont ( (FILE *) ((PointerHolder)filed) );
+}
+
+/**
+ * C2J Parser Version 2.2
+ * Jausoft - Sven Goethel Software Development
+ * Reading from file: glf-proto-auto.orig.h . . .
+ * Destination-Class: gl4java_utils_glf_GLFFuncJNI !
+ */
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfInit ( ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfInit (
+ JNIEnv *env, jobject obj)
+ {
+
+ glfInit (
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfClose ( ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfClose (
+ JNIEnv *env, jobject obj)
+ {
+
+ glfClose (
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ int glfUnloadFont ( ) ;
+ * </pre>
+ */
+ JNIEXPORT jint JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfUnloadFont (
+ JNIEnv *env, jobject obj)
+ {
+ jint ret;
+
+
+ ret = (jint) glfUnloadFont (
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ int glfUnloadBFont ( ) ;
+ * </pre>
+ */
+ JNIEXPORT jint JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfUnloadBFont (
+ JNIEnv *env, jobject obj)
+ {
+ jint ret;
+
+
+ ret = (jint) glfUnloadBFont (
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ int glfUnloadFontD ( int font_descriptor ) ;
+ * </pre>
+ */
+ JNIEXPORT jint JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfUnloadFontD (
+ JNIEnv *env, jobject obj,
+ jint font_descriptor)
+ {
+ jint ret;
+
+
+ ret = (jint) glfUnloadFontD (
+ (int) font_descriptor
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ int glfUnloadBFontD ( int bmf_descriptor ) ;
+ * </pre>
+ */
+ JNIEXPORT jint JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfUnloadBFontD (
+ JNIEnv *env, jobject obj,
+ jint bmf_descriptor)
+ {
+ jint ret;
+
+
+ ret = (jint) glfUnloadBFontD (
+ (int) bmf_descriptor
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawWiredSymbol ( char s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDrawWiredSymbol (
+ JNIEnv *env, jobject obj,
+ jbyte s)
+ {
+
+ glfDrawWiredSymbol (
+ (char) s
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawWiredString ( const char * s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDrawWiredString (
+ JNIEnv *env, jobject obj,
+ jstring s)
+ {
+ char *ptr0 = NULL;
+
+ ptr0 = jnitoolsGetJavaString(env, s);
+ glfDrawWiredString (
+ (const char *) ptr0
+ );
+
+ free(ptr0);
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawSolidSymbol ( char s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDrawSolidSymbol (
+ JNIEnv *env, jobject obj,
+ jbyte s)
+ {
+
+ glfDrawSolidSymbol (
+ (char) s
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawSolidString ( const char * s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDrawSolidString (
+ JNIEnv *env, jobject obj,
+ jstring s)
+ {
+ char *ptr0 = NULL;
+
+ ptr0 = jnitoolsGetJavaString(env, s);
+ glfDrawSolidString (
+ (const char *) ptr0
+ );
+
+ free(ptr0);
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDraw3DWiredSymbol ( char s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDraw3DWiredSymbol (
+ JNIEnv *env, jobject obj,
+ jbyte s)
+ {
+
+ glfDraw3DWiredSymbol (
+ (char) s
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDraw3DWiredString ( const char * s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDraw3DWiredString (
+ JNIEnv *env, jobject obj,
+ jstring s)
+ {
+ char *ptr0 = NULL;
+
+ ptr0 = jnitoolsGetJavaString(env, s);
+ glfDraw3DWiredString (
+ (const char *) ptr0
+ );
+
+ free(ptr0);
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDraw3DSolidSymbol ( char s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDraw3DSolidSymbol (
+ JNIEnv *env, jobject obj,
+ jbyte s)
+ {
+
+ glfDraw3DSolidSymbol (
+ (char) s
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDraw3DSolidString ( const char * s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDraw3DSolidString (
+ JNIEnv *env, jobject obj,
+ jstring s)
+ {
+ char *ptr0 = NULL;
+
+ ptr0 = jnitoolsGetJavaString(env, s);
+ glfDraw3DSolidString (
+ (const char *) ptr0
+ );
+
+ free(ptr0);
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ int glfBeginBFont ( int Font_Descriptor ) ;
+ * </pre>
+ */
+ JNIEXPORT jint JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfBeginBFont (
+ JNIEnv *env, jobject obj,
+ jint Font_Descriptor)
+ {
+ jint ret;
+
+
+ ret = (jint) glfBeginBFont (
+ (int) Font_Descriptor
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfEndBFont ( ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfEndBFont (
+ JNIEnv *env, jobject obj)
+ {
+
+ glfEndBFont (
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawBSymbol ( char s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDrawBSymbol (
+ JNIEnv *env, jobject obj,
+ jbyte s)
+ {
+
+ glfDrawBSymbol (
+ (char) s
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawBString ( const char * s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDrawBString (
+ JNIEnv *env, jobject obj,
+ jstring s)
+ {
+ char *ptr0 = NULL;
+
+ ptr0 = jnitoolsGetJavaString(env, s);
+ glfDrawBString (
+ (const char *) ptr0
+ );
+
+ free(ptr0);
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawBMaskSymbol ( char s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDrawBMaskSymbol (
+ JNIEnv *env, jobject obj,
+ jbyte s)
+ {
+
+ glfDrawBMaskSymbol (
+ (char) s
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawBMaskString ( const char * s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDrawBMaskString (
+ JNIEnv *env, jobject obj,
+ jstring s)
+ {
+ char *ptr0 = NULL;
+
+ ptr0 = jnitoolsGetJavaString(env, s);
+ glfDrawBMaskString (
+ (const char *) ptr0
+ );
+
+ free(ptr0);
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawWiredSymbolF ( int font_descriptor , char s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDrawWiredSymbolF (
+ JNIEnv *env, jobject obj,
+ jint font_descriptor,
+ jbyte s)
+ {
+
+ glfDrawWiredSymbolF (
+ (int) font_descriptor,
+ (char) s
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawWiredStringF ( int font_descriptor , const char * s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDrawWiredStringF (
+ JNIEnv *env, jobject obj,
+ jint font_descriptor,
+ jstring s)
+ {
+ char *ptr1 = NULL;
+
+ ptr1 = jnitoolsGetJavaString(env, s);
+ glfDrawWiredStringF (
+ (int) font_descriptor,
+ (const char *) ptr1
+ );
+
+ free(ptr1);
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawSolidSymbolF ( int font_descriptor , char s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDrawSolidSymbolF (
+ JNIEnv *env, jobject obj,
+ jint font_descriptor,
+ jbyte s)
+ {
+
+ glfDrawSolidSymbolF (
+ (int) font_descriptor,
+ (char) s
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawSolidStringF ( int font_descriptor , const char * s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDrawSolidStringF (
+ JNIEnv *env, jobject obj,
+ jint font_descriptor,
+ jstring s)
+ {
+ char *ptr1 = NULL;
+
+ ptr1 = jnitoolsGetJavaString(env, s);
+ glfDrawSolidStringF (
+ (int) font_descriptor,
+ (const char *) ptr1
+ );
+
+ free(ptr1);
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDraw3DWiredSymbolF ( int font_descriptor , char s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDraw3DWiredSymbolF (
+ JNIEnv *env, jobject obj,
+ jint font_descriptor,
+ jbyte s)
+ {
+
+ glfDraw3DWiredSymbolF (
+ (int) font_descriptor,
+ (char) s
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDraw3DWiredStringF ( int font_descriptor , const char * s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDraw3DWiredStringF (
+ JNIEnv *env, jobject obj,
+ jint font_descriptor,
+ jstring s)
+ {
+ char *ptr1 = NULL;
+
+ ptr1 = jnitoolsGetJavaString(env, s);
+ glfDraw3DWiredStringF (
+ (int) font_descriptor,
+ (const char *) ptr1
+ );
+
+ free(ptr1);
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDraw3DSolidSymbolF ( int font_descriptor , char s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDraw3DSolidSymbolF (
+ JNIEnv *env, jobject obj,
+ jint font_descriptor,
+ jbyte s)
+ {
+
+ glfDraw3DSolidSymbolF (
+ (int) font_descriptor,
+ (char) s
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDraw3DSolidStringF ( int font_descriptor , const char * s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDraw3DSolidStringF (
+ JNIEnv *env, jobject obj,
+ jint font_descriptor,
+ jstring s)
+ {
+ char *ptr1 = NULL;
+
+ ptr1 = jnitoolsGetJavaString(env, s);
+ glfDraw3DSolidStringF (
+ (int) font_descriptor,
+ (const char *) ptr1
+ );
+
+ free(ptr1);
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfGetStringBoundsF ( int fd , const char * s , float * minx , float * miny , float * maxx , float * maxy ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfGetStringBoundsF (
+ JNIEnv *env, jobject obj,
+ jint fd,
+ jstring s,
+ jfloatArray minx,
+ jfloatArray miny,
+ jfloatArray maxx,
+ jfloatArray maxy)
+ {
+ char *ptr1 = NULL;
+ jboolean isCopiedArray2 = JNI_FALSE;
+ jfloat *ptr2 = NULL;
+ jboolean isCopiedArray3 = JNI_FALSE;
+ jfloat *ptr3 = NULL;
+ jboolean isCopiedArray4 = JNI_FALSE;
+ jfloat *ptr4 = NULL;
+ jboolean isCopiedArray5 = JNI_FALSE;
+ jfloat *ptr5 = NULL;
+
+ ptr1 = jnitoolsGetJavaString(env, s);
+ if(minx!=NULL)
+ {
+ ptr2 = (*env)->GetFloatArrayElements(env, minx, &isCopiedArray2);
+ }
+ if(miny!=NULL)
+ {
+ ptr3 = (*env)->GetFloatArrayElements(env, miny, &isCopiedArray3);
+ }
+ if(maxx!=NULL)
+ {
+ ptr4 = (*env)->GetFloatArrayElements(env, maxx, &isCopiedArray4);
+ }
+ if(maxy!=NULL)
+ {
+ ptr5 = (*env)->GetFloatArrayElements(env, maxy, &isCopiedArray5);
+ }
+ glfGetStringBoundsF (
+ (int) fd,
+ (const char *) ptr1,
+ (float *) ptr2,
+ (float *) ptr3,
+ (float *) ptr4,
+ (float *) ptr5
+ );
+
+ free(ptr1);
+ if(minx!=NULL)
+ {
+ (*env)->ReleaseFloatArrayElements(env, minx, ptr2, (isCopiedArray2 == JNI_TRUE)?0:JNI_ABORT);
+ }
+ if(miny!=NULL)
+ {
+ (*env)->ReleaseFloatArrayElements(env, miny, ptr3, (isCopiedArray3 == JNI_TRUE)?0:JNI_ABORT);
+ }
+ if(maxx!=NULL)
+ {
+ (*env)->ReleaseFloatArrayElements(env, maxx, ptr4, (isCopiedArray4 == JNI_TRUE)?0:JNI_ABORT);
+ }
+ if(maxy!=NULL)
+ {
+ (*env)->ReleaseFloatArrayElements(env, maxy, ptr5, (isCopiedArray5 == JNI_TRUE)?0:JNI_ABORT);
+ }
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfGetStringBounds ( const char * s , float * minx , float * miny , float * maxx , float * maxy ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfGetStringBounds (
+ JNIEnv *env, jobject obj,
+ jstring s,
+ jfloatArray minx,
+ jfloatArray miny,
+ jfloatArray maxx,
+ jfloatArray maxy)
+ {
+ char *ptr0 = NULL;
+ jboolean isCopiedArray1 = JNI_FALSE;
+ jfloat *ptr1 = NULL;
+ jboolean isCopiedArray2 = JNI_FALSE;
+ jfloat *ptr2 = NULL;
+ jboolean isCopiedArray3 = JNI_FALSE;
+ jfloat *ptr3 = NULL;
+ jboolean isCopiedArray4 = JNI_FALSE;
+ jfloat *ptr4 = NULL;
+
+ ptr0 = jnitoolsGetJavaString(env, s);
+ if(minx!=NULL)
+ {
+ ptr1 = (*env)->GetFloatArrayElements(env, minx, &isCopiedArray1);
+ }
+ if(miny!=NULL)
+ {
+ ptr2 = (*env)->GetFloatArrayElements(env, miny, &isCopiedArray2);
+ }
+ if(maxx!=NULL)
+ {
+ ptr3 = (*env)->GetFloatArrayElements(env, maxx, &isCopiedArray3);
+ }
+ if(maxy!=NULL)
+ {
+ ptr4 = (*env)->GetFloatArrayElements(env, maxy, &isCopiedArray4);
+ }
+ glfGetStringBounds (
+ (const char *) ptr0,
+ (float *) ptr1,
+ (float *) ptr2,
+ (float *) ptr3,
+ (float *) ptr4
+ );
+
+ free(ptr0);
+ if(minx!=NULL)
+ {
+ (*env)->ReleaseFloatArrayElements(env, minx, ptr1, (isCopiedArray1 == JNI_TRUE)?0:JNI_ABORT);
+ }
+ if(miny!=NULL)
+ {
+ (*env)->ReleaseFloatArrayElements(env, miny, ptr2, (isCopiedArray2 == JNI_TRUE)?0:JNI_ABORT);
+ }
+ if(maxx!=NULL)
+ {
+ (*env)->ReleaseFloatArrayElements(env, maxx, ptr3, (isCopiedArray3 == JNI_TRUE)?0:JNI_ABORT);
+ }
+ if(maxy!=NULL)
+ {
+ (*env)->ReleaseFloatArrayElements(env, maxy, ptr4, (isCopiedArray4 == JNI_TRUE)?0:JNI_ABORT);
+ }
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfSetSymbolSpace ( float sp ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfSetSymbolSpace (
+ JNIEnv *env, jobject obj,
+ jfloat sp)
+ {
+
+ glfSetSymbolSpace (
+ (float) sp
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ float glfGetSymbolSpace ( ) ;
+ * </pre>
+ */
+ JNIEXPORT jfloat JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfGetSymbolSpace (
+ JNIEnv *env, jobject obj)
+ {
+ jfloat ret;
+
+
+ ret = (jfloat) glfGetSymbolSpace (
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfSetSpaceSize ( float sp ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfSetSpaceSize (
+ JNIEnv *env, jobject obj,
+ jfloat sp)
+ {
+
+ glfSetSpaceSize (
+ (float) sp
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ float glfGetSpaceSize ( ) ;
+ * </pre>
+ */
+ JNIEXPORT jfloat JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfGetSpaceSize (
+ JNIEnv *env, jobject obj)
+ {
+ jfloat ret;
+
+
+ ret = (jfloat) glfGetSpaceSize (
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfSetSymbolDepth ( float dpth ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfSetSymbolDepth (
+ JNIEnv *env, jobject obj,
+ jfloat dpth)
+ {
+
+ glfSetSymbolDepth (
+ (float) dpth
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ float glfGetSymbolDepth ( ) ;
+ * </pre>
+ */
+ JNIEXPORT jfloat JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfGetSymbolDepth (
+ JNIEnv *env, jobject obj)
+ {
+ jfloat ret;
+
+
+ ret = (jfloat) glfGetSymbolDepth (
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ int glfSetCurrentFont ( int Font_Descriptor ) ;
+ * </pre>
+ */
+ JNIEXPORT jint JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfSetCurrentFont (
+ JNIEnv *env, jobject obj,
+ jint Font_Descriptor)
+ {
+ jint ret;
+
+
+ ret = (jint) glfSetCurrentFont (
+ (int) Font_Descriptor
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ int glfSetCurrentBFont ( int Font_Descriptor ) ;
+ * </pre>
+ */
+ JNIEXPORT jint JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfSetCurrentBFont (
+ JNIEnv *env, jobject obj,
+ jint Font_Descriptor)
+ {
+ jint ret;
+
+
+ ret = (jint) glfSetCurrentBFont (
+ (int) Font_Descriptor
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ int glfGetCurrentFont ( ) ;
+ * </pre>
+ */
+ JNIEXPORT jint JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfGetCurrentFont (
+ JNIEnv *env, jobject obj)
+ {
+ jint ret;
+
+
+ ret = (jint) glfGetCurrentFont (
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ int glfGetCurrentBFont ( ) ;
+ * </pre>
+ */
+ JNIEXPORT jint JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfGetCurrentBFont (
+ JNIEnv *env, jobject obj)
+ {
+ jint ret;
+
+
+ ret = (jint) glfGetCurrentBFont (
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfSetAnchorPoint ( int anchp ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfSetAnchorPoint (
+ JNIEnv *env, jobject obj,
+ jint anchp)
+ {
+
+ glfSetAnchorPoint (
+ (int) anchp
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfSetContourColor ( float r , float g , float b , float a ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfSetContourColor (
+ JNIEnv *env, jobject obj,
+ jfloat r,
+ jfloat g,
+ jfloat b,
+ jfloat a)
+ {
+
+ glfSetContourColor (
+ (float) r,
+ (float) g,
+ (float) b,
+ (float) a
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfEnable ( int what ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfEnable (
+ JNIEnv *env, jobject obj,
+ jint what)
+ {
+
+ glfEnable (
+ (int) what
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDisable ( int what ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfDisable (
+ JNIEnv *env, jobject obj,
+ jint what)
+ {
+
+ glfDisable (
+ (int) what
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfSetConsoleParam ( int width , int height ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfSetConsoleParam (
+ JNIEnv *env, jobject obj,
+ jint width,
+ jint height)
+ {
+
+ glfSetConsoleParam (
+ (int) width,
+ (int) height
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ int glfSetConsoleFont ( int Font_Descriptor ) ;
+ * </pre>
+ */
+ JNIEXPORT jint JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfSetConsoleFont (
+ JNIEnv *env, jobject obj,
+ jint Font_Descriptor)
+ {
+ jint ret;
+
+
+ ret = (jint) glfSetConsoleFont (
+ (int) Font_Descriptor
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfConsoleClear ( ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfConsoleClear (
+ JNIEnv *env, jobject obj)
+ {
+
+ glfConsoleClear (
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfPrint ( const char * s , int lenght ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfPrint (
+ JNIEnv *env, jobject obj,
+ jstring s,
+ jint lenght)
+ {
+ char *ptr0 = NULL;
+
+ ptr0 = jnitoolsGetJavaString(env, s);
+ glfPrint (
+ (const char *) ptr0,
+ (int) lenght
+ );
+
+ free(ptr0);
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfPrintString ( const char * s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfPrintString (
+ JNIEnv *env, jobject obj,
+ jstring s)
+ {
+ char *ptr0 = NULL;
+
+ ptr0 = jnitoolsGetJavaString(env, s);
+ glfPrintString (
+ (const char *) ptr0
+ );
+
+ free(ptr0);
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfPrintChar ( char s ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfPrintChar (
+ JNIEnv *env, jobject obj,
+ jbyte s)
+ {
+
+ glfPrintChar (
+ (char) s
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfConsoleDraw ( ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfConsoleDraw (
+ JNIEnv *env, jobject obj)
+ {
+
+ glfConsoleDraw (
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfSetCursorBlinkRate ( int Rate ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfSetCursorBlinkRate (
+ JNIEnv *env, jobject obj,
+ jint Rate)
+ {
+
+ glfSetCursorBlinkRate (
+ (int) Rate
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfStringCentering ( GLboolean center ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfStringCentering (
+ JNIEnv *env, jobject obj,
+ jboolean center)
+ {
+
+ glfStringCentering (
+ (GLboolean) center
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ GLboolean glfGetStringCentering ( ) ;
+ * </pre>
+ */
+ JNIEXPORT jboolean JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfGetStringCentering (
+ JNIEnv *env, jobject obj)
+ {
+ jboolean ret;
+
+
+ ret = (jboolean) glfGetStringCentering (
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfBitmapStringCentering ( GLboolean center ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfBitmapStringCentering (
+ JNIEnv *env, jobject obj,
+ jboolean center)
+ {
+
+ glfBitmapStringCentering (
+ (GLboolean) center
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ GLboolean glfBitmapGetStringCentering ( ) ;
+ * </pre>
+ */
+ JNIEXPORT jboolean JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfBitmapGetStringCentering (
+ JNIEnv *env, jobject obj)
+ {
+ jboolean ret;
+
+
+ ret = (jboolean) glfBitmapGetStringCentering (
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfStringDirection ( GLuint direction ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfStringDirection (
+ JNIEnv *env, jobject obj,
+ jint direction)
+ {
+
+ glfStringDirection (
+ (GLuint) direction
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ GLuint glfGetStringDirection ( ) ;
+ * </pre>
+ */
+ JNIEXPORT jint JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfGetStringDirection (
+ JNIEnv *env, jobject obj)
+ {
+ jint ret;
+
+
+ ret = (jint) glfGetStringDirection (
+ );
+
+ return ret;
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfSetRotateAngle ( float angle ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfSetRotateAngle (
+ JNIEnv *env, jobject obj,
+ jfloat angle)
+ {
+
+ glfSetRotateAngle (
+ (float) angle
+ );
+
+ }
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfSetBRotateAngle ( float angle ) ;
+ * </pre>
+ */
+ JNIEXPORT void JNICALL
+ Java_gl4java_utils_glf_GLFFuncJNI_glfSetBRotateAngle (
+ JNIEnv *env, jobject obj,
+ jfloat angle)
+ {
+
+ glfSetBRotateAngle (
+ (float) angle
+ );
+
+ }
+
+/* C2J Parser Version 2.2: Java program parsed successfully. */
diff --git a/CNativeCode/GLF_funcs.c.skel b/CNativeCode/GLF_funcs.c.skel
new file mode 100644
index 0000000..477a155
--- /dev/null
+++ b/CNativeCode/GLF_funcs.c.skel
@@ -0,0 +1,11 @@
+#include "OpenGL_misc.h"
+
+#include "gl4java_utils_glf_GLFFuncJNI.h"
+
+#include "jnitools.h"
+#include "glf.h"
+
+/**
+ * herein lies the native JAVA methods for the GLF functions.
+ */
+
diff --git a/CNativeCode/Tool_JNI12_funcs.c b/CNativeCode/Tool_JNI12_funcs.c
new file mode 100644
index 0000000..7e571cf
--- /dev/null
+++ b/CNativeCode/Tool_JNI12_funcs.c
@@ -0,0 +1,70 @@
+#include "jnitools.h"
+
+JNIEXPORT jlong JNICALL
+Java_gl4java_utils_Tool_tmpfileCreate (
+ JNIEnv *env, jobject obj )
+{
+ return (jlong) ((PointerHolder)tmpfile());
+}
+
+JNIEXPORT jboolean JNICALL
+Java_gl4java_utils_Tool_tmpfileClose (
+ JNIEnv *env, jobject obj, jlong filed )
+{
+ return ( fclose( (FILE *) ((PointerHolder)filed) ) == 0 ) ?
+ JNI_TRUE : JNI_FALSE;
+}
+
+JNIEXPORT jint JNICALL
+Java_gl4java_utils_Tool_tmpfileWrite (
+ JNIEnv *env, jobject obj, jlong filed, jbyteArray data, int bytes)
+{
+ jint len;
+ jbyte * ptr = NULL;
+
+ if(data==NULL || filed==0) return 0;
+
+ len = (*env)->GetArrayLength(env, data);
+ if( 0 >= bytes || bytes>len ) bytes=len;
+
+ ptr = (jbyte *) (*env)->GetPrimitiveArrayCritical(env, data, NULL);
+
+ len = (jint) fwrite ( (void *) ptr, 1, bytes,
+ (FILE *) ((PointerHolder)filed) );
+
+ /* NO copy back, free the memory .. */
+ (*env)->ReleasePrimitiveArrayCritical(env, data, ptr, JNI_ABORT);
+
+ return len;
+}
+
+JNIEXPORT jint JNICALL
+Java_gl4java_utils_Tool_tmpfileRead (
+ JNIEnv *env, jobject obj, jlong filed, jbyteArray data, int bytes)
+{
+ jint len;
+ jbyte * ptr = NULL;
+
+ if(data==NULL || filed==0) return 0;
+
+ len = (*env)->GetArrayLength(env, data);
+ if( 0 >= bytes || bytes>len ) bytes=len;
+
+ ptr = (jbyte *) (*env)->GetPrimitiveArrayCritical(env, data, NULL);
+
+ len = (jint) fread ( (void *) ptr, 1, bytes,
+ (FILE *) ((PointerHolder)filed) );
+
+ /* copy back and free the memory .. */
+ (*env)->ReleasePrimitiveArrayCritical(env, data, ptr, 0);
+
+ return len;
+}
+
+JNIEXPORT void JNICALL
+Java_gl4java_utils_Tool_tmpfileRewind (
+ JNIEnv *env, jobject obj, jlong filed)
+{
+ (void) fseek ( (FILE *) ((PointerHolder)filed), 0L, SEEK_SET );
+}
+
diff --git a/CNativeCode/Tool_JNI_funcs.c b/CNativeCode/Tool_JNI_funcs.c
new file mode 100644
index 0000000..3606a76
--- /dev/null
+++ b/CNativeCode/Tool_JNI_funcs.c
@@ -0,0 +1,70 @@
+#include "jnitools.h"
+
+JNIEXPORT jlong JNICALL
+Java_gl4java_utils_Tool_tmpfileCreate (
+ JNIEnv *env, jobject obj )
+{
+ return (jlong) ((PointerHolder)tmpfile());
+}
+
+JNIEXPORT jboolean JNICALL
+Java_gl4java_utils_Tool_tmpfileClose (
+ JNIEnv *env, jobject obj, jlong filed )
+{
+ return ( fclose( (FILE *) ((PointerHolder)filed) ) == 0 ) ?
+ JNI_TRUE : JNI_FALSE;
+}
+
+JNIEXPORT jint JNICALL
+Java_gl4java_utils_Tool_tmpfileWrite (
+ JNIEnv *env, jobject obj, jlong filed, jbyteArray data, int bytes)
+{
+ jint len;
+ jbyte * ptr = NULL;
+
+ if(data==NULL || filed==0) return 0;
+
+ len = (*env)->GetArrayLength(env, data);
+ if( 0 >= bytes || bytes>len ) bytes=len;
+
+ ptr = (*env)->GetByteArrayElements(env, data, NULL);
+
+ len = (jint) fwrite ( (void *) ptr, bytes, 1,
+ (FILE *) ((PointerHolder)filed) );
+
+ /* NO copy back, free the memory .. */
+ (*env)->ReleaseByteArrayElements(env, data, ptr, JNI_ABORT);
+
+ return len;
+}
+
+JNIEXPORT jint JNICALL
+Java_gl4java_utils_Tool_tmpfileRead (
+ JNIEnv *env, jobject obj, jlong filed, jbyteArray data, int bytes)
+{
+ jint len;
+ jbyte * ptr = NULL;
+
+ if(data==NULL || filed==0) return 0;
+
+ len = (*env)->GetArrayLength(env, data);
+ if( 0 >= bytes || bytes>len ) bytes=len;
+
+ ptr = (*env)->GetByteArrayElements(env, data, NULL);
+
+ len = (jint) fread ( (void *) ptr, bytes, 1,
+ (FILE *) ((PointerHolder)filed) );
+
+ /* copy back and free the memory .. */
+ (*env)->ReleaseByteArrayElements(env, data, ptr, 0);
+
+ return len;
+}
+
+JNIEXPORT void JNICALL
+Java_gl4java_utils_Tool_tmpfileRewind (
+ JNIEnv *env, jobject obj, jlong filed)
+{
+ (void) fseek ( (FILE *) ((PointerHolder)filed), 0L, SEEK_SET );
+}
+
diff --git a/CNativeCode/glf.c b/CNativeCode/glf.c
new file mode 100755
index 0000000..7430432
--- /dev/null
+++ b/CNativeCode/glf.c
@@ -0,0 +1,1741 @@
+/*
+==============================================================================
+| GLF Library
+| Version 1.4
+|
+| Author: Roman Podobedov
+| WEB: http://romka.demonews.com
+| Release Date: 18 May 2001
+|
+| Copyright (C) 2000-2001, Romka Graphics
+| This library is freely distributable without any license or permissions
+| for non-commercial usage. You can use this library in any non-commercial
+| program. In each program, where You use this library You should keep
+| this header (author name and coordinates)!
+| For commercial usage, please contact me: [email protected]
+==============================================================================
+*/
+
+#ifdef _WIN32_
+#include <windows.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include <GL/gl.h>
+#include <GL/glu.h>
+#include "glf.h"
+#include "gltool.h"
+
+/* ---------- Definitions and structures ----- */
+
+#define MAX_FONTS 256
+
+/* Color structure */
+struct color
+{
+ float r, g, b, a;
+};
+
+/* One symbol of font */
+struct one_symbol
+{
+ unsigned char vertexs; /* Number of vertexs */
+ unsigned char facets; /* Number of facets */
+ unsigned char lines; /* Number of lines in symbol */
+
+ float *vdata; /* Pointer to Vertex data */
+ unsigned char *fdata; /* Pointer to Facets data */
+ unsigned char *ldata; /* Pointer to Line data */
+
+ float leftx; /* Smaller x coordinate */
+ float rightx; /* Right x coordinate */
+ float topy; /* Top y coordinate */
+ float bottomy; /* Bottom y coordinate */
+};
+
+/* Font structure */
+struct glf_font
+{
+ char font_name [97];
+ unsigned char sym_total; /* Total symbols in font */
+ struct one_symbol *symbols[256]; /* Pointers to symbols */
+};
+
+/* ------------- Main variables -------------- */
+
+static int refNumber = 0;
+
+static float SymbolDist = 0.2f; /* Distance between symbols (Variable constant) */
+static float SymbolDepth = 0.2f; /* Symbol Depth in 3D space (Variable constant) */
+static float SpaceSize = 2.0f; /* Space size (Variable constant) */
+static float RotateAngle = 0.0f; /* Rotate angle for string (vector font) */
+static float RotateAngleB = 0.0f; /* Rotate angle for string (bitmap font) */
+
+/* Array of font pointers, up to MAX_FONTS fonts can be loaded at once */
+/* if (fonts[i] == NULL) then this font is not present in memory */
+
+static struct glf_font *fonts[MAX_FONTS];
+static int curfont; /* Index of current font pointer */
+static char ap = GLF_CENTER; /* Anchor point */
+static GLboolean m_string_center; /* String centering (vector fonts) */
+static GLboolean m_bitmap_string_center; /* String centering (bitmap fonts) */
+
+static GLuint m_direction; /* String direction (vector fonts) */
+
+static char console_msg = GLF_NO;
+static char texturing = GLF_NO;
+static char contouring = GLF_NO;
+static struct color contouring_color;
+
+/* Console mode variables */
+static int conWidth, conHeight; /* Console width and height */
+static int conx = 0, cony = 0; /* Console current X and Y */
+static char *conData; /* Console data */
+static int conFont; /* Console font */
+static char conCursor = GLF_NO; /* Console cursor Enabled|Disabled */
+static int conCursorBlink; /* Console cursor blink rate */
+static int conCursorCount; /* Console cursor blink counter */
+static char conCursorMode = GLF_NO; /* Console Cursor mode (on/off screen) */
+
+/* ----------- Variables for bitmap font ------------- */
+#define SEEK_SET_POS 4195
+
+struct coord_rect
+{
+ float x, y, width, height;
+};
+
+struct widths
+{
+ float *width;
+};
+
+/* Constants */
+static float sym_space=0.001f;
+
+/* One font variables */
+static struct coord_rect Symbols[256];
+static GLboolean bmf_texturing;
+static int bmf_curfont;
+static GLuint bmf_texture[MAX_FONTS]; /* All fonts */
+static GLuint bmf_mask[MAX_FONTS]; /* All fonts (masked) */
+static char bmf_in_use[MAX_FONTS]; /* 1 - if font is used, 0 - otherwise */
+static int list_base[MAX_FONTS];
+static GLfloat m_max_height[MAX_FONTS]; /* Maximal height of each font */
+static struct widths m_widths[MAX_FONTS]; /* Width of each symbols in each font */
+
+
+/* Initialization of GLF library, should be called before use of library */
+void glfInit()
+{
+ int i;
+
+ refNumber++;
+ if(refNumber>1) return;
+
+ for (i=0; i<MAX_FONTS; i++)
+ {
+ fonts[i] = NULL;
+ bmf_in_use[i] = 0;
+ m_max_height[i] = 0;
+ }
+
+ curfont = -1;
+ bmf_curfont = -1;
+ console_msg = GLF_NO;
+ ap = GLF_CENTER; /* Set anchor point to center of each symbol */
+ texturing = GLF_NO; /* By default texturing is NOT Enabled */
+ contouring = GLF_NO; /* By default contouring is NOT Enabled */
+ memset(&contouring_color, 0, sizeof(struct color));
+ conData = NULL;
+ glfSetConsoleParam(40, 20);
+ glfConsoleClear();
+ glfEnable(GLF_CONSOLE_CURSOR);
+ glfSetCursorBlinkRate(10);
+ glfStringCentering(GL_FALSE);
+ glfBitmapStringCentering(GL_FALSE);
+ glfStringDirection(GLF_LEFT);
+}
+
+/* Closing library usage */
+void glfClose()
+{
+ int i;
+
+ refNumber--;
+ if(refNumber>0) return;
+
+ free(conData);
+
+ for (i=0; i<MAX_FONTS; i++) glfUnloadFontD(i);
+ for (i=0; i<MAX_FONTS; i++) glfUnloadBFontD(i);
+}
+
+/*
+| This function check that this machine is little endian
+| Return value: 1 - little endian
+| 0 - big endian
+*/
+static int LittleEndian()
+{
+ int endianTester = 1;
+ char *endianChar = 0;
+
+ endianChar = (char *)&endianTester;
+ if (*endianChar) return 1;
+ return 0;
+}
+
+
+/*
+ ---------------------------------------------------------------------------------
+ ------------------------ Work with vector fonts ---------------------------------
+ ---------------------------------------------------------------------------------
+*/
+
+/*
+| This function read font file and store information in memory
+| Return: GLF_OK - if all OK
+| Return: GLF_ERROR - if any error
+*/
+static int ReadFont(FILE *fontf, struct glf_font *glff)
+{
+ char buffer[64];
+ int i, j;
+ unsigned char temp, code, verts, fcets, lns;
+ float tempfx, tempfy;
+ unsigned char *tp;
+ int LEndian; /* True if little endian machine */
+
+ fread(buffer, 3, 1, fontf);
+ buffer[3] = 0;
+ if (strcmp(buffer, "GLF"))
+ {
+ /* If header is not "GLF" */
+ if (console_msg) printf("Error reading font file: incorrect file format\n");
+ return GLF_ERROR;
+ }
+
+ /* Check for machine type */
+ LEndian = LittleEndian();
+
+ fread(glff->font_name, 96, 1, fontf);
+ glff->font_name[96] = 0;
+
+ fread(&glff->sym_total, 1, 1, fontf); /* Read total symbols in font */
+
+ for (i=0; i<MAX_FONTS; i++) glff->symbols[i] = NULL;
+
+ for (i=0; i<28; i++) fread(&temp, 1, 1, fontf); /* Read unused data */
+
+ /* Now start to read font data */
+
+ for (i=0; i<glff->sym_total; i++)
+ {
+ fread(&code, 1, 1, fontf); /* Read symbol code */
+ fread(&verts, 1, 1, fontf); /* Read vertexs count */
+ fread(&fcets, 1, 1, fontf); /* Read facets count */
+ fread(&lns, 1, 1, fontf); /* Read lines count */
+
+ if (glff->symbols[code] != NULL)
+ {
+ if (console_msg) printf("Error reading font file: encountered symbols in font\n");
+ return GLF_ERROR;
+ }
+
+ glff->symbols[code] = (struct one_symbol *)malloc(sizeof(struct one_symbol));
+ glff->symbols[code]->vdata = (float *)malloc(8*verts);
+ glff->symbols[code]->fdata = (unsigned char *)malloc(3*fcets);
+ glff->symbols[code]->ldata = (unsigned char *)malloc(lns);
+
+ glff->symbols[code]->vertexs = verts;
+ glff->symbols[code]->facets = fcets;
+ glff->symbols[code]->lines = lns;
+
+ /* Read vertexs data */
+ glff->symbols[code]->leftx = 10;
+ glff->symbols[code]->rightx = -10;
+ glff->symbols[code]->topy = 10;
+ glff->symbols[code]->bottomy = -10;
+
+ for (j=0; j<verts; j++)
+ {
+ fread(&tempfx, 4, 1, fontf);
+ fread(&tempfy, 4, 1, fontf);
+
+ /* If machine is bigendian -> swap low and high words in
+ tempfx and tempfy */
+ if (!LEndian)
+ {
+ tp = (unsigned char *)&tempfx;
+ temp = tp[0]; tp[0] = tp[3]; tp[3] = temp;
+ temp = tp[1]; tp[1] = tp[2]; tp[2] = temp;
+ tp = (unsigned char *)&tempfy;
+ temp = tp[0]; tp[0] = tp[3]; tp[3] = temp;
+ temp = tp[1]; tp[1] = tp[2]; tp[2] = temp;
+ }
+ glff->symbols[code]->vdata[j*2] = tempfx;
+ glff->symbols[code]->vdata[j*2+1] = tempfy;
+
+ if (tempfx < glff->symbols[code]->leftx) glff->symbols[code]->leftx = tempfx;
+ if (tempfx > glff->symbols[code]->rightx) glff->symbols[code]->rightx = tempfx;
+ if (tempfy < glff->symbols[code]->topy) glff->symbols[code]->topy = tempfy;
+ if (tempfy > glff->symbols[code]->bottomy) glff->symbols[code]->bottomy = tempfy;
+ }
+ for (j=0; j<fcets; j++)
+ fread(&glff->symbols[code]->fdata[j*3], 3, 1, fontf);
+ for (j=0; j<lns; j++)
+ fread(&glff->symbols[code]->ldata[j], 1, 1, fontf);
+ }
+ return GLF_OK;
+}
+
+
+/*
+| Function loads font to memory from file
+| Return value: GLF_ERROR - if error
+| >=0 - returned font descriptor (load success)
+*/
+int glfLoadFont(FILE * fontf)
+{
+ int i;
+ char flag; /* Temporary flag */
+
+ /* First we find free font descriptor */
+ flag = 0; /* Descriptor not found yet */
+ for (i=0; i<MAX_FONTS; i++)
+ if (fonts[i] == NULL)
+ {
+ /* Initialize this font */
+ fonts[i] = (struct glf_font *)malloc(sizeof(struct glf_font));
+ flag = 1;
+ break;
+ }
+
+ if (!flag) return GLF_ERROR; /* Free font not found */
+ if (ReadFont(fontf, fonts[i]) == GLF_OK)
+ {
+ curfont = i; /* Set curfont to just loaded font */
+ return i;
+ }
+
+ if (fonts[i] != NULL)
+ {
+ free(fonts[i]);
+ fonts[i] = NULL;
+ }
+ return GLF_ERROR;
+}
+
+/*
+| Unload current font from memory
+| Return value: GLF_OK - if all OK
+| GLF_ERROR - if error
+*/
+int glfUnloadFont()
+{
+ int i;
+
+ if ((curfont<0) || (fonts[curfont] == NULL)) return GLF_ERROR;
+
+ for (i=0; i<256; i++)
+ {
+ if (fonts[curfont]->symbols[i] != NULL)
+ {
+ free(fonts[curfont]->symbols[i]->vdata);
+ free(fonts[curfont]->symbols[i]->fdata);
+ free(fonts[curfont]->symbols[i]->ldata);
+ free(fonts[curfont]->symbols[i]);
+ }
+ }
+
+ free(fonts[curfont]);
+ fonts[curfont] = NULL;
+ curfont = -1;
+ return GLF_OK;
+}
+
+/* Unload font by font descriptor */
+int glfUnloadFontD(int font_descriptor)
+{
+ int temp;
+
+ if ((font_descriptor < 0) || (fonts[font_descriptor] == NULL)) return GLF_ERROR;
+
+ temp = curfont;
+ curfont = font_descriptor;
+ glfUnloadFont();
+ if (temp != font_descriptor) curfont = temp;
+ else curfont = -1;
+ return GLF_OK;
+}
+
+void glfDrawWiredSymbol(char s)
+{
+ int i, cur_line;
+ float *tvp; /* temporary vertex pointer */
+ float x, y;
+
+ if ((curfont < 0) || (fonts[curfont] == NULL)) return;
+ if (fonts[curfont]->symbols[s] == NULL) return;
+
+ disp__glBegin(GL_LINE_LOOP);
+ tvp = fonts[curfont]->symbols[s]->vdata;
+ cur_line = 0;
+ for (i=0; i<fonts[curfont]->symbols[s]->vertexs; i++)
+ {
+ x = *tvp++;
+ y = *tvp++;
+ disp__glVertex2f(x, y);
+ if (fonts[curfont]->symbols[s]->ldata[cur_line] == i)
+ {
+ disp__glEnd();
+ cur_line++;
+ if (cur_line < fonts[curfont]->symbols[s]->lines) disp__glBegin(GL_LINE_LOOP);
+ else break; /* No more lines */
+ }
+ }
+}
+
+/* Draw wired symbol by font_descriptor */
+void glfDrawWiredSymbolF(int font_descriptor, char s)
+{
+ int temp;
+
+ temp = curfont;
+ curfont = font_descriptor;
+ glfDrawWiredSymbol(s);
+ curfont = temp;
+}
+
+static void DrawString(const char *s, void (*funct) (char))
+{
+ int i;
+ float sda, sdb;
+ float distance;
+
+ if (!s) return;
+ if (!*s) return;
+ if (curfont == -1) return;
+
+ /* Calculate correction (if string centering enabled) */
+ if (m_string_center)
+ {
+ distance = 0;
+ for (i=0; i<(int)strlen(s); i++)
+ {
+ if ((fonts[curfont]->symbols[s[i]] == NULL) || (s[i] == ' '))
+ {
+ if (m_direction == GLF_LEFT || m_direction == GLF_UP) distance += SpaceSize;
+ else distance -= SpaceSize;
+ }
+ else
+ if (i < ((int)strlen(s)-1))
+ {
+ if (s[i+1] == ' ')
+ {
+ if (m_direction == GLF_LEFT || m_direction == GLF_UP) distance += SymbolDist;
+ else distance -= SymbolDist;
+ }
+ else
+ {
+ if (fonts[curfont]->symbols[s[i+1]] == NULL) continue;
+
+ if (m_direction == GLF_LEFT || m_direction == GLF_RIGHT)
+ {
+ sda = (float)fabs(fonts[curfont]->symbols[s[i]]->rightx);
+ sdb = (float)fabs(fonts[curfont]->symbols[s[i+1]]->leftx);
+ if (m_direction == GLF_LEFT) distance += sda+sdb+SymbolDist;
+ else distance -= sda+sdb+SymbolDist;
+ }
+ else
+ {
+ sda = (float)fabs(fonts[curfont]->symbols[s[i]]->topy);
+ sdb = (float)fabs(fonts[curfont]->symbols[s[i]]->bottomy);
+ if (m_direction == GLF_DOWN) distance -= sda+sdb+SymbolDist;
+ else distance += sda+sdb+SymbolDist;
+ }
+ }
+ }
+ }
+ }
+
+ disp__glPushMatrix();
+
+ /* Rotate if needed */
+ if (RotateAngle != 0.0f) disp__glRotatef(RotateAngle, 0, 0, 1);
+
+ /* Correct string position */
+ if (m_string_center)
+ {
+ switch (m_direction)
+ {
+ case GLF_LEFT : disp__glTranslatef(-distance/2, 0, 0); break;
+ case GLF_RIGHT : disp__glTranslatef(distance/2, 0, 0); break;
+ case GLF_UP : disp__glTranslatef(0, distance/2, 0); break;
+ case GLF_DOWN : disp__glTranslatef(0, -distance/2, 0); break;
+ }
+ }
+ else if (s[0] != ' ')
+ {
+ switch (m_direction)
+ {
+ case GLF_LEFT : disp__glTranslatef(-(1-(float)fabs(fonts[curfont]->symbols[s[0]]->leftx)), 0, 0); break;
+ case GLF_RIGHT : disp__glTranslatef((1-(float)fabs(fonts[curfont]->symbols[s[0]]->rightx)), 0, 0); break;
+ case GLF_UP : disp__glTranslatef(0, (1-(float)fabs(fonts[curfont]->symbols[s[0]]->topy)), 0); break;
+ case GLF_DOWN : disp__glTranslatef(0, -(1-(float)fabs(fonts[curfont]->symbols[s[0]]->bottomy)), 0); break;
+ }
+ }
+
+ /* Start to draw our string */
+ for (i=0; i<(int)strlen(s); i++)
+ {
+ if (s[i] != ' ') (*funct) (s[i]);
+ if ((fonts[curfont]->symbols[s[i]] == NULL) || (s[i] == ' '))
+ {
+ switch (m_direction)
+ {
+ case GLF_LEFT : disp__glTranslatef(SpaceSize, 0, 0); break;
+ case GLF_RIGHT : disp__glTranslatef(-SpaceSize, 0, 0); break;
+ case GLF_UP : disp__glTranslatef(0, SpaceSize, 0); break;
+ case GLF_DOWN : disp__glTranslatef(0, -SpaceSize, 0); break;
+ }
+ }
+ else
+ {
+ if (i < ((int)strlen(s)-1))
+ {
+ if (s[i+1] == ' ')
+ {
+ switch (m_direction)
+ {
+ case GLF_LEFT : disp__glTranslatef(SymbolDist, 0, 0); break;
+ case GLF_RIGHT : disp__glTranslatef(-SymbolDist, 0, 0); break;
+ case GLF_UP : disp__glTranslatef(0, SymbolDist, 0); break;
+ case GLF_DOWN : disp__glTranslatef(0, -SymbolDist, 0); break;
+ }
+ }
+ else
+ {
+ if (fonts[curfont]->symbols[s[i+1]] == NULL) continue;
+
+ if (m_direction == GLF_LEFT || m_direction == GLF_RIGHT)
+ {
+ if (m_direction == GLF_LEFT)
+ {
+ sda = (float)fabs(fonts[curfont]->symbols[s[i]]->rightx);
+ sdb = (float)fabs(fonts[curfont]->symbols[s[i+1]]->leftx);
+ }
+ else
+ {
+ sda = (float)fabs(fonts[curfont]->symbols[s[i+1]]->rightx);
+ sdb = (float)fabs(fonts[curfont]->symbols[s[i]]->leftx);
+ }
+
+ if (m_direction == GLF_LEFT) disp__glTranslatef(sda+sdb+SymbolDist, 0, 0);
+ else disp__glTranslatef(-(sda+sdb+SymbolDist), 0, 0);
+ }
+ else
+ {
+ if (m_direction == GLF_DOWN)
+ {
+ sda = (float)fabs(fonts[curfont]->symbols[s[i]]->topy);
+ sdb = (float)fabs(fonts[curfont]->symbols[s[i+1]]->bottomy);
+ }
+ else
+ {
+ sda = (float)fabs(fonts[curfont]->symbols[s[i+1]]->topy);
+ sdb = (float)fabs(fonts[curfont]->symbols[s[i]]->bottomy);
+ }
+
+ if (m_direction == GLF_DOWN) disp__glTranslatef(0, -(sda+sdb+SymbolDist), 0);
+ else disp__glTranslatef(0, sda+sdb+SymbolDist, 0);
+ }
+
+ }
+ }
+ }
+ }
+ disp__glPopMatrix();
+}
+
+void glfDrawWiredString(const char *s)
+{
+ DrawString(s, &glfDrawWiredSymbol);
+}
+
+/* Draw wired string by font_descriptor */
+void glfDrawWiredStringF(int font_descriptor, const char *s)
+{
+ int temp;
+
+ temp = curfont;
+ curfont = font_descriptor;
+ DrawString(s, &glfDrawWiredSymbol);
+ curfont = temp;
+}
+
+void glfDrawSolidSymbol(char s)
+{
+ unsigned char *b; /* Face pointer */
+ float *vp; /* Vertex pointer */
+ int i, j;
+ float x, y;
+ float temp_color[4];
+
+ if ((curfont<0) || (fonts[curfont] == NULL)) return;
+
+ if (fonts[curfont]->symbols[s] == NULL) return;
+
+ b = fonts[curfont]->symbols[s]->fdata;
+ vp = fonts[curfont]->symbols[s]->vdata;
+
+ disp__glBegin(GL_TRIANGLES);
+ for (i=0; i<fonts[curfont]->symbols[s]->facets; i++)
+ {
+ for (j=0; j<3; j++)
+ {
+ x = vp[*b*2];
+ y = vp[*b*2+1];
+ if (texturing == GLF_YES) disp__glTexCoord2f((x+1)/2, (y+1)/2);
+ disp__glVertex2f(x, y);
+ b++;
+ }
+ }
+ disp__glEnd();
+
+ /* Draw contour, if enabled */
+ if (contouring == GLF_YES)
+ {
+ disp__glGetFloatv(GL_CURRENT_COLOR, temp_color);
+ disp__glColor4f(contouring_color.r, contouring_color.g, contouring_color.b, contouring_color.a);
+ glfDrawWiredSymbol(s);
+ disp__glColor4fv(temp_color);
+ }
+}
+
+/* Draw solid symbol by font_descriptor */
+void glfDrawSolidSymbolF(int font_descriptor, char s)
+{
+ int temp;
+
+ temp = curfont;
+ curfont = font_descriptor;
+ glfDrawSolidSymbol(s);
+ curfont = temp;
+}
+
+void glfDrawSolidString(const char *s)
+{
+ DrawString(s, &glfDrawSolidSymbol);
+}
+
+/* Draw solid string by font_descriptor */
+void glfDrawSolidStringF(int font_descriptor, const char *s)
+{
+ int temp;
+
+ temp = curfont;
+ curfont = font_descriptor;
+ DrawString(s, &glfDrawSolidSymbol);
+ curfont = temp;
+}
+
+
+/* ------------ 3D Wired text drawing ---------------------- */
+
+void glfDraw3DWiredSymbol(char s)
+{
+ int i, cur_line;
+ float *tvp; /* temp vertex pointer */
+ float x, y;
+
+ if ((curfont<0) || (fonts[curfont] == NULL)) return;
+ if (fonts[curfont]->symbols[(int)s] == NULL) return;
+
+ /* Draw front symbol */
+ disp__glBegin(GL_LINE_LOOP);
+ tvp = fonts[curfont]->symbols[s]->vdata;
+ cur_line = 0;
+ for (i=0; i<fonts[curfont]->symbols[s]->vertexs; i++)
+ {
+ x = *tvp;
+ tvp++;
+ y = *tvp;
+ tvp++;
+ disp__glVertex3f(x, y, 1);
+ if (fonts[curfont]->symbols[s]->ldata[cur_line] == i)
+ {
+ disp__glEnd();
+ cur_line++;
+ if (cur_line < fonts[curfont]->symbols[s]->lines) disp__glBegin(GL_LINE_LOOP);
+ else break; /* No more lines */
+ }
+ }
+
+ /* Draw back symbol */
+ disp__glBegin(GL_LINE_LOOP);
+ tvp = fonts[curfont]->symbols[s]->vdata;
+ cur_line = 0;
+ for (i=0; i<fonts[curfont]->symbols[s]->vertexs; i++)
+ {
+ x = *tvp;
+ tvp++;
+ y = *tvp;
+ tvp++;
+ disp__glVertex3f(x, y, 1+SymbolDepth);
+ if (fonts[curfont]->symbols[s]->ldata[cur_line] == i)
+ {
+ disp__glEnd();
+ cur_line++;
+ if (cur_line < fonts[curfont]->symbols[s]->lines) disp__glBegin(GL_LINE_LOOP);
+ else break; /* No more lines */
+ }
+ }
+
+ /* Draw lines between back and front symbols */
+ disp__glBegin(GL_LINES);
+ tvp = fonts[curfont]->symbols[s]->vdata;
+ for (i=0; i<fonts[curfont]->symbols[s]->vertexs; i++)
+ {
+ x = *tvp;
+ tvp++;
+ y = *tvp;
+ tvp++;
+ disp__glVertex3f(x, y, 1);
+ disp__glVertex3f(x, y, 1+SymbolDepth);
+ }
+ disp__glEnd();
+}
+
+/* Draw 3D wired symbol by font_descriptor */
+void glfDraw3DWiredSymbolF(int font_descriptor, char s)
+{
+ int temp;
+
+ temp = curfont;
+ curfont = font_descriptor;
+ glfDraw3DWiredSymbol(s);
+ curfont = temp;
+}
+
+void glfDraw3DWiredString(const char *s)
+{
+ DrawString(s, &glfDraw3DWiredSymbol);
+}
+
+/* Draw 3D wired string by font_descriptor */
+void glfDraw3DWiredStringF(int font_descriptor, const char *s)
+{
+ int temp;
+
+ temp = curfont;
+ curfont = font_descriptor;
+ DrawString(s, &glfDraw3DWiredSymbol);
+ curfont = temp;
+}
+
+/* ------------ 3D Solid text drawing ---------------------- */
+
+void glfDraw3DSolidSymbol(char s)
+{
+ int i, j, cur_line, flag;
+ float x, y, bx, by;
+ unsigned char *b; /* Face pointer */
+ float *vp; /* Vertex pointer */
+ float *tvp; /* temp vertex pointer */
+ float temp_color[4];
+ GLboolean light_temp;
+
+ if ((curfont<0) || (fonts[curfont] == NULL)) return;
+ if (fonts[curfont]->symbols[(int)s] == NULL) return;
+
+ b = fonts[curfont]->symbols[s]->fdata;
+ vp = fonts[curfont]->symbols[s]->vdata;
+
+ disp__glBegin(GL_TRIANGLES);
+ disp__glNormal3f(0, 0, 1);
+ for (i=0; i<fonts[curfont]->symbols[s]->facets; i++)
+ {
+ b += 2;
+ for (j=0; j<3; j++)
+ {
+ x = vp[*b*2];
+ y = vp[*b*2+1];
+ disp__glVertex3f(x, y, 1+SymbolDepth);
+ b--;
+ }
+ b += 4;
+ }
+ disp__glEnd();
+
+ b = fonts[curfont]->symbols[s]->fdata;
+ vp = fonts[curfont]->symbols[s]->vdata;
+
+ disp__glBegin(GL_TRIANGLES);
+ disp__glNormal3f(0, 0, -1);
+ for (i=0; i<fonts[curfont]->symbols[s]->facets; i++)
+ {
+ for (j=0; j<3; j++)
+ {
+ x = vp[*b*2];
+ y = vp[*b*2+1];
+ disp__glVertex3f(x, y, 1);
+ b++;
+ }
+ }
+ disp__glEnd();
+
+ flag = 0;
+ disp__glBegin(GL_QUAD_STRIP);
+ tvp = fonts[curfont]->symbols[s]->vdata;
+ cur_line = 0;
+ for (i=0; i<fonts[curfont]->symbols[s]->vertexs; i++)
+ {
+ x = *tvp;
+ tvp++;
+ y = *tvp;
+ tvp++;
+ if (!flag)
+ {
+ bx = x;
+ by = y;
+ flag = 1;
+ }
+ disp__glNormal3f(x, y, 0);
+ disp__glVertex3f(x, y, 1);
+ disp__glVertex3f(x, y, 1+SymbolDepth);
+ if (fonts[curfont]->symbols[s]->ldata[cur_line] == i)
+ {
+ disp__glVertex3f(bx, by, 1);
+ disp__glVertex3f(bx, by, 1+SymbolDepth);
+ flag = 0;
+ disp__glEnd();
+ cur_line++;
+ if (cur_line < fonts[curfont]->symbols[s]->lines) disp__glBegin(GL_QUAD_STRIP);
+ else break; /* No more lines */
+ }
+ }
+
+ /* Draw contour, if enabled */
+ if (contouring == GLF_YES)
+ {
+ disp__glGetBooleanv(GL_LIGHTING, &light_temp);
+ disp__glDisable(GL_LIGHTING);
+ disp__glGetFloatv(GL_CURRENT_COLOR, temp_color);
+ disp__glColor4f(contouring_color.r, contouring_color.g, contouring_color.b, contouring_color.a);
+ glfDraw3DWiredSymbol(s);
+ disp__glColor4fv(temp_color);
+ if (light_temp) disp__glEnable(GL_LIGHTING);
+ }
+}
+
+/* Draw 3D solid symbol by font_descriptor */
+void glfDraw3DSolidSymbolF(int font_descriptor, char s)
+{
+ int temp;
+
+ temp = curfont;
+ curfont = font_descriptor;
+ glfDraw3DSolidSymbol(s);
+ curfont = temp;
+}
+
+void glfDraw3DSolidString(const char *s)
+{
+ DrawString(s, &glfDraw3DSolidSymbol);
+}
+
+/* Draw 3D solid string by font_descriptor */
+void glfDraw3DSolidStringF(int font_descriptor, const char *s)
+{
+ int temp;
+
+ temp = curfont;
+ curfont = font_descriptor;
+ DrawString(s, &glfDraw3DSolidSymbol);
+ curfont = temp;
+}
+
+/* Get the size a string will have on screen */
+void glfGetStringBoundsF(int fd, const char *s, float *minx, float *miny, float *maxx, float *maxy)
+{
+ struct glf_font *font;
+ int i;
+ float sda, sdb, cw = 0, minxx = 10;
+ float top = 10, bottom = -10;
+
+ if (fd < 0 || fd > (MAX_FONTS-1)) return;
+ font = fonts[fd];
+
+ if (font == NULL) return;
+
+ if (font->symbols[s[0]])
+ minxx = font->symbols[s[0]]->leftx;
+ else
+ minxx = 0.0;
+
+ for (i=0; i<(int)strlen(s); i++)
+ {
+ if ((font->symbols[s[i]] == NULL) || (s[i] == ' '))
+ cw += SpaceSize;
+ else
+ {
+ sdb = -font->symbols[(int)s[i]]->leftx;
+ sda = font->symbols[(int)s[i]]->rightx;
+
+ cw += sda+sdb+SymbolDist;
+
+ /* Update top/bottom bounds */
+ if (font->symbols[(int)s[i]]->bottomy > bottom)
+ bottom = font->symbols[(int)s[i]]->bottomy;
+
+ if (font->symbols[(int)s[i]]->topy < top)
+ top = font->symbols[(int)s[i]]->topy;
+ }
+ }
+
+ cw += minxx;
+
+ if ((maxx) && (maxy))
+ {
+ *maxx = cw;
+ *maxy = bottom;
+ }
+
+ if ((minx) && (miny))
+ {
+ *minx = minxx;
+ *miny = top;
+ }
+}
+
+void glfGetStringBounds(const char *s, float *minx, float *miny, float *maxx, float *maxy)
+{
+ glfGetStringBoundsF(curfont, s, minx, miny, maxx, maxy);
+}
+
+void glfSetSymbolSpace(float sp)
+{
+ SymbolDist = sp;
+}
+
+float glfGetSymbolSpace()
+{
+ return SymbolDist;
+}
+
+void glfSetSpaceSize(float sp)
+{
+ SpaceSize = sp;
+}
+
+float glfGetSpaceSize()
+{
+ return SpaceSize;
+}
+
+void glfSetSymbolDepth(float dpth)
+{
+ SymbolDepth = dpth;
+}
+
+float glfGetSymbolDepth()
+{
+ return SymbolDepth;
+}
+
+int glfSetCurrentFont(int Font_Descriptor)
+{
+ if ((Font_Descriptor < 0) || (fonts[Font_Descriptor] == NULL)) return GLF_ERROR;
+
+ curfont = Font_Descriptor;
+ return GLF_OK;
+}
+
+int glfGetCurrentFont()
+{
+ return curfont;
+}
+
+void glfSetAnchorPoint(int anchp)
+{
+ if ((anchp >= GLF_LEFT_UP) && (anchp <= GLF_RIGHT_DOWN))
+ ap = anchp;
+}
+
+void glfSetContourColor(float r, float g, float b, float a)
+{
+ contouring_color.r = r;
+ contouring_color.g = g;
+ contouring_color.b = b;
+ contouring_color.a = a;
+}
+
+void glfEnable(int what)
+{
+ switch (what)
+ {
+ case GLF_CONSOLE_MESSAGES: console_msg = GLF_YES; break;
+ case GLF_TEXTURING: texturing = GLF_YES; break;
+ case GLF_CONSOLE_CURSOR: conCursor = GLF_YES; break;
+ case GLF_CONTOURING: contouring = GLF_YES; break;
+ }
+}
+
+void glfDisable(int what)
+{
+ switch (what)
+ {
+ case GLF_CONSOLE_MESSAGES: console_msg = GLF_NO; break;
+ case GLF_TEXTURING: texturing = GLF_NO; break;
+ case GLF_CONSOLE_CURSOR: conCursor = GLF_NO; break;
+ case GLF_CONTOURING: contouring = GLF_NO; break;
+ }
+}
+
+/* ---------------- Console functions ---------------------- */
+
+void glfSetConsoleParam(int width, int height)
+{
+ if (conData) free(conData);
+
+ conWidth = width;
+ conHeight = height;
+ conData = (char *)malloc(width*height);
+ glfConsoleClear();
+}
+
+int glfSetConsoleFont(int Font_Descriptor)
+{
+ if ((Font_Descriptor < 0) || (fonts[Font_Descriptor] == NULL)) return GLF_ERROR;
+
+ conFont = Font_Descriptor;
+ return GLF_OK;
+}
+
+void glfConsoleClear()
+{
+ memset(conData, 0, conWidth*conHeight);
+ conx = 0;
+ cony = 0;
+}
+
+void glfPrint(const char *s, int lenght)
+{
+ int i;
+
+ for (i=0; i<lenght; i++)
+ {
+ if (s[i] > 31)
+ {
+ conData[cony*conWidth+conx] = s[i];
+ conx++;
+ } else
+ if (s[i] == '\n') conx = conWidth;
+ if (conx >= conWidth)
+ {
+ conx = 0;
+ cony++;
+ if (cony >= conHeight)
+ {
+ /* Shift all console contents up */
+ memcpy(conData, &conData[conWidth], conWidth*(conHeight-1));
+ /* Fill bottom line by spaces */
+ memset(&conData[conWidth*(conHeight-1)], 0, conWidth);
+ cony = conHeight-1;
+ }
+ }
+ }
+}
+
+void glfPrintString(const char *s)
+{
+ glfPrint(s, strlen(s));
+}
+
+void glfPrintChar(char s)
+{
+ glfPrint(&s, 1);
+}
+
+void glfConsoleDraw()
+{
+ int i, j;
+ char s[512];
+
+ for (i=0; i<conHeight; i++)
+ {
+ memcpy(s, &conData[i*conWidth], conWidth);
+ s[conWidth] = 0;
+ if ((conCursor == GLF_YES) && (i == cony))
+ {
+ conCursorCount--;
+ if (conCursorCount < 0)
+ {
+ conCursorCount = conCursorBlink;
+ if (conCursorMode == GLF_YES) conCursorMode = GLF_NO;
+ else conCursorMode = GLF_YES;
+ }
+
+ if (conCursorMode == GLF_YES)
+ for (j=0; j<conWidth; j++)
+ {
+ if (!s[j])
+ {
+ s[j] = '_'; /* Draw cursor */
+ s[j+1] = 0;
+ break;
+ }
+ }
+ }
+ glfDrawSolidStringF(conFont, s);
+ disp__glTranslatef(0, -2, 0);
+ }
+}
+
+void glfSetCursorBlinkRate(int Rate)
+{
+ if (Rate > 0)
+ {
+ conCursorBlink = Rate;
+ conCursorCount = Rate;
+ conCursorMode = GLF_YES;
+ }
+}
+
+/* Set string centering for vector fonts */
+void glfStringCentering(GLboolean center)
+{
+ m_string_center = center;
+}
+
+/* String direction for vector font (GLF_LEFT, GLF_RIGHT, GLF_UP, GLF_DOWN) */
+/* GLF_LEFT by default */
+void glfStringDirection(GLuint direction)
+{
+ if (direction == GLF_LEFT || direction == GLF_RIGHT ||
+ direction == GLF_UP || direction == GLF_DOWN) m_direction = direction;
+}
+
+/* Get current text direction */
+GLuint glfGetStringDirection()
+{
+ return m_direction;
+}
+
+
+/* Get string centering for vector fonts */
+GLboolean glfGetStringCentering()
+{
+ return m_string_center;
+}
+
+/* Set rotate angle for vector fonts */
+void glfSetRotateAngle(float angle)
+{
+ RotateAngle = angle;
+}
+
+
+/*
+ ---------------------------------------------------------------------------------
+ ------------------------ Work with bitmapped fonts ------------------------------
+ ---------------------------------------------------------------------------------
+*/
+
+
+/* Some color conversions */
+static void bwtorgba(unsigned char *b,unsigned char *l,int n)
+{
+ while (n--)
+ {
+ l[0] = *b; l[1] = *b;
+ l[2] = *b; l[3] = 0xff;
+ l += 4; b++;
+ }
+}
+
+static void latorgba(unsigned char *b, unsigned char *a,unsigned char *l,int n)
+{
+ while(n--)
+ {
+ l[0] = *b; l[1] = *b;
+ l[2] = *b; l[3] = *a;
+ l += 4; b++; a++;
+ }
+}
+
+static void rgbtorgba(unsigned char *r,unsigned char *g,unsigned char *b,unsigned char *l,int n)
+{
+ while(n--)
+ {
+ l[0] = r[0]; l[1] = g[0];
+ l[2] = b[0]; l[3] = 0xff;
+ l += 4; r++; g++; b++;
+ }
+}
+
+static void rgbatorgba(unsigned char *r,unsigned char *g,unsigned char *b,unsigned char *a,unsigned char *l,int n)
+{
+ while(n--)
+ {
+ l[0] = r[0]; l[1] = g[0];
+ l[2] = b[0]; l[3] = a[0];
+ l += 4; r++; g++; b++; a++;
+ }
+}
+
+typedef struct _ImageRec
+{
+ unsigned short imagic;
+ unsigned short type;
+ unsigned short dim;
+ unsigned short xsize, ysize, zsize;
+ unsigned int min, max;
+ unsigned int wasteBytes;
+ char name[80];
+ unsigned long colorMap;
+ FILE *file;
+ unsigned char *tmp, *tmpR, *tmpG, *tmpB;
+ unsigned long rleEnd;
+ unsigned int *rowStart;
+ int *rowSize;
+} ImageRec;
+
+static void ConvertShort(unsigned short *array, long length)
+{
+ unsigned b1, b2;
+ unsigned char *ptr;
+
+ ptr = (unsigned char *)array;
+ while (length--) {
+ b1 = *ptr++;
+ b2 = *ptr++;
+ *array++ = (b1 << 8) | (b2);
+ }
+}
+
+static void ConvertLong(unsigned *array, long length)
+{
+ unsigned b1, b2, b3, b4;
+ unsigned char *ptr;
+
+ ptr = (unsigned char *)array;
+ while (length--)
+ {
+ b1 = *ptr++;
+ b2 = *ptr++;
+ b3 = *ptr++;
+ b4 = *ptr++;
+ *array++ = (b1 << 24) | (b2 << 16) | (b3 << 8) | (b4);
+ }
+}
+
+/* Open RGB Image */
+static ImageRec *ImageOpen(FILE *f)
+{
+ union
+ {
+ int testWord;
+ char testByte[4];
+ } endianTest;
+
+ ImageRec *image;
+ int swapFlag;
+ int x;
+
+ endianTest.testWord = 1;
+ if (endianTest.testByte[0] == 1) swapFlag = 1;
+ else swapFlag = 0;
+
+ image = (ImageRec *)malloc(sizeof(ImageRec));
+ if (image == NULL)
+ {
+ fprintf(stderr, "Out of memory!\n");
+ exit(1);
+ }
+
+ image->file = f;
+
+ fread(image, 1, 12, image->file);
+
+ if (swapFlag) ConvertShort(&image->imagic, 6);
+
+ image->tmp = (unsigned char *)malloc(image->xsize*256);
+ image->tmpR = (unsigned char *)malloc(image->xsize*256);
+ image->tmpG = (unsigned char *)malloc(image->xsize*256);
+ image->tmpB = (unsigned char *)malloc(image->xsize*256);
+ if (image->tmp == NULL || image->tmpR == NULL || image->tmpG == NULL ||
+ image->tmpB == NULL)
+ {
+ fprintf(stderr, "Out of memory!\n");
+ exit(1);
+ }
+
+ if ((image->type & 0xFF00) == 0x0100)
+ {
+ x = image->ysize * image->zsize * sizeof(unsigned);
+ image->rowStart = (unsigned *)malloc(x);
+ image->rowSize = (int *)malloc(x);
+ if (image->rowStart == NULL || image->rowSize == NULL)
+ {
+ fprintf(stderr, "Out of memory!\n");
+ exit(1);
+ }
+ image->rleEnd = 512 + (2 * x);
+ fseek(image->file, 512+SEEK_SET_POS, SEEK_SET);
+ fread(image->rowStart, 1, x, image->file);
+ fread(image->rowSize, 1, x, image->file);
+ if (swapFlag)
+ {
+ ConvertLong(image->rowStart, x/(int)sizeof(unsigned));
+ ConvertLong((unsigned *)image->rowSize, x/(int)sizeof(int));
+ }
+ }
+ else
+ {
+ image->rowStart = NULL;
+ image->rowSize = NULL;
+ }
+ return image;
+}
+
+/* Close Image and free data */
+static void ImageClose(ImageRec *image)
+{
+ free(image->tmp);
+ free(image->tmpR);
+ free(image->tmpG);
+ free(image->tmpB);
+ free(image->rowSize);
+ free(image->rowStart);
+ free(image);
+}
+
+/* Pixels row decoding (if used RLE encoding) */
+static void ImageGetRow(ImageRec *image, unsigned char *buf, int y, int z)
+{
+ unsigned char *iPtr, *oPtr, pixel;
+ int count;
+
+ if ((image->type & 0xFF00) == 0x0100)
+ {
+ fseek(image->file, (long)image->rowStart[y+z*image->ysize]+SEEK_SET_POS, SEEK_SET);
+ fread(image->tmp, 1, (unsigned int)image->rowSize[y+z*image->ysize], image->file);
+
+ iPtr = image->tmp;
+ oPtr = buf;
+ for (;;)
+ {
+ pixel = *iPtr++;
+ count = (int)(pixel & 0x7F);
+ if (!count) return;
+ if (pixel & 0x80) while (count--) *oPtr++ = *iPtr++;
+ else
+ {
+ pixel = *iPtr++;
+ while (count--) *oPtr++ = pixel;
+ }
+ }
+ }
+ else
+ {
+ fseek(image->file, 512+(y*image->xsize)+(z*image->xsize*image->ysize)+SEEK_SET_POS, SEEK_SET);
+ fread(buf, 1, image->xsize, image->file);
+ }
+}
+
+/* Read SGI (RGB) Image from file */
+static unsigned *read_texture(FILE *f, int *width, int *height, int *components)
+{
+ unsigned *base, *lptr;
+ unsigned char *rbuf, *gbuf, *bbuf, *abuf;
+ ImageRec *image;
+ int y;
+
+ image = ImageOpen(f);
+
+ if (!image) return NULL;
+ (*width) = image->xsize;
+ (*height) = image->ysize;
+ (*components) = image->zsize;
+
+ base = (unsigned *)malloc(image->xsize*image->ysize*sizeof(unsigned));
+ rbuf = (unsigned char *)malloc(image->xsize*sizeof(unsigned char));
+ gbuf = (unsigned char *)malloc(image->xsize*sizeof(unsigned char));
+ bbuf = (unsigned char *)malloc(image->xsize*sizeof(unsigned char));
+ abuf = (unsigned char *)malloc(image->xsize*sizeof(unsigned char));
+
+ if(!base || !rbuf || !gbuf || !bbuf) return NULL;
+ lptr = base;
+ for (y=0; y<image->ysize; y++)
+ {
+ if(image->zsize >= 4)
+ {
+ ImageGetRow(image, rbuf, y, 0);
+ ImageGetRow(image, gbuf, y, 1);
+ ImageGetRow(image, bbuf, y, 2);
+ ImageGetRow(image, abuf, y, 3);
+ rgbatorgba(rbuf,gbuf,bbuf,abuf,(unsigned char *)lptr,image->xsize);
+ lptr += image->xsize;
+ }
+ else if(image->zsize == 3)
+ {
+ ImageGetRow(image,rbuf, y, 0);
+ ImageGetRow(image,gbuf, y, 1);
+ ImageGetRow(image,bbuf, y, 2);
+ rgbtorgba(rbuf,gbuf,bbuf,(unsigned char *)lptr,image->xsize);
+ lptr += image->xsize;
+ }
+ else if(image->zsize == 2)
+ {
+ ImageGetRow(image,rbuf, y, 0);
+ ImageGetRow(image,abuf, y, 1);
+ latorgba(rbuf,abuf,(unsigned char *)lptr,image->xsize);
+ lptr += image->xsize;
+ }
+ else
+ {
+ ImageGetRow(image, rbuf, y, 0);
+ bwtorgba(rbuf,(unsigned char *)lptr,image->xsize);
+ lptr += image->xsize;
+ }
+ }
+ ImageClose(image);
+ free(rbuf);
+ free(gbuf);
+ free(bbuf);
+ free(abuf);
+
+ return (unsigned *) base;
+}
+
+/* Font texture conversion to mask texture */
+unsigned* texture_to_mask(unsigned* tex, int width, int height)
+{
+ int nSize, i;
+ unsigned *ret;
+
+ nSize = width * height;
+ ret = (unsigned *)malloc(nSize * sizeof(unsigned));
+ for (i=0; i<nSize; i++) ret[i] = tex[i] & 0x00ffffff ? 0 : 0x00ffffff;
+
+ return ret;
+}
+
+/* Load BMF file format, function return bitmap font descriptor */
+int glfLoadBFont(FILE * fontf)
+{
+ char Header[4];
+ char FontName[97];
+ int i, flag;
+ int LEndian;
+ float tx, ty, tw, th;
+ unsigned char temp, *tp;
+ unsigned *texture; /* Texture image */
+ unsigned *mask; /* Mask texture */
+ int twidth, theight, tcomp; /* Image parameters */
+ float *temp_width;
+
+ LEndian = LittleEndian();
+
+ /* Get header */
+ fread(Header, 1, 3, fontf);
+ Header[3] = 0;
+ if (strcmp(Header, "BMF")) return GLF_ERROR; /* Not BMF format */
+
+ /* Get font name */
+ fread(FontName, 1, 96, fontf);
+ FontName[96] = 0;
+
+ /* Allocate space for temp widths */
+
+ temp_width = (float *)malloc(sizeof(float)*256);
+
+ /* Read all 256 symbols information */
+ for (i=0; i<256; i++)
+ {
+ fread(&tx, 4, 1, fontf);
+ fread(&ty, 4, 1, fontf);
+ fread(&tw, 4, 1, fontf);
+ fread(&th, 4, 1, fontf);
+
+ if (!LEndian)
+ {
+ tp = (unsigned char *)&tx;
+ temp = tp[0]; tp[0] = tp[3]; tp[3] = temp;
+ temp = tp[1]; tp[1] = tp[2]; tp[2] = temp;
+ tp = (unsigned char *)&ty;
+ temp = tp[0]; tp[0] = tp[3]; tp[3] = temp;
+ temp = tp[1]; tp[1] = tp[2]; tp[2] = temp;
+ tp = (unsigned char *)&tw;
+ temp = tp[0]; tp[0] = tp[3]; tp[3] = temp;
+ temp = tp[1]; tp[1] = tp[2]; tp[2] = temp;
+ tp = (unsigned char *)&th;
+ temp = tp[0]; tp[0] = tp[3]; tp[3] = temp;
+ temp = tp[1]; tp[1] = tp[2]; tp[2] = temp;
+ }
+
+ Symbols[i].x = tx;
+ Symbols[i].y = ty;
+ Symbols[i].width = tw;
+ Symbols[i].height = th;
+ temp_width[i] = tw;
+ }
+
+ /* Read texture image from file and build texture */
+ texture = read_texture(fontf, &twidth, &theight, &tcomp);
+ /* Generate mask texture */
+ mask = texture_to_mask(texture, twidth, theight);
+
+ /* Find unused font descriptor */
+ flag = 0;
+ for (i=0; i<MAX_FONTS; i++)
+ if (bmf_in_use[i] == 0)
+ {
+ /* Initialize this font */
+ bmf_in_use[i] = 1;
+ bmf_curfont = i;
+ flag = 1;
+ break;
+ }
+ if (!flag) /* Not enought space for new texture */
+ {
+ free(texture);
+ free(mask);
+ free(temp_width);
+ return -1;
+ }
+
+ m_widths[bmf_curfont].width = temp_width;
+
+ /* Generating textures for font and mask */
+ disp__glGenTextures(1, &bmf_texture[bmf_curfont]);
+ disp__glGenTextures(1, &bmf_mask[bmf_curfont]);
+
+
+ disp__glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+
+ /* Build font texture */
+ disp__glBindTexture(GL_TEXTURE_2D, bmf_texture[bmf_curfont]);
+ disp__glTexImage2D(GL_TEXTURE_2D, 0, 3, twidth, theight, 0, GL_RGBA, GL_UNSIGNED_BYTE, texture);
+
+ /* Linear filtering for better quality */
+ disp__glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ disp__glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+
+ /* Build mask texture */
+ disp__glBindTexture(GL_TEXTURE_2D, bmf_mask[bmf_curfont]);
+ disp__glTexImage2D(GL_TEXTURE_2D, 0, 3, twidth, theight, 0, GL_RGBA, GL_UNSIGNED_BYTE, mask);
+ disp__glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ disp__glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+
+ free(texture);
+ free(mask);
+
+ /* Now build list for each symbol */
+ list_base[bmf_curfont] = disp__glGenLists(256);
+ for (i=0; i<256; i++)
+ {
+ disp__glNewList(list_base[bmf_curfont]+i, GL_COMPILE);
+
+ disp__glBegin(GL_QUADS);
+ disp__glTexCoord2f(Symbols[i].x, Symbols[i].y); disp__glVertex2f(0, 0);
+ disp__glTexCoord2f(Symbols[i].x+Symbols[i].width, Symbols[i].y); disp__glVertex2f(Symbols[i].width, 0);
+ disp__glTexCoord2f(Symbols[i].x+Symbols[i].width, Symbols[i].y+Symbols[i].height); disp__glVertex2f(Symbols[i].width, Symbols[i].height);
+ disp__glTexCoord2f(Symbols[i].x, Symbols[i].y+Symbols[i].height); disp__glVertex2f(0, Symbols[i].height);
+ disp__glEnd();
+ disp__glTranslatef(Symbols[i].width+sym_space, 0, 0);
+
+ disp__glEndList();
+ if (Symbols[i].height > m_max_height[bmf_curfont]) m_max_height[bmf_curfont] = Symbols[i].height;
+ }
+ return bmf_curfont;
+}
+
+/* Unloads bitmap font by descriptor */
+int glfUnloadBFontD(int bmf_descriptor)
+{
+ if ((bmf_descriptor < 0) || (bmf_in_use[bmf_descriptor] == 0)) return GLF_ERROR;
+
+ bmf_in_use[bmf_descriptor] = 0;
+
+ disp__glDeleteTextures(1, &bmf_texture[bmf_descriptor]);
+ disp__glDeleteTextures(1, &bmf_mask[bmf_descriptor]);
+
+ if (bmf_descriptor == bmf_curfont) bmf_curfont = -1;
+
+ return GLF_OK;
+}
+
+/* Unloads current bitmap font */
+int glfUnloadBFont()
+{
+ return glfUnloadBFontD(bmf_curfont);
+}
+
+
+/* Start bitmap drawing function */
+int glfBeginBFont(int Font_Descriptor)
+{
+ int ret = glfSetCurrentBFont(Font_Descriptor);
+ if(ret!=GLF_OK) return ret;
+
+ /* Enable 2D Texturing */
+ disp__glGetBooleanv(GL_TEXTURE_2D, &bmf_texturing);
+ disp__glEnable(GL_TEXTURE_2D);
+
+ disp__glBindTexture(GL_TEXTURE_2D, bmf_texture[bmf_curfont]);
+
+ return GLF_OK;
+}
+
+/* Stop bitmap drawing function */
+void glfEndBFont()
+{
+ /* Return previuos state of texturing */
+ if (bmf_texturing) disp__glEnable(GL_TEXTURE_2D);
+ else disp__glDisable(GL_TEXTURE_2D);
+}
+
+/* Select current BMF font */
+int glfSetCurrentBFont(int Font_Descriptor)
+{
+ if ((Font_Descriptor < 0) || (bmf_in_use[Font_Descriptor] == 0)) return GLF_ERROR;
+
+ bmf_curfont = Font_Descriptor;
+ return GLF_OK;
+}
+
+/* Get current BMF font */
+int glfGetCurrentBFont()
+{
+ return bmf_curfont;
+}
+
+/* Draw one bitmapped symbol by current font */
+void glfDrawBSymbol(char s)
+{
+ if ((bmf_curfont < 0) || (bmf_in_use[bmf_curfont] == 0)) return;
+
+ disp__glCallList(list_base[bmf_curfont]+(unsigned char)s);
+}
+
+/* Draw bitmapped string */
+void glfDrawBString(const char *s)
+{
+ GLfloat temp_trans;
+ int i;
+
+ temp_trans = 0;
+
+ if ((bmf_curfont < 0) || (bmf_in_use[bmf_curfont] == 0)) return;
+
+ /* Calculate length of all string */
+ for (i=0; i<(int)strlen(s); i++)
+ temp_trans += m_widths[bmf_curfont].width[s[i]] + sym_space;
+
+ disp__glListBase(list_base[bmf_curfont]);
+ if (m_bitmap_string_center == GL_TRUE)
+ {
+ disp__glPushMatrix();
+ disp__glTranslatef(-temp_trans/2, 0, 0);
+ }
+ disp__glCallLists(strlen(s), GL_UNSIGNED_BYTE, (const unsigned char *)s);
+ if (m_bitmap_string_center == GL_TRUE) disp__glPopMatrix();
+}
+
+void glfDrawBMaskSymbol(char s)
+{
+ if ((bmf_curfont < 0) || (bmf_in_use[bmf_curfont] == 0)) return;
+
+ disp__glPushMatrix();
+ disp__glPushAttrib(GL_CURRENT_BIT);
+
+ /* Draw the text as a mask in black */
+ disp__glColor3ub(0xff, 0xff, 0xff);
+ disp__glBlendFunc(GL_DST_COLOR, GL_ZERO);
+ disp__glBindTexture(GL_TEXTURE_2D, bmf_mask[bmf_curfont]);
+
+ disp__glCallList(list_base[bmf_curfont]+(unsigned char)s);
+
+ disp__glPopAttrib();
+ disp__glPopMatrix();
+
+ disp__glBindTexture(GL_TEXTURE_2D, bmf_texture[bmf_curfont]);
+
+ /* Now draw the text over only the black bits in the requested color */
+ disp__glBlendFunc(GL_ONE, GL_ONE);
+
+ disp__glCallList(list_base[bmf_curfont]+(unsigned char)s);
+}
+
+void glfDrawBMaskString(const char *s)
+{
+ GLfloat temp_trans;
+ int i;
+
+ temp_trans = 0;
+
+ if ((bmf_curfont < 0) || (bmf_in_use[bmf_curfont] == 0)) return;
+
+ /* Calculate length of all string */
+ for (i=0; i<(int)strlen(s); i++)
+ temp_trans += m_widths[bmf_curfont].width[s[i]] + sym_space;
+
+ disp__glPushMatrix();
+ disp__glPushAttrib(GL_CURRENT_BIT);
+
+ /* Draw the text as a mask in black */
+ disp__glColor3ub(0xff, 0xff, 0xff);
+ disp__glBlendFunc(GL_DST_COLOR, GL_ZERO);
+ disp__glBindTexture(GL_TEXTURE_2D, bmf_mask[bmf_curfont]);
+
+ disp__glListBase(list_base[bmf_curfont]);
+ if (m_bitmap_string_center == GL_TRUE)
+ {
+ disp__glPushMatrix();
+ disp__glTranslatef(-temp_trans/2, 0, 0);
+ }
+ disp__glCallLists(strlen(s), GL_UNSIGNED_BYTE, (const unsigned char *)s);
+ if (m_bitmap_string_center == GL_TRUE) disp__glPopMatrix();
+
+ disp__glPopAttrib();
+ disp__glPopMatrix();
+
+ disp__glBindTexture(GL_TEXTURE_2D, bmf_texture[bmf_curfont]);
+
+ /* Now draw the text over only the black bits in the requested color */
+ disp__glBlendFunc(GL_ONE, GL_ONE);
+ disp__glListBase(list_base[bmf_curfont]);
+ if (m_bitmap_string_center == GL_TRUE)
+ {
+ disp__glPushMatrix();
+ disp__glTranslatef(-temp_trans/2, 0, 0);
+ }
+ disp__glCallLists(strlen(s), GL_UNSIGNED_BYTE, (const unsigned char *)s);
+ if (m_bitmap_string_center == GL_TRUE) disp__glPopMatrix();
+}
+
+/* Set string centering for bitmap fonts */
+void glfBitmapStringCentering(GLboolean center)
+{
+ m_bitmap_string_center = center;
+}
+
+/* Set string centering for bitmap fonts */
+GLboolean glfBitmapGetStringCentering()
+{
+ return m_bitmap_string_center;
+}
+
+/* Set rotate angle for bitmap fonts */
+void glfSetBRotateAngle(float angle)
+{
+ RotateAngleB = angle;
+}
diff --git a/CNativeCode/glf.h b/CNativeCode/glf.h
new file mode 100755
index 0000000..db98853
--- /dev/null
+++ b/CNativeCode/glf.h
@@ -0,0 +1,160 @@
+/*
+==============================================================================
+| GLF Library
+| Version 1.4
+|
+| Author: Roman Podobedov
+| WEB: http://romka.demonews.com
+| Release Date: 18 May 2001
+|
+| Copyright (C) 2000-2001, Romka Graphics
+| This library is freely distributable without any license or permissions
+| for non-commercial usage. You can use this library in any non-commercial
+| program. In each program, where You use this library You should keep
+| this header (author name and coordinates)!
+| For commercial usage, please contact me: [email protected]
+==============================================================================
+*/
+
+#ifndef GLF_H
+#define GLF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* CONSTANTS */
+
+#define GLF_ERROR -1
+#define GLF_OK 0
+#define GLF_YES 1
+#define GLF_NO 2
+
+#define GLF_CONSOLE_MESSAGES 10
+#define GLF_TEXTURING 11
+#define GLF_CONTOURING 12
+
+#define GLF_LEFT_UP 20
+#define GLF_LEFT_CENTER 21
+#define GLF_LEFT_DOWN 22
+#define GLF_CENTER_UP 23
+#define GLF_CENTER_CENTER 24
+#define GLF_CENTER_DOWN 25
+#define GLF_RIGHT_UP 26
+#define GLF_RIGHT_CENTER 27
+#define GLF_RIGHT_DOWN 28
+#define GLF_CENTER 24
+
+#define GLF_LEFT 1
+#define GLF_RIGHT 2
+#define GLF_UP 3
+#define GLF_DOWN 4
+
+/* Console constants */
+#define GLF_CONSOLE_CURSOR 30
+
+/* Library initialization (must be called before any usage of library) */
+void glfInit();
+/* Library closing (must be called after usage of library) */
+void glfClose();
+
+/* Font loading/unloading functions */
+int glfLoadFont(FILE * fontf); /* Load Vector font to memory, by (FILE *) fontf */
+int glfLoadBFont(FILE * fontf); /* Load Bitmap font to memory, by (FILE
+*) fontf */
+int glfUnloadFont(); /* Unload font from memory */
+int glfUnloadBFont(); /* Unload current BMF font */
+int glfUnloadFontD(int font_descriptor); /* Unload font by font_descriptor */
+int glfUnloadBFontD(int bmf_descriptor); /* Unload BMF font by bmf_descriptor */
+
+/* Text drawing functions */
+/* --------- Vector Fonts ---------------- */
+void glfDrawWiredSymbol(char s); /* Draw wired symbol */
+void glfDrawWiredString(const char *s); /* Draw wired string */
+void glfDrawSolidSymbol(char s); /* Draw solid symbol */
+void glfDrawSolidString(const char *s); /* Draw wired string */
+void glfDraw3DWiredSymbol(char s); /* Draw 3D wired symbol */
+void glfDraw3DWiredString(const char *s); /* Draw 3D wired string */
+void glfDraw3DSolidSymbol(char s); /* Draw 3D solid symbol */
+void glfDraw3DSolidString(const char *s); /* Draw 3D solid string */
+
+/* --------- Bitmap Fonts ---------------- */
+int glfBeginBFont(int Font_Descriptor); /* Must be called before bitmap text drawing */
+void glfEndBFont(); /* Must be called before bitmap text drawing */
+
+void glfDrawBSymbol(char s); /* Draw one symbol by bitmapped font */
+void glfDrawBString(const char *s); /* Draw string by bitmapped font */
+void glfDrawBMaskSymbol(char s); /* Draw one symbol by bitmapped font (using mask) */
+void glfDrawBMaskString(const char *s); /* Draw string by bitmapped font (using mask) */
+
+
+/* Text drawing functions by specified font */
+void glfDrawWiredSymbolF(int font_descriptor, char s);
+void glfDrawWiredStringF(int font_descriptor, const char *s);
+void glfDrawSolidSymbolF(int font_descriptor, char s);
+void glfDrawSolidStringF(int font_descriptor, const char *s);
+void glfDraw3DWiredSymbolF(int font_descriptor, char s);
+void glfDraw3DWiredStringF(int font_descriptor, const char *s);
+void glfDraw3DSolidSymbolF(int font_descriptor, char s);
+void glfDraw3DSolidStringF(int font_descriptor, const char *s);
+
+/* Text control functions */
+void glfGetStringBoundsF(int fd, const char *s, float *minx, float *miny, float *maxx, float *maxy);
+void glfGetStringBounds(const char *s, float *minx, float *miny, float *maxx, float *maxy);
+
+void glfSetSymbolSpace(float sp); /* Set space between symbols */
+float glfGetSymbolSpace(); /* Get space between symbols */
+void glfSetSpaceSize(float sp); /* Set space size */
+float glfGetSpaceSize(); /* Get current space size */
+
+void glfSetSymbolDepth(float dpth); /* Set depth of 3D symbol */
+float glfGetSymbolDepth(); /* Get depth of 3D symbol */
+
+int glfSetCurrentFont(int Font_Descriptor); /* Set current font */
+int glfSetCurrentBFont(int Font_Descriptor); /* Set current bitmap font */
+int glfGetCurrentFont(); /* Get current font descriptor */
+int glfGetCurrentBFont(); /* Get current bitmap font descriptor */
+
+void glfSetAnchorPoint(int anchp); /* Set symbol anchor point */
+void glfSetContourColor(float r, float g, float b, float a); /* Contour color */
+
+/* Enable or Disable GLF features */
+
+void glfEnable(int what); /* Enable GLF feature 'what' */
+void glfDisable(int what); /* Disable GLF feature 'what' */
+
+/* Console functions */
+void glfSetConsoleParam(int width, int height);
+int glfSetConsoleFont(int Font_Descriptor);
+void glfConsoleClear();
+void glfPrint(const char *s, int lenght);
+void glfPrintString(const char *s);
+void glfPrintChar(char s);
+
+void glfConsoleDraw();
+void glfSetCursorBlinkRate(int Rate);
+
+/* -------- Centering and direction ------------ */
+void glfStringCentering(GLboolean center); /* Set string centering for vector fonts */
+GLboolean glfGetStringCentering(); /* Get string centering for vector fonts */
+
+void glfBitmapStringCentering(GLboolean center); /* Set string centering for bitmap fonts */
+GLboolean glfBitmapGetStringCentering(); /* Set string centering for bitmap fonts */
+
+/* String direction for vector font (GLF_LEFT, GLF_RIGHT, GLF_UP, GLF_DOWN) */
+/* GLF_LEFT by default */
+void glfStringDirection(GLuint direction);
+GLuint glfGetStringDirection();
+
+/* -------- Rotating ------------ */
+void glfSetRotateAngle(float angle); /* Set rotate angle for vector fonts */
+void glfSetBRotateAngle(float angle); /* Set rotate angle for bitmap fonts */
+
+
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif
diff --git a/Doxyfile b/Doxyfile
new file mode 100644
index 0000000..4c75fa3
--- /dev/null
+++ b/Doxyfile
@@ -0,0 +1,813 @@
+# Doxyfile 1.2.7
+
+# This file describes the settings to be used by doxygen for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# General configuration options
+#---------------------------------------------------------------------------
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = GL4Java
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 2.7.2.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = doxygens
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Dutch, French, Italian, Czech, Swedish, German, Finnish, Japanese,
+# Korean, Hungarian, Norwegian, Spanish, Romanian, Russian, Croatian,
+# Polish, Portuguese, Brazilian and Slovene.
+
+OUTPUT_LANGUAGE = English
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these class will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. It is allowed to use relative paths in the argument list.
+
+STRIP_FROM_PATH =
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a class diagram (in Html and LaTeX) for classes with base or
+# super classes. Setting the tag to NO turns the diagrams off.
+
+CLASS_DIAGRAMS = YES
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+
+SOURCE_BROWSER = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower case letters. If set to YES upper case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# users are adviced to set this option to NO.
+
+CASE_SENSE_NAMES = YES
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = YES
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like the Qt-style comments (thus requiring an
+# explict @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF = YES
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# reimplements.
+
+INHERIT_DOCS = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 8
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = YES
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consist of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C.
+# For instance some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = NO
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text.
+
+WARN_FORMAT =
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE = doxywarn.log
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = gl4java \
+ gl4java/drawable \
+ gl4java/awt \
+ gl4java/jau/awt \
+ gl4java/jau/awt/macintosh \
+ gl4java/jau/awt/motif \
+ gl4java/jau/awt/windows \
+ gl4java/applet \
+ gl4java/swing gl4java/system \
+ gl4java/utils \
+ gl4java/utils/glut \
+ gl4java/utils/glut/fonts \
+ gl4java/utils/textures \
+ gl4java/utils/glf \
+ CNativeCode \
+ CClassHeaders
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+FILE_PATTERNS = *.c *.h *.java
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories.
+
+EXCLUDE_PATTERNS =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH = demos
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *.java
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+
+INPUT_FILTER =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse.
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set YES to add extra items for group members
+# to the contents of the Html help documentation and to the tree view.
+
+TOC_EXPAND = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript and frames is required (for instance Netscape 4.0+
+# or Internet explorer 4.0+).
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimised for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT =
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using a WORD or other.
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assigments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT =
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_PREDEFINED tags.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed.
+
+PREDEFINED =
+
+# If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED =
+
+#---------------------------------------------------------------------------
+# Configuration::addtions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES tag can be used to specify one or more tagfiles.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = YES
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = YES
+
+# If the ENABLE_PREPROCESSING, INCLUDE_GRAPH, and HAVE_DOT tags are set to
+# YES then doxygen will generate a graph for each documented file showing
+# the direct and indirect include dependencies of the file with other
+# documented files.
+
+INCLUDE_GRAPH = YES
+
+# If the ENABLE_PREPROCESSING, INCLUDED_BY_GRAPH, and HAVE_DOT tags are set to
+# YES then doxygen will generate a graph for each documented header file showing
+# the documented files that directly or indirectly include this file
+
+INCLUDED_BY_GRAPH = YES
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = YES
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found on the path.
+
+DOT_PATH =
+
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_WIDTH = 1024
+
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_HEIGHT = 1024
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermedate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::addtions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
+
+# The CGI_NAME tag should be the name of the CGI script that
+# starts the search engine (doxysearch) with the correct parameters.
+# A script with this name will be generated by doxygen.
+
+CGI_NAME =
+
+# The CGI_URL tag should be the absolute URL to the directory where the
+# cgi binaries are located. See the documentation of your http daemon for
+# details.
+
+CGI_URL =
+
+# The DOC_URL tag should be the absolute URL to the directory where the
+# documentation is located. If left blank the absolute path to the
+# documentation, with file:// prepended to it, will be used.
+
+DOC_URL =
+
+# The DOC_ABSPATH tag should be the absolute path to the directory where the
+# documentation is located. If left blank the directory on the local machine
+# will be used.
+
+DOC_ABSPATH =
+
+# The BIN_ABSPATH tag must point to the directory where the doxysearch binary
+# is installed.
+
+BIN_ABSPATH =
+
+# The EXT_DOC_PATHS tag can be used to specify one or more paths to
+# documentation generated for other projects. This allows doxysearch to search
+# the documentation for these projects as well.
+
+EXT_DOC_PATHS =
diff --git a/demos/GLFDemos/glf3dtext.html b/demos/GLFDemos/glf3dtext.html
new file mode 100644
index 0000000..522300a
--- /dev/null
+++ b/demos/GLFDemos/glf3dtext.html
@@ -0,0 +1,16 @@
+<HTML>
+<HEAD>
+<TITLE>G&ouml;thel Hard- und Software Entwicklungen</TITLE>
+</HEAD>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+<B>Try to drag the mouse (press-button and move) with/without the SHIFT key!</B>
+<br>
+<hr>
+<applet code="glf3dtext.class" width=600 height=400>
+<param name=frames value="55">
+</applet>
+<hr>
+</BODY>
+</HTML>
+
+
diff --git a/demos/GLFDemos/glf3dtext.java b/demos/GLFDemos/glf3dtext.java
new file mode 100755
index 0000000..5c606c7
--- /dev/null
+++ b/demos/GLFDemos/glf3dtext.java
@@ -0,0 +1,366 @@
+
+import gl4java.*;
+import gl4java.drawable.*;
+import gl4java.awt.GLAnimCanvas;
+import gl4java.applet.SimpleGLAnimApplet1;
+import gl4java.utils.textures.*;
+import gl4java.utils.glf.*;
+
+import java.awt.*;
+import java.awt.event.*;
+import java.applet.*;
+import java.net.*;
+
+public class glf3dtext extends SimpleGLAnimApplet1
+{
+ public void init()
+ {
+ super.init();
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+
+ Dimension d = getSize();
+
+ GLCapabilities caps = new GLCapabilities();
+
+ canvas =
+ GLDrawableFactory.getFactory().createGLAnimCanvas(caps, d.width, d.height);
+
+ glf3dtextRenderer renderer = new glf3dtextRenderer();
+ canvas.addGLEventListener(renderer);
+
+ add("Center", canvas);
+ addMouseListener(this);
+ }
+
+ public static void main( String args[] )
+ {
+ Frame mainFrame = new Frame("font test 2");
+
+ glf3dtext applet = new glf3dtext();
+
+ applet.setSize(400, 400);
+ applet.init();
+ applet.start();
+
+ mainFrame.add(applet);
+
+ mainFrame.pack();
+ mainFrame.setVisible(true);
+ }
+
+ class glf3dtextRenderer
+ implements GLEventListener, MouseListener,MouseMotionListener
+ {
+ float []mPosObjTrans;
+ float []mPosObjRot;
+
+ Point mousePoint;
+ Point oldMousePoint;
+ boolean mouseMoveFlag;
+
+ private GLFunc gl;
+ private GLUFunc glu;
+ private GLContext glj;
+
+ protected GLF glf = null;
+
+ int fArial1 = 0;
+ int fArialBMF = 0;
+
+ int fTechno1 = 0;
+ int fTechnoBMF = 0;
+
+ int fTimesNew1 = 0;
+ int fTimesNewBMF = 0;
+
+ public glf3dtextRenderer ()
+ {
+ super();
+ }
+
+ public void init(GLDrawable drawable)
+ {
+ gl = drawable.getGL();
+ glu = drawable.getGLU();
+ glj = drawable.getGLContext();
+
+ glf = new GLF();
+
+ fArial1 = glf.glfLoadFont("arial1.glf");
+ fArialBMF = glf.glfLoadBFont("arial.bmf");
+
+ fTechno1 = glf.glfLoadFont("techno1.glf");
+ fTechnoBMF = glf.glfLoadBFont("techno.bmf");
+
+ fTimesNew1 = glf.glfLoadFont("times_new1.glf");
+ fTimesNewBMF = glf.glfLoadBFont("times_new.bmf");
+
+ // cameraMatrix init
+ mPosObjTrans=new float[16];
+ for(int i=0;i<16;i++)
+ mPosObjTrans[i]=0f;
+ mPosObjTrans[0]=mPosObjTrans[5]=mPosObjTrans[10]=mPosObjTrans[15]=1f;
+
+ mPosObjRot=new float[16];
+ for(int i=0;i<16;i++)
+ mPosObjRot[i]=0f;
+ mPosObjRot[0]=mPosObjRot[5]=mPosObjRot[10]=mPosObjRot[15]=1f;
+
+ TranlateObj(0f,0f,-10f);
+
+ gl.glShadeModel (GL_SMOOTH);
+ gl.glEnable(GL_DEPTH_TEST);
+
+ gl.glClearColor(0.2f, 0.2f, 0.2f, 1.0f);
+ gl.glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ glj.gljCheckGL();
+
+ canvas.addMouseListener(this);
+ canvas.addMouseMotionListener(this);
+ mouseMoveFlag=false;
+ }
+
+ public void cleanup(GLDrawable drawable)
+ {
+ System.out.println("destroy(): " + this);
+ removeMouseListener(this);
+ removeMouseMotionListener(this);
+ }
+
+ public void display(GLDrawable drawable)
+ {
+ int i;
+
+ // just render it
+ gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ SetCamera();
+
+ DrawScene();
+
+ glj.gljCheckGL();
+ }
+
+ public void preDisplay(GLDrawable drawable)
+ {
+ }
+
+ public void postDisplay(GLDrawable drawable)
+ {
+ }
+
+ public void reshape(gl4java.drawable.GLDrawable gld,int width,int height)
+ {
+ gl.glMatrixMode (GL_MODELVIEW);
+ gl.glViewport (0, 0, width, height);
+ gl.glLoadIdentity();
+ SetCamera();
+ }
+
+
+ public void drawGrid(float x0, float y0,
+ float width, float height, float step)
+ {
+ float i,j;
+
+ /* draw grid */
+ gl.glBegin(GL_LINES);
+ for(i=x0;i<width;i+=step)
+ for(j=y0;j<height;j+=step)
+ {
+ if(i==0f && j==0f)
+ gl.glColor3f (1f,0f,0f);
+ else
+ gl.glColor3f (0.6f,0.5f,0.5f);
+ gl.glVertex2f(0f,j);
+ gl.glVertex2f(width,j);
+ gl.glVertex2f(i,height);
+ gl.glVertex2f(i,0f);
+ }
+ gl.glEnd();
+ }
+
+ void DrawScene()
+ {
+ gl.glMatrixMode (GL_MODELVIEW);
+ gl.glLoadIdentity ();
+
+ // kamera setzen
+ gl.glLoadMatrixf(mPosObjTrans);
+ gl.glMultMatrixf(mPosObjRot);
+
+ gl.glPushMatrix();
+ drawGrid(0f, 0f, 10f, 10f, 0.5f);
+ gl.glPopMatrix();
+
+ // obj zeichnen
+ gl.glPushMatrix();
+ gl.glColor3d(0.3,0,0);
+
+ gl.glBegin(GL_POLYGON);
+ gl.glVertex2d(0,-0.5);
+ gl.glVertex2d(0.5,0.5);
+ gl.glVertex2d(-0.5,0.5);
+ gl.glEnd();
+
+ gl.glColor3d(1,1,1);
+ gl.glPopMatrix();
+
+ gl.glPushMatrix();
+ gl.glScalef(0.5f, 0.5f, 0.5f);
+ gl.glTranslatef(-2.2f,-4f,0.5f);
+
+ gl.glTranslatef(0f,2f,0f);
+ glf.glfDraw3DWiredStringF(fArial1, "Arial - GLF 3D Text");
+
+ gl.glTranslatef(0f,2f,0f);
+ glf.glfDraw3DSolidStringF(fArial1, "Arial - GLF 3D Text");
+
+ gl.glTranslatef(0f,2f,0f);
+ glf.glfDraw3DWiredStringF(fTechno1, "Techno - GLF 3D Text");
+
+ gl.glTranslatef(0f,2f,0f);
+ glf.glfDraw3DSolidStringF(fTechno1, "Techno - GLF 3D Text");
+
+ gl.glTranslatef(0f,2f,0f);
+ glf.glfDraw3DWiredStringF(fTimesNew1, "TimesNew - GLF 3D Text");
+
+ gl.glTranslatef(0f,2f,0f);
+ glf.glfDraw3DSolidStringF(fTimesNew1, "TimesNew - GLF 3D Text");
+
+ gl.glTranslatef(0f,2f,0f);
+ glf.glfBeginBFont(fArialBMF);
+ glf.glfDrawBString("Arial BMF - GLF 3D Text");
+ glf.glfEndBFont();
+
+ gl.glTranslatef(0f, 2f, 0f);
+ glf.glfBeginBFont(fTechnoBMF);
+ glf.glfDrawBString("Techno BMF - GLF 3D Text");
+ glf.glfEndBFont();
+
+ gl.glTranslatef(0f, 2f, 0f);
+ glf.glfBeginBFont(fTimesNewBMF);
+ glf.glfDrawBString("TimesNew BMF - GLF 3D Text");
+ glf.glfEndBFont();
+
+ gl.glPopMatrix();
+ }
+
+ void SetCamera()
+ {
+ Dimension dim=getSize();
+ float aspect=(float)dim.width/(float)dim.height;
+
+ gl.glMatrixMode (GL_PROJECTION);
+ gl.glLoadIdentity ();
+ glu.gluPerspective(60f,aspect,.01,100);
+ }
+
+ void RotateObj(float degree,
+ float axisX,
+ float axisY,
+ float axisZ)
+ {
+ gl.glMatrixMode (GL_MODELVIEW);
+ gl.glLoadIdentity ();
+
+ // kamera setzen
+ gl.glRotatef(degree,axisX,axisY,axisZ);
+ gl.glMultMatrixf(mPosObjRot);
+ gl.glGetFloatv(GL_MODELVIEW_MATRIX,mPosObjRot);
+ }
+
+ void TranlateObj(float x,float y,float z)
+ {
+ gl.glMatrixMode (GL_MODELVIEW);
+ gl.glLoadIdentity ();
+
+ // kamera setzen
+ gl.glLoadMatrixf(mPosObjTrans);
+ gl.glTranslatef(x,y,z);
+ gl.glGetFloatv(GL_MODELVIEW_MATRIX,mPosObjTrans);
+ }
+
+ // entfernt rotationen aus aktueller matrix
+ double Billboard()
+ {
+ float[] mat=new float[16];
+
+ gl.glGetFloatv(GL_MODELVIEW_MATRIX,mat);
+ mat[0] = mat[5] = mat[10] = 1;
+ mat[1] = mat[2] = mat[4] = mat[6] = mat[8] = mat[9] = 0;
+ gl.glLoadMatrixf(mat);
+
+ return mat[14];
+ }
+
+ // Methods required for the implementation of MouseListener
+ public void mouseEntered( MouseEvent evt )
+ {
+ }
+
+ public void mouseExited( MouseEvent evt )
+ {
+ }
+
+ public void mousePressed( MouseEvent evt )
+ {
+ if(mouseMoveFlag==false)
+ { // start drag
+ mouseMoveFlag=true;
+ mousePoint=evt.getPoint();
+ }
+ }
+
+ public void mouseReleased( MouseEvent evt )
+ {
+ mouseMoveFlag=false;
+ }
+
+ public void mouseClicked( MouseEvent evt )
+ {
+ Component comp = evt.getComponent();
+ }
+
+ public void mouseDragged(MouseEvent e)
+ {
+ if(mouseMoveFlag==true)
+ {
+ oldMousePoint=new Point(mousePoint);
+ mousePoint=e.getPoint();
+
+ Point dif=new Point(mousePoint.x-oldMousePoint.x,
+ mousePoint.y-oldMousePoint.y);
+
+ if( glj.gljMakeCurrent() == false )
+ {
+ System.out.println("problem in use() method");
+ return;
+ }
+
+ if(e.isShiftDown()==true)
+ TranlateObj((float)dif.x/6.0f,(float)dif.y/-6.0f,0f);
+ else if(e.isAltDown()==true)
+ {
+ TranlateObj(0f,0f,(float)dif.y/6.0f);
+ RotateObj(dif.x,0f,0f,1f);
+ }
+ else
+ {
+ RotateObj(dif.x,0f,1f,0f);
+ RotateObj(dif.y,1f,0f,0f);
+ }
+
+ glj.gljFree();
+
+ repaint();
+
+ }
+ }
+ public void mouseMoved(MouseEvent e)
+ {
+ }
+
+
+ }
+}
diff --git a/demos/GLFDemos/glf3dtext2.html b/demos/GLFDemos/glf3dtext2.html
new file mode 100644
index 0000000..8c1a9b9
--- /dev/null
+++ b/demos/GLFDemos/glf3dtext2.html
@@ -0,0 +1,16 @@
+<HTML>
+<HEAD>
+<TITLE>G&ouml;thel Hard- und Software Entwicklungen</TITLE>
+</HEAD>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+<B>Try to drag the mouse (press-button and move) with/without the SHIFT key!</B>
+<br>
+<hr>
+<applet code="glf3dtext2.class" width=600 height=400>
+<param name=frames value="55">
+</applet>
+<hr>
+</BODY>
+</HTML>
+
+
diff --git a/demos/GLFDemos/glf3dtext2.java b/demos/GLFDemos/glf3dtext2.java
new file mode 100644
index 0000000..9efb0bf
--- /dev/null
+++ b/demos/GLFDemos/glf3dtext2.java
@@ -0,0 +1,378 @@
+
+import gl4java.*;
+import gl4java.drawable.*;
+import gl4java.awt.GLAnimCanvas;
+import gl4java.applet.SimpleGLAnimApplet1;
+import gl4java.utils.textures.*;
+import gl4java.utils.glf.*;
+
+import java.awt.*;
+import java.awt.event.*;
+import java.applet.*;
+import java.net.*;
+
+public class glf3dtext2 extends SimpleGLAnimApplet1
+{
+ public void init()
+ {
+ super.init();
+ GLContext.gljNativeDebug = false;
+ GLContext.gljClassDebug = false;
+
+ Dimension d = getSize();
+
+ GLCapabilities caps = new GLCapabilities();
+
+ canvas =
+ GLDrawableFactory.getFactory().createGLAnimCanvas(caps, d.width, d.height);
+
+ glf3dtextRenderer renderer = new glf3dtextRenderer();
+ canvas.addGLEventListener(renderer);
+
+ add("Center", canvas);
+ addMouseListener(this);
+ }
+
+ public static void main( String args[] )
+ {
+ Frame mainFrame = new Frame("font test 2");
+
+ glf3dtext2 applet = new glf3dtext2();
+
+ applet.setSize(400, 400);
+ applet.init();
+ applet.start();
+
+ mainFrame.add(applet);
+
+ mainFrame.pack();
+ mainFrame.setVisible(true);
+ }
+
+ class glf3dtextRenderer
+ implements GLEventListener, MouseListener,MouseMotionListener
+ {
+ float []mPosObjTrans;
+ float []mPosObjRot;
+
+ Point mousePoint;
+ Point oldMousePoint;
+ boolean mouseMoveFlag;
+
+ private GLFunc gl;
+ private GLUFunc glu;
+ private GLContext glj;
+
+ protected GLF glf = null;
+
+ int fArial1 = 0;
+ int fArialBMF = 0;
+
+ int fTechno1 = 0;
+ int fTechnoBMF = 0;
+
+ int fTimesNew1 = 0;
+ int fTimesNewBMF = 0;
+
+ float angle=0f;
+
+ public glf3dtextRenderer ()
+ {
+ super();
+ }
+
+ public void init(GLDrawable drawable)
+ {
+ gl = drawable.getGL();
+ glu = drawable.getGLU();
+ glj = drawable.getGLContext();
+
+ glf = new GLF();
+
+ glf.glfInit();
+
+ fArial1 = glf.glfLoadFont("arial1.glf");
+ fArialBMF = glf.glfLoadBMFFont("arial.bmf");
+
+ fTechno1 = glf.glfLoadFont("techno1.glf");
+ fTechnoBMF = glf.glfLoadBMFFont("techno.bmf");
+
+ fTimesNew1 = glf.glfLoadFont("times_new1.glf");
+ fTimesNewBMF = glf.glfLoadBMFFont("times_new.bmf");
+
+ // cameraMatrix init
+ mPosObjTrans=new float[16];
+ for(int i=0;i<16;i++)
+ mPosObjTrans[i]=0f;
+ mPosObjTrans[0]=mPosObjTrans[5]=mPosObjTrans[10]=mPosObjTrans[15]=1f;
+
+ mPosObjRot=new float[16];
+ for(int i=0;i<16;i++)
+ mPosObjRot[i]=0f;
+ mPosObjRot[0]=mPosObjRot[5]=mPosObjRot[10]=mPosObjRot[15]=1f;
+
+ TranlateObj(0f,0f,-10f);
+
+ gl.glShadeModel (GL_SMOOTH);
+ gl.glEnable(GL_DEPTH_TEST);
+
+ gl.glClearColor(0.2f, 0.2f, 0.2f, 1.0f);
+ gl.glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ glj.gljCheckGL();
+
+ canvas.addMouseListener(this);
+ canvas.addMouseMotionListener(this);
+ mouseMoveFlag=false;
+ }
+
+ public void cleanup(GLDrawable drawable)
+ {
+ System.out.println("destroy(): " + this);
+ removeMouseListener(this);
+ removeMouseMotionListener(this);
+ glf.glfClose();
+ }
+
+ public void display(GLDrawable drawable)
+ {
+ int i;
+
+ // just render it
+ gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ SetCamera();
+
+ DrawScene();
+
+ glj.gljCheckGL();
+ }
+
+ public void preDisplay(GLDrawable drawable)
+ {
+ }
+
+ public void postDisplay(GLDrawable drawable)
+ {
+ }
+
+ public void reshape(gl4java.drawable.GLDrawable gld,int width,int height)
+ {
+ gl.glMatrixMode (GL_MODELVIEW);
+ gl.glViewport (0, 0, width, height);
+ gl.glLoadIdentity();
+ SetCamera();
+ }
+
+
+ public void drawGrid(float x0, float y0,
+ float width, float height, float step)
+ {
+ float i,j;
+
+ /* draw grid */
+ gl.glBegin(GL_LINES);
+ for(i=x0;i<width;i+=step)
+ for(j=y0;j<height;j+=step)
+ {
+ if(i==0f && j==0f)
+ gl.glColor3f (1f,0f,0f);
+ else
+ gl.glColor3f (0.6f,0.5f,0.5f);
+ gl.glVertex2f(0f,j);
+ gl.glVertex2f(width,j);
+ gl.glVertex2f(i,height);
+ gl.glVertex2f(i,0f);
+ }
+ gl.glEnd();
+ }
+
+ void DrawScene()
+ {
+ gl.glMatrixMode (GL_MODELVIEW);
+ gl.glLoadIdentity ();
+
+ // kamera setzen
+ gl.glLoadMatrixf(mPosObjTrans);
+ gl.glMultMatrixf(mPosObjRot);
+
+ gl.glPushMatrix();
+ drawGrid(0f, 0f, 10f, 10f, 0.5f);
+ gl.glPopMatrix();
+
+ // obj zeichnen
+ gl.glPushMatrix();
+ gl.glColor3d(0.3,0,0);
+
+ gl.glBegin(GL_POLYGON);
+ gl.glVertex2d(0,-0.5);
+ gl.glVertex2d(0.5,0.5);
+ gl.glVertex2d(-0.5,0.5);
+ gl.glEnd();
+
+ gl.glColor3d(1,1,1);
+ gl.glPopMatrix();
+
+ gl.glPushMatrix();
+ gl.glRotatef(angle, 1, 1, 1);
+ angle += 3f;
+ if (angle > 359f) angle = angle - 360f;
+
+ gl.glScalef(0.5f, 0.5f, 0.5f);
+ gl.glTranslatef(-2.2f,-4f,0.5f);
+
+ gl.glTranslatef(0f,2f,0f);
+ glf.glfDraw3DWiredStringF(fArial1, "Arial - GLF 3D Text");
+
+ gl.glTranslatef(0f,2f,0f);
+ glf.glfDraw3DSolidStringF(fArial1, "Arial - GLF 3D Text");
+
+ gl.glTranslatef(0f,2f,0f);
+ glf.glfDraw3DWiredStringF(fTechno1, "Techno - GLF 3D Text");
+
+ gl.glTranslatef(0f,2f,0f);
+ glf.glfDraw3DSolidStringF(fTechno1, "Techno - GLF 3D Text");
+
+ gl.glTranslatef(0f,2f,0f);
+ glf.glfDraw3DWiredStringF(fTimesNew1, "TimesNew - GLF 3D Text");
+
+ gl.glTranslatef(0f,2f,0f);
+ glf.glfDraw3DSolidStringF(fTimesNew1, "TimesNew - GLF 3D Text");
+
+ gl.glTranslatef(0f,2f,0f);
+ glf.glfSetCurrentBMFFont(fArialBMF);
+ glf.glfStartBitmapDrawing();
+ glf.glfDrawBString("Arial BMF - GLF 3D Text");
+ glf.glfStopBitmapDrawing();
+
+ gl.glTranslatef(0f, 2f, 0f);
+ glf.glfSetCurrentBMFFont(fTechnoBMF);
+ glf.glfStartBitmapDrawing();
+ glf.glfDrawBString("Techno BMF - GLF 3D Text");
+ glf.glfStopBitmapDrawing();
+
+ gl.glTranslatef(0f, 2f, 0f);
+ glf.glfSetCurrentBMFFont(fTimesNewBMF);
+ glf.glfStartBitmapDrawing();
+ glf.glfDrawBString("TimesNew BMF - GLF 3D Text");
+ glf.glfStopBitmapDrawing();
+
+ gl.glPopMatrix();
+ }
+
+ void SetCamera()
+ {
+ Dimension dim=getSize();
+ float aspect=(float)dim.width/(float)dim.height;
+
+ gl.glMatrixMode (GL_PROJECTION);
+ gl.glLoadIdentity ();
+ glu.gluPerspective(60f,aspect,.01,100);
+ }
+
+ void RotateObj(float degree,
+ float axisX,
+ float axisY,
+ float axisZ)
+ {
+ gl.glMatrixMode (GL_MODELVIEW);
+ gl.glLoadIdentity ();
+
+ // kamera setzen
+ gl.glRotatef(degree,axisX,axisY,axisZ);
+ gl.glMultMatrixf(mPosObjRot);
+ gl.glGetFloatv(GL_MODELVIEW_MATRIX,mPosObjRot);
+ }
+
+ void TranlateObj(float x,float y,float z)
+ {
+ gl.glMatrixMode (GL_MODELVIEW);
+ gl.glLoadIdentity ();
+
+ // kamera setzen
+ gl.glLoadMatrixf(mPosObjTrans);
+ gl.glTranslatef(x,y,z);
+ gl.glGetFloatv(GL_MODELVIEW_MATRIX,mPosObjTrans);
+ }
+
+ // entfernt rotationen aus aktueller matrix
+ double Billboard()
+ {
+ float[] mat=new float[16];
+
+ gl.glGetFloatv(GL_MODELVIEW_MATRIX,mat);
+ mat[0] = mat[5] = mat[10] = 1;
+ mat[1] = mat[2] = mat[4] = mat[6] = mat[8] = mat[9] = 0;
+ gl.glLoadMatrixf(mat);
+
+ return mat[14];
+ }
+
+ // Methods required for the implementation of MouseListener
+ public void mouseEntered( MouseEvent evt )
+ {
+ }
+
+ public void mouseExited( MouseEvent evt )
+ {
+ }
+
+ public void mousePressed( MouseEvent evt )
+ {
+ if(mouseMoveFlag==false)
+ { // start drag
+ mouseMoveFlag=true;
+ mousePoint=evt.getPoint();
+ }
+ }
+
+ public void mouseReleased( MouseEvent evt )
+ {
+ mouseMoveFlag=false;
+ }
+
+ public void mouseClicked( MouseEvent evt )
+ {
+ Component comp = evt.getComponent();
+ }
+
+ public void mouseDragged(MouseEvent e)
+ {
+ if(mouseMoveFlag==true)
+ {
+ oldMousePoint=new Point(mousePoint);
+ mousePoint=e.getPoint();
+
+ Point dif=new Point(mousePoint.x-oldMousePoint.x,
+ mousePoint.y-oldMousePoint.y);
+
+ if( glj.gljMakeCurrent() == false )
+ {
+ System.out.println("problem in use() method");
+ return;
+ }
+
+ if(e.isShiftDown()==true)
+ TranlateObj((float)dif.x/6.0f,(float)dif.y/-6.0f,0f);
+ else if(e.isAltDown()==true)
+ {
+ TranlateObj(0f,0f,(float)dif.y/6.0f);
+ RotateObj(dif.x,0f,0f,1f);
+ }
+ else
+ {
+ RotateObj(dif.x,0f,1f,0f);
+ RotateObj(dif.y,1f,0f,0f);
+ }
+
+ glj.gljFree();
+
+ repaint();
+
+ }
+ }
+ public void mouseMoved(MouseEvent e)
+ {
+ }
+
+
+ }
+}
diff --git a/demos/GLFDemos/glf3dtext2_plugin13.html b/demos/GLFDemos/glf3dtext2_plugin13.html
new file mode 100644
index 0000000..fd19db1
--- /dev/null
+++ b/demos/GLFDemos/glf3dtext2_plugin13.html
@@ -0,0 +1,48 @@
+<HTML>
+<HEAD>
+<TITLE>G&ouml;thel Hard- und Software Entwicklungen</TITLE>
+</HEAD>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+<B>Try to drag the mouse (press-button and move) with/without the SHIFT key!</B>
+<br>
+<hr>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 -->
+<SCRIPT LANGUAGE="JavaScript"><!--
+ var _info = navigator.userAgent; var _ns = false;
+ var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0);
+//--></SCRIPT>
+<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!--
+ var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0)));
+//--></SCRIPT></COMMENT>
+
+<SCRIPT LANGUAGE="JavaScript"><!--
+ if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 600 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>');
+ else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "glf3dtext2.class" WIDTH = 600 HEIGHT = 400 frames = "55" scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>');
+//--></SCRIPT>
+<APPLET CODE = "glf3dtext2.class" WIDTH = 600 HEIGHT = 400></XMP>
+<PARAM NAME = CODE VALUE = "glf3dtext2.class" >
+
+<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
+<PARAM NAME="scriptable" VALUE="false">
+<PARAM NAME = frames VALUE ="55">
+
+</APPLET>
+
+</NOEMBED></EMBED></OBJECT>
+
+
+<!--
+<APPLET CODE = "glf3dtext2.class" WIDTH = 600 HEIGHT = 400>
+<PARAM NAME = frames VALUE ="55">
+
+
+</APPLET>
+-->
+<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</BODY>
+</HTML>
+
+
diff --git a/demos/GLFDemos/glf3dtext_plugin13.html b/demos/GLFDemos/glf3dtext_plugin13.html
new file mode 100644
index 0000000..67d233c
--- /dev/null
+++ b/demos/GLFDemos/glf3dtext_plugin13.html
@@ -0,0 +1,48 @@
+<HTML>
+<HEAD>
+<TITLE>G&ouml;thel Hard- und Software Entwicklungen</TITLE>
+</HEAD>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+<B>Try to drag the mouse (press-button and move) with/without the SHIFT key!</B>
+<br>
+<hr>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 -->
+<SCRIPT LANGUAGE="JavaScript"><!--
+ var _info = navigator.userAgent; var _ns = false;
+ var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0);
+//--></SCRIPT>
+<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!--
+ var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0)));
+//--></SCRIPT></COMMENT>
+
+<SCRIPT LANGUAGE="JavaScript"><!--
+ if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 600 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>');
+ else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "glf3dtext.class" WIDTH = 600 HEIGHT = 400 frames = "55" scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>');
+//--></SCRIPT>
+<APPLET CODE = "glf3dtext.class" WIDTH = 600 HEIGHT = 400></XMP>
+<PARAM NAME = CODE VALUE = "glf3dtext.class" >
+
+<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
+<PARAM NAME="scriptable" VALUE="false">
+<PARAM NAME = frames VALUE ="55">
+
+</APPLET>
+
+</NOEMBED></EMBED></OBJECT>
+
+
+<!--
+<APPLET CODE = "glf3dtext.class" WIDTH = 600 HEIGHT = 400>
+<PARAM NAME = frames VALUE ="55">
+
+
+</APPLET>
+-->
+<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</BODY>
+</HTML>
+
+
diff --git a/demos/GLFDemos/index.html b/demos/GLFDemos/index.html
new file mode 100644
index 0000000..3b014e2
--- /dev/null
+++ b/demos/GLFDemos/index.html
@@ -0,0 +1,24 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="Author" content="Ron Cemer & Sven Goethel">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Misc Demos</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+<p>Here are the GLF-Demos for <B> GL4Java >= 2.7.2.0: </B> <br>
+<br>
+<p><a href="index_plugin13.html">To use the Java2 Plug-In (Java2, JRE, Plug-In 1.3), click here !</a><br>
+<br>
+<B>Try to use the right-mouse-button for a pop-up menu within the demos !</B>
+<br>
+<p>&nbsp;<a href="glf3dtext.html">GLF Font Demo 1</a>
+: GLF Font Demo 1 (GLF DEMO)
+<p>&nbsp;<a href="glf3dtext2.html">GLF Font Demo 2</a>
+: GLF Font Demo 2 with rotation (GLF DEMO)
+<br>&nbsp;
+<br>
+<br>
+</body>
+</html>
diff --git a/demos/GLFDemos/index_plugin13.html b/demos/GLFDemos/index_plugin13.html
new file mode 100644
index 0000000..deb60a6
--- /dev/null
+++ b/demos/GLFDemos/index_plugin13.html
@@ -0,0 +1,26 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="Author" content="Ron Cemer & Sven Goethel">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>Misc Demos</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+<p>Here are the GLF Demos for <B> GL4Java >= 2.7.2.0: & Java2 Plug-In 1.3</B>
+<hr
+<br>&nbsp;
+<a href="../../Installer/java.policy">The Java2 (sdk, jre, plugin 1.3) policy file example to give GL4Java the necessary permissions (Click here) !</a>
+<br>&nbsp;
+<hr>
+<B>Try to use the right-mouse-button for a pop-up menu within the demos !</B>
+<br>
+<p>&nbsp;<a href="glf3dtext_plugin13.html">GLF Font Demo 1</a>
+: GLF Font Demo 1 (GLF DEMO)
+<p>&nbsp;<a href="glf3dtext2_plugin13.html">GLF Font Demo 2</a>
+: GLF Font Demo 2 with rotation (GLF DEMO)
+<br>&nbsp;
+<br>
+<br>
+</body>
+</html>
diff --git a/demos/MiscDemos/GearsVS.html b/demos/MiscDemos/GearsVS.html
new file mode 100644
index 0000000..2f80c74
--- /dev/null
+++ b/demos/MiscDemos/GearsVS.html
@@ -0,0 +1,13 @@
+<HTML>
+<HEAD>
+<TITLE>G&ouml;thel Hard- und Software Entwicklungen</TITLE>
+</HEAD>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+<hr>
+<applet code="GearsVS.class" width=550 height=400>
+<param name=frames value="55">
+</applet>
+<hr>
+</BODY>
+</HTML>
+
diff --git a/demos/MiscDemos/GearsVS.java b/demos/MiscDemos/GearsVS.java
new file mode 100644
index 0000000..c4a76f2
--- /dev/null
+++ b/demos/MiscDemos/GearsVS.java
@@ -0,0 +1,501 @@
+/**
+ * @(#) gears.java
+ * @(#) author: Brian Paul (converted to Java by Ron Cemer)
+ *
+ * This is a modification of the standard gears demo so that it
+ * uses the Virutal Sphere for converting mouse input to 3D
+ * rotation. --- Joe Huwaldt, Feburary 20, 2001
+ *
+ */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.*;
+import java.util.*;
+import java.io.*;
+import java.util.*;
+import gl4java.*;
+import gl4java.drawable.*;
+import gl4java.awt.GLAnimCanvas;
+import gl4java.applet.SimpleGLAnimApplet1;
+import jahuwaldt.gl.*;
+
+
+/**
+* A version of the standard "gears" OpenGL demo
+* modified to use the Virtual Sphere algorithm for
+* converting 2D mouse movement into 3D model rotation.
+**/
+public class GearsVS extends SimpleGLAnimApplet1 {
+
+ /* Initialize the applet */
+
+
+ public void init() {
+ super.init();
+ Dimension d = getSize();
+
+ GLCapabilities caps = new GLCapabilities();
+ //caps.setDoubleBuffered(false);
+
+ canvas =
+ GLDrawableFactory.getFactory().createGLAnimCanvas(caps, d.width, d.height);
+
+ GearsVSRenderer gear = new GearsVSRenderer(true);
+ canvas.addGLEventListener(gear);
+
+ add("Center", canvas);
+ }
+
+ public static void main( String args[] ) {
+ GLContext.gljNativeDebug = true;
+ GLContext.gljClassDebug = true;
+
+ Frame mainFrame = new Frame("Gears with Virtual Sphere");
+
+ mainFrame.addWindowListener( new WindowAdapter() {
+ public void windowClosed(WindowEvent e) {
+ System.exit(0);
+ }
+ public void windowClosing(WindowEvent e) {
+ System.exit(0);
+ }
+ } );
+
+ Applet applet = new GearsVS();
+ mainFrame.add(applet);
+ applet.setSize(400, 500);
+ applet.init();
+ applet.start();
+
+ Dimension ps = applet.getPreferredSize();
+ mainFrame.setBounds(-100,-100,99,99);
+ mainFrame.setVisible(true);
+ mainFrame.setVisible(false);
+ mainFrame.setVisible(true);
+ Insets is = mainFrame.getInsets();
+ mainFrame.setBounds(0,0,
+ ps.width+is.left+is.right,
+ ps.height+is.top+is.bottom);
+ mainFrame.setVisible(true);
+ }
+
+ private class GearsVSRenderer implements GLEventListener, MouseListener, MouseMotionListener {
+ private static final float M_PI = 3.14159265359f;
+ private int gear1, gear2, gear3;
+ private float angle = 0.0f;
+
+ private boolean showGL = false;
+
+ private Point prevMouse;
+ private boolean mouseRButtonDown = false;
+ private float rot_matrix[] = Matrix.identity();
+
+ // Class variables required to implement the virtual sphere.
+ private VirtualSphere vs = new VirtualSphere();
+ private Point cueCenter = new Point();
+ private int cueRadius;
+ private boolean mouseDown = false;
+
+ private GLFunc gl;
+ private GLUFunc glu;
+ private GLContext glj;
+
+ Graphics gc = null;
+
+ public GearsVSRenderer(boolean showGL)
+ {
+ this.showGL=showGL;
+ }
+
+ public void init(GLDrawable drawable) {
+ gl = drawable.getGL();
+ glu = drawable.getGLU();
+ glj = drawable.getGLContext();
+
+ GLAnimCanvas cvs = (GLAnimCanvas)drawable;
+
+ Dimension size = cvs.getSize();
+ setupVS(size.width, size.height);
+
+ setInitialRotation();
+
+ float pos[] = { 5.0f, 5.0f, 10.0f, 0.0f };
+ float red[] = { 0.8f, 0.1f, 0.0f, 1.0f };
+ float green[] = { 0.0f, 0.8f, 0.2f, 1.0f };
+ float blue[] = { 0.2f, 0.2f, 1.0f, 1.0f };
+
+ gl.glClearColor(0f, 0f, 0f, 0f);
+
+ gl.glLightfv(GL_LIGHT0, GL_POSITION, pos);
+ gl.glEnable(GL_CULL_FACE);
+ gl.glEnable(GL_LIGHTING);
+ gl.glEnable(GL_LIGHT0);
+ gl.glEnable(GL_DEPTH_TEST);
+
+ /* make the gears */
+ gear1 = gl.glGenLists(1);
+ gl.glNewList(gear1, GL_COMPILE);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red);
+ gear(1.0f, 4.0f, 1.0f, 20, 0.7f);
+ gl.glEndList();
+
+ gear2 = gl.glGenLists(1);
+ gl.glNewList(gear2, GL_COMPILE);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green);
+ gear(0.5f, 2.0f, 2.0f, 10, 0.7f);
+ gl.glEndList();
+
+ gear3 = gl.glGenLists(1);
+ gl.glNewList(gear3, GL_COMPILE);
+ gl.glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue);
+ gear(1.3f, 2.0f, 0.5f, 10, 0.7f);
+ gl.glEndList();
+
+ gl.glEnable(GL_NORMALIZE);
+
+ glj.gljCheckGL();
+
+ drawable.addMouseListener(this);
+ drawable.addMouseMotionListener(this);
+
+ System.out.println("init ..");
+ }
+
+ public void cleanup(GLDrawable drawable)
+ {
+ System.out.println("destroy(): " + this);
+ drawable.removeMouseListener(this);
+ drawable.removeMouseMotionListener(this);
+ }
+
+ public void reshape(gl4java.drawable.GLDrawable gld, int width, int height) {
+ float h = (float)height / (float)width;
+
+ gl.glViewport(0,0,width,height);
+ gl.glMatrixMode(GL_PROJECTION);
+ gl.glLoadIdentity();
+ gl.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
+ gl.glMatrixMode(GL_MODELVIEW);
+ gl.glLoadIdentity();
+ gl.glTranslatef(0.0f, 0.0f, -40.0f);
+
+ // Resize the virtual sphere too!
+ setupVS(width, height);
+ }
+
+ public void preDisplay(GLDrawable drawable)
+ {
+ }
+
+ public void display(GLDrawable drawable)
+ {
+
+ if(showGL)
+ {
+ showGL=false;
+ System.out.println("GL VERSION : "+gl.glGetString(GL_VERSION));
+ System.out.println("GL RENDERER: "+gl.glGetString(GL_RENDERER));
+ System.out.println("GL VENDOR : "+gl.glGetString(GL_VENDOR));
+ }
+
+ angle += 0.5f;
+
+ gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ gl.glPushMatrix();
+ gl.glMultMatrixf(rot_matrix);
+
+ gl.glPushMatrix();
+ gl.glTranslatef(-3.0f, -2.0f, 0.0f);
+ gl.glRotatef(angle, 0.0f, 0.0f, 1.0f);
+ gl.glCallList(gear1);
+ gl.glPopMatrix();
+
+ gl.glPushMatrix();
+ gl.glTranslatef(3.1f, -2.0f, 0.0f);
+ gl.glRotatef(-2.0f * angle - 9.0f, 0.0f, 0.0f, 1.0f);
+ gl.glCallList(gear2);
+ gl.glPopMatrix();
+
+ gl.glPushMatrix();
+ gl.glTranslatef(-3.1f, 4.2f, 0.0f);
+ gl.glRotatef(-2.0f * angle - 25.0f, 0.0f, 0.0f, 1.0f);
+ gl.glCallList(gear3);
+ gl.glPopMatrix();
+
+ gl.glPopMatrix();
+
+ }
+
+ public void postDisplay(GLDrawable drawable)
+ {
+ // If the mouse is down, draw the virtual sphere 2D representation.
+ if (mouseDown)
+ drawVS(drawable);
+ }
+ /**
+ * Set up the virtual sphere cue center and radius.
+ **/
+ private void setupVS(int w, int h) {
+ cueCenter.x = w/2;
+ cueCenter.y = h/2;
+
+ cueRadius = Math.min(w-20, h-20)/2;
+ }
+
+ /**
+ * Render a 2D representation of the virtual sphere
+ * to give the user some visual feedback.
+ **/
+ private void drawVS(GLDrawable drawable) {
+ GLAnimCanvas cvs = (GLAnimCanvas)drawable;
+
+ if(gc==null)
+ gc = cvs.getGraphics();
+ Color saveColor = gc.getColor();
+ gc.setColor(Color.gray);
+
+ vs.draw(gc, prevMouse, cueCenter, cueRadius);
+
+ gc.setColor(saveColor);
+ }
+
+ private void gear
+ (float inner_radius,
+ float outer_radius,
+ float width,
+ int teeth,
+ float tooth_depth)
+ {
+ int i;
+ float r0, r1, r2;
+ float angle, da;
+ float u, v, len;
+
+ r0 = inner_radius;
+ r1 = outer_radius - tooth_depth / 2.0f;
+ r2 = outer_radius + tooth_depth / 2.0f;
+
+ da = 2.0f * M_PI / teeth / 4.0f;
+
+ gl.glShadeModel(GL_FLAT);
+
+ gl.glNormal3f(0.0f, 0.0f, 1.0f);
+
+ /* draw front face */
+ gl.glBegin(GL_QUAD_STRIP);
+ for (i = 0; i <= teeth; i++)
+ {
+ angle = i * 2.0f * M_PI / teeth;
+ gl.glVertex3f(r0 * (float)Math.cos(angle), r0 * (float)Math.sin(angle), width * 0.5f);
+ gl.glVertex3f(r1 * (float)Math.cos(angle), r1 * (float)Math.sin(angle), width * 0.5f);
+ gl.glVertex3f(r0 * (float)Math.cos(angle), r0 * (float)Math.sin(angle), width * 0.5f);
+ gl.glVertex3f(r1 * (float)Math.cos(angle + 3.0f * da), r1 * (float)Math.sin(angle + 3.0f * da), width * 0.5f);
+ }
+ gl.glEnd();
+
+ /* draw front sides of teeth */
+ gl.glBegin(GL_QUADS);
+ da = 2.0f * M_PI / teeth / 4.0f;
+ for (i = 0; i < teeth; i++)
+ {
+ angle = i * 2.0f * M_PI / teeth;
+ gl.glVertex3f(r1 * (float)Math.cos(angle), r1 * (float)Math.sin(angle), width * 0.5f);
+ gl.glVertex3f(r2 * (float)Math.cos(angle + da), r2 * (float)Math.sin(angle + da), width * 0.5f);
+ gl.glVertex3f(r2 * (float)Math.cos(angle + 2.0f * da), r2 * (float)Math.sin(angle + 2.0f * da), width * 0.5f);
+ gl.glVertex3f(r1 * (float)Math.cos(angle + 3.0f * da), r1 * (float)Math.sin(angle + 3.0f * da), width * 0.5f);
+ }
+ gl.glEnd();
+
+ gl.glNormal3f(0.0f, 0.0f, -1.0f);
+
+ /* draw back face */
+ gl.glBegin(GL_QUAD_STRIP);
+ for (i = 0; i <= teeth; i++)
+ {
+ angle = i * 2.0f * M_PI / teeth;
+ gl.glVertex3f(r1 * (float)Math.cos(angle), r1 * (float)Math.sin(angle), -width * 0.5f);
+ gl.glVertex3f(r0 * (float)Math.cos(angle), r0 * (float)Math.sin(angle), -width * 0.5f);
+ gl.glVertex3f(r1 * (float)Math.cos(angle + 3 * da), r1 * (float)Math.sin(angle + 3 * da), -width * 0.5f);
+ gl.glVertex3f(r0 * (float)Math.cos(angle), r0 * (float)Math.sin(angle), -width * 0.5f);
+ }
+ gl.glEnd();
+
+ /* draw back sides of teeth */
+ gl.glBegin(GL_QUADS);
+ da = 2.0f * M_PI / teeth / 4.0f;
+ for (i = 0; i < teeth; i++)
+ {
+ angle = i * 2.0f * M_PI / teeth;
+ gl.glVertex3f(r1 * (float)Math.cos(angle + 3 * da), r1 * (float)Math.sin(angle + 3 * da), -width * 0.5f);
+ gl.glVertex3f(r2 * (float)Math.cos(angle + 2 * da), r2 * (float)Math.sin(angle + 2 * da), -width * 0.5f);
+ gl.glVertex3f(r2 * (float)Math.cos(angle + da), r2 * (float)Math.sin(angle + da), -width * 0.5f);
+ gl.glVertex3f(r1 * (float)Math.cos(angle), r1 * (float)Math.sin(angle), -width * 0.5f);
+ }
+ gl.glEnd();
+
+ /* draw outward faces of teeth */
+ gl.glBegin(GL_QUAD_STRIP);
+ for (i = 0; i < teeth; i++)
+ {
+ angle = i * 2.0f * M_PI / teeth;
+ gl.glVertex3f(r1 * (float)Math.cos(angle), r1 * (float)Math.sin(angle), width * 0.5f);
+ gl.glVertex3f(r1 * (float)Math.cos(angle), r1 * (float)Math.sin(angle), -width * 0.5f);
+ u = r2 * (float)Math.cos(angle + da) - r1 * (float)Math.cos(angle);
+ v = r2 * (float)Math.sin(angle + da) - r1 * (float)Math.sin(angle);
+ len = (float)Math.sqrt(u * u + v * v);
+ u /= len;
+ v /= len;
+ gl.glNormal3f(v, -u, 0.0f);
+ gl.glVertex3f(r2 * (float)Math.cos(angle + da), r2 * (float)Math.sin(angle + da), width * 0.5f);
+ gl.glVertex3f(r2 * (float)Math.cos(angle + da), r2 * (float)Math.sin(angle + da), -width * 0.5f);
+ gl.glNormal3f((float)Math.cos(angle), (float)Math.sin(angle), 0.0f);
+ gl.glVertex3f(r2 * (float)Math.cos(angle + 2 * da), r2 * (float)Math.sin(angle + 2 * da), width * 0.5f);
+ gl.glVertex3f(r2 * (float)Math.cos(angle + 2 * da), r2 * (float)Math.sin(angle + 2 * da), -width * 0.5f);
+ u = r1 * (float)Math.cos(angle + 3 * da) - r2 * (float)Math.cos(angle + 2 * da);
+ v = r1 * (float)Math.sin(angle + 3 * da) - r2 * (float)Math.sin(angle + 2 * da);
+ gl.glNormal3f(v, -u, 0.0f);
+ gl.glVertex3f(r1 * (float)Math.cos(angle + 3 * da), r1 * (float)Math.sin(angle + 3 * da), width * 0.5f);
+ gl.glVertex3f(r1 * (float)Math.cos(angle + 3 * da), r1 * (float)Math.sin(angle + 3 * da), -width * 0.5f);
+ gl.glNormal3f((float)Math.cos(angle), (float)Math.sin(angle), 0.0f);
+ }
+ gl.glVertex3f(r1 * (float)Math.cos(0), r1 * (float)Math.sin(0), width * 0.5f);
+ gl.glVertex3f(r1 * (float)Math.cos(0), r1 * (float)Math.sin(0), -width * 0.5f);
+ gl.glEnd();
+
+ gl.glShadeModel(GL_SMOOTH);
+
+ /* draw inside radius cylinder */
+ gl.glBegin(GL_QUAD_STRIP);
+ for (i = 0; i <= teeth; i++)
+ {
+ angle = i * 2.0f * M_PI / teeth;
+ gl.glNormal3f(-(float)Math.cos(angle), -(float)Math.sin(angle), 0.0f);
+ gl.glVertex3f(r0 * (float)Math.cos(angle), r0 * (float)Math.sin(angle), -width * 0.5f);
+ gl.glVertex3f(r0 * (float)Math.cos(angle), r0 * (float)Math.sin(angle), width * 0.5f);
+ }
+ gl.glEnd();
+ }
+
+ // Reset the rotation matrix to the default view.
+ private void setInitialRotation() {
+
+ Matrix.rotateY(Matrix.deg2Rad(30), rot_matrix);
+ Matrix.rotateX(Matrix.deg2Rad(20), rot_matrix);
+ fixRotationMatrix();
+ }
+
+ private void fixRotationMatrix()
+ {
+ // Fix any problems with the rotation matrix.
+ rot_matrix[3] =
+ rot_matrix[7] =
+ rot_matrix[11] =
+ rot_matrix[12] =
+ rot_matrix[13] =
+ rot_matrix[14] = 0.0f;
+ rot_matrix[15] = 1.0f;
+ float fac;
+ if ((fac = (float)Math.sqrt
+ ((rot_matrix[0]*rot_matrix[0]) +
+ (rot_matrix[4]*rot_matrix[4]) +
+ (rot_matrix[8]*rot_matrix[8]))) != 1.0f)
+ {
+ if (fac != 0.0f)
+ {
+ fac = 1.0f/fac;
+ rot_matrix[0] *= fac;
+ rot_matrix[4] *= fac;
+ rot_matrix[8] *= fac;
+ }
+ }
+ if ((fac = (float)Math.sqrt
+ ((rot_matrix[1]*rot_matrix[1]) +
+ (rot_matrix[5]*rot_matrix[5]) +
+ (rot_matrix[9]*rot_matrix[9]))) != 1.0f)
+ {
+ if (fac != 0.0f)
+ {
+ fac = 1.0f/fac;
+ rot_matrix[1] *= fac;
+ rot_matrix[5] *= fac;
+ rot_matrix[9] *= fac;
+ }
+ }
+ if ((fac = (float)Math.sqrt
+ ((rot_matrix[2]*rot_matrix[2]) +
+ (rot_matrix[6]*rot_matrix[6]) +
+ (rot_matrix[10]*rot_matrix[10]))) != 1.0f)
+ {
+ if (fac != 0.0f)
+ {
+ fac = 1.0f/fac;
+ rot_matrix[2] *= fac;
+ rot_matrix[6] *= fac;
+ rot_matrix[10] *= fac;
+ }
+ }
+ }
+
+ // Methods required for the implementation of MouseListener
+ public void mouseEntered( MouseEvent evt )
+ {
+ }
+
+ public void mouseExited( MouseEvent evt )
+ {
+ }
+
+ public void mousePressed( MouseEvent evt ) {
+
+ mouseDown = true;
+ prevMouse = evt.getPoint();
+ if ((evt.getModifiers() & evt.BUTTON3_MASK) != 0) {
+ mouseRButtonDown = true;
+ evt.consume();
+ }
+ }
+
+ public void mouseReleased( MouseEvent evt ) {
+
+ mouseDown = false;
+ if ((evt.getModifiers() & evt.BUTTON3_MASK) != 0) {
+ mouseRButtonDown = false;
+ evt.consume();
+ }
+ }
+
+ public void mouseClicked( MouseEvent evt )
+ {
+ }
+
+ // Methods required for the implementation of MouseMotionListener
+ float[] mouseMtx = new float[16]; // The rot-matrix calculated by the virtual sphere.
+ public void mouseDragged( MouseEvent evt )
+ {
+ Point newMouse = evt.getPoint();
+
+ if (newMouse.x != prevMouse.x || newMouse.y != prevMouse.y) {
+
+ // Use virtual sphere to determine an incremental rotation matrix.
+ vs.makeRotationMtx(prevMouse, newMouse, cueCenter, cueRadius, mouseMtx);
+
+ // Multiply overall rotation matrix by incremental rot-matrix to get new rotation.
+ rot_matrix = Matrix.multiply(rot_matrix, mouseMtx);
+ fixRotationMatrix();
+
+ prevMouse = newMouse;
+ }
+
+ evt.consume();
+
+ }
+
+ public void mouseMoved( MouseEvent evt )
+ {
+ }
+ }
+}
+
diff --git a/demos/MiscDemos/GearsVS_plugin13.html b/demos/MiscDemos/GearsVS_plugin13.html
new file mode 100644
index 0000000..7cbc068
--- /dev/null
+++ b/demos/MiscDemos/GearsVS_plugin13.html
@@ -0,0 +1,45 @@
+<HTML>
+<HEAD>
+<TITLE>G&ouml;thel Hard- und Software Entwicklungen</TITLE>
+</HEAD>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+<hr>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 -->
+<SCRIPT LANGUAGE="JavaScript"><!--
+ var _info = navigator.userAgent; var _ns = false;
+ var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0);
+//--></SCRIPT>
+<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!--
+ var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0)));
+//--></SCRIPT></COMMENT>
+
+<SCRIPT LANGUAGE="JavaScript"><!--
+ if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 550 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>');
+ else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "GearsVS.class" WIDTH = 550 HEIGHT = 400 frames = "55" scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>');
+//--></SCRIPT>
+<APPLET CODE = "GearsVS.class" WIDTH = 550 HEIGHT = 400></XMP>
+<PARAM NAME = CODE VALUE = "GearsVS.class" >
+
+<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
+<PARAM NAME="scriptable" VALUE="false">
+<PARAM NAME = frames VALUE ="55">
+
+</APPLET>
+
+</NOEMBED></EMBED></OBJECT>
+
+
+<!--
+<APPLET CODE = "GearsVS.class" WIDTH = 550 HEIGHT = 400>
+<PARAM NAME = frames VALUE ="55">
+
+
+</APPLET>
+-->
+<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</BODY>
+</HTML>
+
diff --git a/demos/MiscDemos/jahuwaldt/gl/GLTools.java b/demos/MiscDemos/jahuwaldt/gl/GLTools.java
new file mode 100644
index 0000000..1c28540
--- /dev/null
+++ b/demos/MiscDemos/jahuwaldt/gl/GLTools.java
@@ -0,0 +1,494 @@
+/*
+* GLTools -- A collection of static methods for working with 3D graphics.
+*
+* Copyright (C) 2001 by Joseph A. Huwaldt <[email protected]>.
+* All rights reserved.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Library General Public
+* License as published by the Free Software Foundation; either
+* version 2 of the License, or (at your option) any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Library General Public License for more details.
+**/
+
+package jahuwaldt.gl;
+
+
+/**
+* A set of static utility methods for working with 3D graphics.
+* In particular, these methods are geared for working efficiently
+* with GL4Java and OpenGL.
+*
+* <p> Modified by: Joseph A. Huwaldt </p>
+*
+* @author Joseph A. Huwaldt Date: January 13, 2001
+* @version February 19, 2001
+**/
+public class GLTools {
+
+ // Some constants for convenience.
+ private static final int X = 0;
+ private static final int Y = 1;
+ private static final int Z = 2;
+
+ // Some error messages.
+ private static final String kVector3DMsg = "Vectors must be 3D (3 elements).";
+ private static final String kPoint3DMsg = "Points must be 3D (3 elements).";
+ private static final String kNormal3DMsg = "Normal vector must be 3D (3 elements).";
+
+
+ /**
+ * This method will normalize a 3D vector to have
+ * a length of 1.0. The unit vector is placed in the
+ * specified output vector (which may safely be a reference
+ * to the input vector).
+ *
+ * @param vector The 3D (3 element) vector to be normalized.
+ * @param output The 3D (3 element) vector that will contain
+ * the normalized version of the input vector.
+ * @return A reference to the output normalized vector.
+ **/
+ public static final float[] normalize(float vector[], float[] output) {
+ if (vector.length != 3 || output.length != 3)
+ throw new IllegalArgumentException(kVector3DMsg);
+
+ float v0 = vector[X], v1 = vector[Y], v2 = vector[Z];
+ float length = (float)Math.sqrt( v0*v0 + v1*v1 + v2*v2 );
+
+ // Do not allow a divide by zero.
+ if (length == 0)
+ length = 1;
+
+ // Divide each element by the length to get a unit vector.
+ output[X] = v0/length;
+ output[Y] = v1/length;
+ output[Z] = v2/length;
+
+ return output;
+ }
+
+ /**
+ * This method will normalize a 3D vector to have
+ * a length of 1.0. A new vector is created that is the normalized
+ * version of the input vector.
+ *
+ * @param vector The 3D (3 element) vector to be normalized.
+ * @return A reference to the new output normalized vector.
+ **/
+ public static final float[] normalize(float vector[]) {
+ if (vector.length != 3)
+ throw new IllegalArgumentException(kVector3DMsg);
+
+ float v0 = vector[X], v1 = vector[Y], v2 = vector[Z];
+ float length = (float)Math.sqrt( v0*v0 + v1*v1 + v2*v2 );
+
+ // Do not allow a divide by zero.
+ if (length == 0)
+ length = 1;
+
+ // Divide each element by the length to get a unit vector.
+ float[] output = new float[3];
+ output[X] = v0/length;
+ output[Y] = v1/length;
+ output[Z] = v2/length;
+
+ return output;
+ }
+
+ /**
+ * Calculate the normal vector for a plane (triangle) defined
+ * by 3 points in space. The points must be specified in
+ * counterclockwise order. The normal vector is placed in the
+ * specified output vector.
+ *
+ * @param pnt1 The 1st 3D point in the plane.
+ * @param pnt2 The 2nd 3D point in the plane.
+ * @param pnt3 The 3rd 3D point in the plane.
+ * @param output The 3D vector (3 element array) that will be filled in
+ * with the normal vector for this plane.
+ * @return A reference to the output normal vector.
+ **/
+ public static final float[] calcNormal(float[] pnt1, float[] pnt2, float[] pnt3,
+ float[] output) {
+ if (pnt1.length != 3 || pnt2.length != 3 || pnt3.length != 3)
+ throw new IllegalArgumentException(kPoint3DMsg);
+ if (output.length != 3)
+ throw new IllegalArgumentException(kNormal3DMsg);
+
+ // Calculate two vectors from e three points.
+ float v10 = pnt1[X] - pnt2[X];
+ float v11 = pnt1[Y] - pnt2[Y];
+ float v12 = pnt1[Z] - pnt2[Z];
+
+ float v20 = pnt2[X] - pnt3[X];
+ float v21 = pnt2[Y] - pnt3[Y];
+ float v22 = pnt2[Z] - pnt3[Z];
+
+ // Take the cross product of the two vectors and store in output.
+ output[X] = v11*v22 - v12*v21;
+ output[Y] = v12*v20 - v10*v22;
+ output[Z] = v10*v21 - v11*v20;
+
+ // Normalize the resulting vector and return it.
+ return normalize(output, output);
+ }
+
+ /**
+ * Calculate the normal vector for a plane (triangle) defined
+ * by 3 points in space. The points must be specified in
+ * counterclockwise order. A new normal vector is created and
+ * returned by this method.
+ *
+ * @param pnt1 The 1st 3D point in the plane.
+ * @param pnt2 The 2nd 3D point in the plane.
+ * @param pnt3 The 3rd 3D point in the plane.
+ * @return A reference to the new 3D output normal vector.
+ **/
+ public static final float[] calcNormal(float[] pnt1, float[] pnt2, float[] pnt3) {
+ if (pnt1.length != 3 || pnt2.length != 3 || pnt3.length != 3)
+ throw new IllegalArgumentException(kPoint3DMsg);
+
+ // Calculate two vectors from e three points.
+ float v10 = pnt1[X] - pnt2[X];
+ float v11 = pnt1[Y] - pnt2[Y];
+ float v12 = pnt1[Z] - pnt2[Z];
+
+ float v20 = pnt2[X] - pnt3[X];
+ float v21 = pnt2[Y] - pnt3[Y];
+ float v22 = pnt2[Z] - pnt3[Z];
+
+ // Take the cross product of the two vectors and store in output.
+ float[] output = new float[3];
+ output[X] = v11*v22 - v12*v21;
+ output[Y] = v12*v20 - v10*v22;
+ output[Z] = v10*v21 - v11*v20;
+
+ // Normalize the resulting vector and return it.
+ return normalize(output, output);
+ }
+
+ /**
+ * Returns the length of a 3D vector.
+ *
+ * @param vector A 3D (3 element) vector.
+ * @return The length of the input vector.
+ **/
+ public static final float length3D(float[] vector) {
+ if (vector.length != 3)
+ throw new IllegalArgumentException(kVector3DMsg);
+ double dx = vector[X];
+ double dy = vector[Y];
+ double dz = vector[Z];
+ return (float)Math.sqrt(dx*dx + dy*dy + dz*dz);
+ }
+
+ /**
+ * Returns the dot product of two 3D vectors.
+ *
+ * @param a The 1st 3D (3 element) vector.
+ * @param b The 2nd 3D (3 element) vector.
+ * @return The dot product of the two vectors.
+ **/
+ public static final float dotProduct3D(float[] a, float[] b) {
+ if (a.length != 3 || b.length != 3)
+ throw new IllegalArgumentException(kVector3DMsg);
+ return (a[X]*b[X] + a[Y]*b[Y] + a[Z]*b[Z]);
+ }
+
+ /**
+ * Returns the right-handed cross product of 3D vectors A and B in AcrossB.
+ *
+ * @param A The 1st 3D (3 element) vector.
+ * @param B The 2nd 3D (3 element) vector.
+ * @param AcrossB A 3D (3 element) vector to be filled in with the cross
+ * product of A and B. This vector will be overwritten
+ * by this method.
+ * @return A reference to the input vector AcrossB.
+ **/
+ public static final float[] crossProduct3D(float[] A, float[] B, float[] AcrossB) {
+ if (A.length != 3 || B.length != 3 || AcrossB.length != 3)
+ throw new IllegalArgumentException(kVector3DMsg);
+ AcrossB[X] = A[Y] * B[Z] - A[Z] * B[Y];
+ AcrossB[Y] = A[Z] * B[X] - A[X] * B[Z];
+ AcrossB[Z] = A[X] * B[Y] - A[Y] * B[X];
+ return AcrossB;
+ }
+
+ /**
+ * A method for calculating 3D Euclidian distance or length.
+ *
+ * @param dx The difference between X coordinates (X2 - X1).
+ * @param dy The difference between Y coordinates (Y2 - Y1).
+ * @param dz The difference between Z coordinates (Z2 - Z1).
+ * @return The distance between the two points.
+ **/
+ public static final float distance(double dx, double dy, double dz) {
+ return (float)Math.sqrt(dx*dx + dy*dy + dz*dz);
+ }
+
+ /**
+ * A method for calculating the distance between two
+ * points specified as arrays with 3 elements.
+ *
+ * @param pnt1 An array with 3 elements (X,Y,Z) representing the 1st point.
+ * @param pnt2 An array with 3 elements (X,Y,Z) representing the 2nd point.
+ * @return The distance between the two points.
+ **/
+ public static final float distance(float[] pnt1, float[] pnt2) {
+ if (pnt1.length != 3 || pnt2.length != 3)
+ throw new IllegalArgumentException(kPoint3DMsg);
+ double dx = pnt2[X] - pnt1[X];
+ double dy = pnt2[Y] - pnt1[Y];
+ double dz = pnt2[Z] - pnt1[Z];
+ return (float)Math.sqrt(dx*dx + dy*dy + dz*dz);
+ }
+
+ /**
+ * A method for calculating the distance between two
+ * points specified as arrays with 3 elements.
+ *
+ * @param pnt1 An array with 3 elements (X,Y,Z) representing the 1st point.
+ * @param pnt2 An array with 3 elements (X,Y,Z) representing the 2nd point.
+ * @return The distance between the two points.
+ **/
+ public static final float distance(int[] pnt1, int[] pnt2) {
+ if (pnt1.length != 3 || pnt2.length != 3)
+ throw new IllegalArgumentException(kPoint3DMsg);
+ double dx = pnt2[X] - pnt1[X];
+ double dy = pnt2[Y] - pnt1[Y];
+ double dz = pnt2[Z] - pnt1[Z];
+ return (float)Math.sqrt(dx*dx + dy*dy + dz*dz);
+ }
+
+ /**
+ * A fast approximation to 3D Euclidian distance or length!
+ * Accurate to within 13%. Also knowns as the "Manhattan" distance.
+ * This method approximates 3D distance as follows:
+ * <code>
+ * dist = sqrt(dx*dx + dy*dy + dz*dz)
+ * approx. dist = max + (med + min)/4
+ * </code>
+ * Uses shifting and adding. No multiplication, division or sqrt calculations.
+ *
+ * @param dx The difference between X coordinates (X2 - X1).
+ * @param dy The difference between Y coordinates (Y2 - Y1).
+ * @param dz The difference between Z coordinates (Z2 - Z1).
+ * @return The approximate distance between two points.
+ **/
+ public static final int distanceApprox(int dx, int dy, int dz) {
+ int maxc = dx > 0 ? dx:-dx; // Math.abs(dx);
+ int medc = dy > 0 ? dy:-dy; // Math.abs(dy);
+ int minc = dz > 0 ? dz:-dz; // Math.abs(dz);
+
+ if (maxc < medc) {
+ int temp = maxc;
+ maxc = medc;
+ medc = temp;
+ }
+ if (maxc < minc) {
+ int temp = maxc;
+ maxc = minc;
+ minc = temp;
+ }
+
+ medc += minc;
+ medc >>= 2;
+ maxc += medc;
+
+ return maxc;
+ }
+
+ /**
+ * A fast approximation to 2D Euclidian distance or length!
+ * Also knowns as the "Manhattan" distance.
+ * This method approximates 2D distance as follows:
+ * <code>
+ * dist = sqrt(dx*dx + dy*dy)
+ * approx. dist = max + min/4
+ * </code>
+ * Uses shifting and adding. No multiplication, division or sqrt calculations.
+ *
+ * @param dx The difference between X coordinates (X2 - X1).
+ * @param dy The difference between Y coordinates (Y2 - Y1).
+ * @return The approximate distance between two points.
+ **/
+ public static final int distanceApprox(int dx, int dy) {
+ int maxc = dx > 0 ? dx:-dx; // Math.abs(dx);
+ int minc = dy > 0 ? dy:-dy; // Math.abs(dy);
+
+ if (maxc < minc) {
+ int temp = maxc;
+ maxc = minc;
+ minc = temp;
+ }
+
+ minc >>= 2;
+ maxc += minc;
+
+ return maxc;
+ }
+
+ // **** The following are used by the CORDIC fixed point trigonometry routines ****
+
+ private static final int COSCALE=0x11616E8E; // 291597966 = 0.2715717684432241*2^30, valid for j>13
+ private static final int QUARTER = 90<<16;
+ private static final int MAXITER=22;
+ // Table of Cordic values for arctangent in degrees.
+ private static final int arctantab[] = {
+ 4157273, 2949120, 1740967, 919879, 466945, 234379, 117304, 58666,
+ 29335, 14668, 7334, 3667, 1833, 917, 458, 229,
+ 115, 57, 29, 14, 7, 4, 2, 1
+ };
+ private static int xtemp, ytemp; // Temporary storage space used by CORDIC methods.
+
+
+ /**
+ * Converts fixed point coordinates (b,a) to polar coordinates (r, theta) and
+ * returns the angle theta in degrees as a fixed point integer number.
+ * This method is about 40% faster than Math.atan2() using 22 iterations,
+ * but a small amount of accuracy is lost. It is 50% faster than Math.atan2()
+ * using 11 iterations and is still good to +/- 1 degree.
+ * This code is based on that found in "Cordic.c" by Ken Turkowski.
+ *
+ * <p> WARNING!! This method is not thread safe! It stores intermediate results in
+ * a static class variable. Sorry, needed to do that for speed. </p>
+ *
+ * @param iter The number of CORDIC iterations to compute. Will be clamped to (1 <= iter <= 22).
+ * More iterations gives more accurate results, but takes longer.
+ * @param a The first fixed point coordinate value (a = (int)(y)<<16).
+ * @param b The 2nd fixed point coordinate value (b = (int)(x)<<16).
+ * @return The fixed point polar coordinate angle theta is returned (double theta = value/65536.).
+ * The angle returned is in degrees and is (0 <= theta < 360).
+ **/
+ public static final int fixedAtan2D(int iter, int a, int b) {
+ if ((a == 0) && (b == 0))
+ return 0;
+
+ fxPreNorm(a, b); /* Prenormalize vector for maximum precision */
+
+ b = pseudoPolarize(xtemp, ytemp, iter); /* Convert to polar coordinates */
+
+ // Get into a 0 to 360 degree range.
+ b = 90*(1<<16) - b;
+ if (b < 0)
+ b += 360<<16;
+ return b;
+ }
+
+ /**
+ * This method converts the fixed point input cartesian values
+ * to fixed point polar notation. On completion of this routine
+ * xtemp contains the radius and ytemp contains the angle. The
+ * angle is also returned by this method.
+ * This code is based on that found in "Cordic.c" by Ken Turkowski.
+ **/
+ private static int pseudoPolarize(int x, int y, int iter) {
+
+ /* Get the vector into the right half plane */
+ int theta = 0;
+ if (x < 0) {
+ x = -x;
+ y = -y;
+ theta = 2*QUARTER;
+ }
+
+ if (y > 0)
+ theta = -theta;
+
+ int[] arctanptr = arctantab;
+ int yi = 0, pos = 0;
+ if (y < 0) { /* Rotate positive */
+ yi = y + (x << 1);
+ x = x - (y << 1);
+ y = yi;
+ theta -= arctanptr[pos++]; /* Subtract angle */
+ }
+ else { /* Rotate negative */
+ yi = y - (x << 1);
+ x = x + (y << 1);
+ y = yi;
+ theta += arctanptr[pos++]; /* Add angle */
+ }
+
+ if (iter > MAXITER)
+ iter = MAXITER;
+ else if (iter < 1)
+ iter = 1;
+
+ for (int i = 0; i <= iter; i++) {
+ if (y < 0) { /* Rotate positive */
+ yi = y + (x >> i);
+ x = x - (y >> i);
+ y = yi;
+ theta -= arctanptr[pos++];
+ }
+ else { /* Rotate negative */
+ yi = y - (x >> i);
+ x = x + (y >> i);
+ y = yi;
+ theta += arctanptr[pos++];
+ }
+ }
+
+ xtemp = x;
+ ytemp = theta;
+ return theta;
+ }
+
+ /**
+ * FxPreNorm() block normalizes the arguments to a magnitude suitable for
+ * CORDIC pseudorotations. The returned value is the block exponent.
+ * This code is based on that found in "Cordic.c" by Ken Turkowski.
+ **/
+ private static int fxPreNorm(int x, int y) {
+ int signx=1, signy=1;
+
+ if (x < 0) {
+ x = -x;
+ signx = -signx;
+ }
+ if (y < 0) {
+ y = -y;
+ signy = -signy;
+ }
+
+ int shiftexp = 0; /* Block normalization exponent */
+
+ /* Prenormalize vector for maximum precision */
+ if (x < y) { /* |y| > |x| */
+ while (y < (1 << 27)) {
+ x <<= 1;
+ y <<= 1;
+ shiftexp--;
+ }
+ while (y > (1 << 28)) {
+ x >>= 1;
+ y >>= 1;
+ shiftexp++;
+ }
+ }
+ else { /* |x| > |y| */
+ while (x < (1 << 27)) {
+ x <<= 1;
+ y <<= 1;
+ shiftexp--;
+ }
+ while (x > (1 << 28)) {
+ x >>= 1;
+ y >>= 1;
+ shiftexp++;
+ }
+ }
+
+ xtemp = (signx < 0) ? -x : x;
+ ytemp = (signy < 0) ? -y : y;
+ return shiftexp;
+ }
+
+
+}
+
diff --git a/demos/MiscDemos/jahuwaldt/gl/Matrix.java b/demos/MiscDemos/jahuwaldt/gl/Matrix.java
new file mode 100644
index 0000000..e043197
--- /dev/null
+++ b/demos/MiscDemos/jahuwaldt/gl/Matrix.java
@@ -0,0 +1,499 @@
+/*
+* Matrix -- Collection of methods for working with 3D transformation matricies.
+*
+* Copyright (C) 2001 by Joseph A. Huwaldt <[email protected]>.
+* All rights reserved.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Library General Public
+* License as published by the Free Software Foundation; either
+* version 2 of the License, or (at your option) any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Library General Public License for more details.
+**/
+
+package jahuwaldt.gl;
+
+
+/**
+* A set of static utility methods for working with matricies.
+* In particular, these methods are geared for working efficiently
+* with OpenGL transformation matrices.
+*
+* <p> Modified by: Joseph A. Huwaldt </p>
+*
+* @author Joseph A. Huwaldt Date: January 13, 2001
+* @version January 30, 2001
+**/
+public class Matrix {
+
+ /**
+ * The value for Math.PI as a float instead of a double.
+ **/
+ public static final float PI = (float)Math.PI;
+
+ /**
+ * Convert's an angle in radians to one in degrees.
+ *
+ * @param rad The angle in radians to be converted.
+ * @return The angle in degrees.
+ **/
+ public static final float rad2Deg(float rad) {
+ return rad*180/PI;
+ }
+
+ /**
+ * Convert's an angle in degrees to one in radians.
+ *
+ * @param deg The angle in degrees to be converted.
+ * @return The angle in radians.
+ **/
+ public static final float deg2Rad(float deg) {
+ return deg*PI/180;
+ }
+
+ /**
+ * Set a 4x4 transformation matrix to the identity matrix.
+ * Equiv. to: T = I
+ *
+ * I = 1 0 0 0
+ * 0 1 0 0
+ * 0 0 1 0
+ * 0 0 0 1
+ *
+ * @param mtx The 4x4 matrix to be set.
+ * @return A reference to the output matrix "mtx" is returned.
+ **/
+ public static final float[] setIdentity(float mtx[]) {
+ mtx[0] = mtx[5] = mtx[10] = mtx[15] = 1;
+ mtx[1] = mtx[2] = mtx[3] = mtx[4] = 0;
+ mtx[6] = mtx[7] = mtx[8] = mtx[9] = 0;
+ mtx[11] = mtx[12] = mtx[13] = mtx[14] = 0;
+
+ return mtx;
+ }
+
+ /**
+ * Create a new 4x4 transformation matrix set to the identity matrix.
+ * Equiv. to: T = I
+ *
+ * I = 1 0 0 0
+ * 0 1 0 0
+ * 0 0 1 0
+ * 0 0 0 1
+ *
+ * @return A reference to a 4x4 identity matrix is returned.
+ **/
+ public static final float[] identity() {
+ float[] mtx = new float[16];
+ mtx[0] = mtx[5] = mtx[10] = mtx[15] = 1;
+ return mtx;
+ }
+
+ /**
+ * Set a 4x4 transformation matrix which rotates about the X-axis.
+ * Equiv. to: T = Rx
+ *
+ * Rx = 1 0 0 0
+ * 0 cos(a) sin(a) 0
+ * 0 -sin(a) cos(a) 0
+ * 0 0 0 1
+ *
+ * @param angle The rotation angle about the X-axis in radians.
+ * @param mtx The 4x4 matrix to be set.
+ * @return A reference to the output matrix "mtx" is returned.
+ **/
+ public static final float[] setRotateX(float angle, float mtx[]) {
+ float rsin = (float)Math.sin(angle);
+ float rcos = (float)Math.cos(angle);
+ mtx[0] = 1.0f;
+ mtx[1] = 0.0f;
+ mtx[2] = 0.0f;
+ mtx[3] = 0.0f;
+ mtx[4] = 0.0f;
+ mtx[5] = rcos;
+ mtx[6] = rsin;
+ mtx[7] = 0.0f;
+ mtx[8] = 0.0f;
+ mtx[9] = -rsin;
+ mtx[10] = rcos;
+ mtx[11] = 0.0f;
+ mtx[12] = 0.0f;
+ mtx[13] = 0.0f;
+ mtx[14] = 0.0f;
+ mtx[15] = 1.0f;
+
+ return mtx;
+ }
+
+ /**
+ * Set a 4x4 transformation matrix which rotates about the Y-axis.
+ * Equiv. to: T = Ry
+ *
+ * Ry = 1 0 0 0
+ * 0 cos(a) sin(a) 0
+ * 0 -sin(a) cos(a) 0
+ * 0 0 0 1
+ *
+ * @param angle The rotation angle about the Y-axis in radians.
+ * @param mtx The 4x4 matrix to be set.
+ * @return A reference to the output matrix "mtx" is returned.
+ **/
+ public static final float[] setRotateY(float angle, float mtx[]) {
+ float rsin = (float)Math.sin(angle);
+ float rcos = (float)Math.cos(angle);
+ mtx[0] = rcos;
+ mtx[1] = 0.0f;
+ mtx[2] = -rsin;
+ mtx[3] = 0.0f;
+ mtx[4] = 0.0f;
+ mtx[5] = 1.0f;
+ mtx[6] = 0.0f;
+ mtx[7] = 0.0f;
+ mtx[8] = rsin;
+ mtx[9] = 0.0f;
+ mtx[10] = rcos;
+ mtx[11] = 0.0f;
+ mtx[12] = 0.0f;
+ mtx[13] = 0.0f;
+ mtx[14] = 0.0f;
+ mtx[15] = 1.0f;
+
+ return mtx;
+ }
+
+ /**
+ * Set a 4x4 transformation matrix which rotates about the Z-axis.
+ * Equiv. to: T = Rz
+ *
+ * Rz = 1 0 0 0
+ * 0 cos(a) sin(a) 0
+ * 0 -sin(a) cos(a) 0
+ * 0 0 0 1
+ *
+ * @param angle The rotation angle about the Z-axis in radians.
+ * @param mtx The 4x4 matrix to be set.
+ * @return A reference to the output matrix "mtx" is returned.
+ **/
+ public static final float[] setRotateZ(float angle, float mtx[]) {
+ float rsin = (float)Math.sin(angle);
+ float rcos = (float)Math.cos(angle);
+ mtx[0] = rcos;
+ mtx[1] = rsin;
+ mtx[2] = 0.0f;
+ mtx[3] = 0.0f;
+ mtx[4] = -rsin;
+ mtx[5] = rcos;
+ mtx[6] = 0.0f;
+ mtx[7] = 0.0f;
+ mtx[8] = 0.0f;
+ mtx[9] = 0.0f;
+ mtx[10] = 1.0f;
+ mtx[11] = 0.0f;
+ mtx[12] = 0.0f;
+ mtx[13] = 0.0f;
+ mtx[14] = 0.0f;
+ mtx[15] = 1.0f;
+
+ return mtx;
+ }
+
+ /**
+ * Set a 4x4 transformation matrix which scales in each
+ * axis direction by the specified scale factors.
+ * Equiv. to: T = S
+ *
+ * S = sx 0 0 0
+ * 0 sy 0 0
+ * 0 0 sz 0
+ * 0 0 0 1
+ *
+ * @param sx The scale factor in the X-axis direction.
+ * @param sy The scale factor in the Y-axis direction.
+ * @param sz The scale factor in the Z-axis direction.
+ * @param mtx The 4x4 matrix to be set.
+ * @return A reference to the output matrix "mtx" is returned.
+ **/
+ public static final float[] setScale(float sx, float sy, float sz, float mtx[]) {
+ mtx[0] = sx;
+ mtx[5] = sy;
+ mtx[10] = sz;
+ mtx[15] = 1;
+ mtx[1] = mtx[2] = mtx[3] = mtx[4] = 0;
+ mtx[6] = mtx[7] = mtx[8] = mtx[9] = 0;
+ mtx[11] = mtx[12] = mtx[13] = mtx[14] = 0;
+
+ return mtx;
+ }
+
+ /**
+ * Set a 4x4 transformation matrix which translates in each
+ * axis direction by the specified amounts.
+ * Equiv. to: T = Tr
+ *
+ * Tr = 1 0 0 tx
+ * 0 1 0 ty
+ * 0 0 1 tz
+ * 0 0 0 1
+ *
+ * @param tx The translation amount in the X-axis direction.
+ * @param ty The translation amount in the Y-axis direction.
+ * @param tz The translation amount in the Z-axis direction.
+ * @param mtx The 4x4 matrix to be set.
+ * @return A reference to the output matrix "mtx" is returned.
+ **/
+ public static final float[] setTranslate(float tx, float ty, float tz, float mtx[]) {
+ mtx[0] = 1;
+ mtx[1] = mtx[2] = 0;
+ mtx[3] = tx;
+ mtx[4] = 0;
+ mtx[5] = 1;
+ mtx[6] = 0;
+ mtx[7] = ty;
+ mtx[8] = mtx[9] = 0;
+ mtx[10] = 1;
+ mtx[11] = tz;
+ mtx[12] = mtx[13] = mtx[14] = 0;
+ mtx[15] = 1;
+
+ return mtx;
+ }
+
+ /**
+ * Multiplies two 4x4 matricies together, and returns the
+ * result in a new output matrix. The multiplication is done
+ * fast, at the expense of code.
+ *
+ * @param mtx1 The 1st matrix being multiplied.
+ * @param mtx2 The 2nd matrix being multiplied.
+ * @return The output matrix containing the input matrices multiplied.
+ **/
+ public static final float[] multiply(float mtx1[], float mtx2[]) {
+ float nmtx[] = new float[16];
+
+ float m0 = mtx1[0], m1 = mtx1[1], m2 = mtx1[2], m3 = mtx1[3];
+ nmtx[0] = m0*mtx2[0] + m1*mtx2[4] + m2*mtx2[8] + m3*mtx2[12];
+ nmtx[1] = m0*mtx2[1] + m1*mtx2[5] + m2*mtx2[9] + m3*mtx2[13];
+ nmtx[2] = m0*mtx2[2] + m1*mtx2[6] + m2*mtx2[10] + m3*mtx2[14];
+ nmtx[3] = m0*mtx2[3] + m1*mtx2[7] + m2*mtx2[11] + m3*mtx2[15];
+
+ m0 = mtx1[4]; m1 = mtx1[5]; m2 = mtx1[6]; m3 = mtx1[7];
+ nmtx[4] = m0*mtx2[0] + m1*mtx2[4] + m2*mtx2[8] + m3*mtx2[12];
+ nmtx[5] = m0*mtx2[1] + m1*mtx2[5] + m2*mtx2[9] + m3*mtx2[13];
+ nmtx[6] = m0*mtx2[2] + m1*mtx2[6] + m2*mtx2[10] + m3*mtx2[14];
+ nmtx[7] = m0*mtx2[3] + m1*mtx2[7] + m2*mtx2[11] + m3*mtx2[15];
+
+ m0 = mtx1[8]; m1 = mtx1[9]; m2 = mtx1[10]; m3 = mtx1[11];
+ nmtx[8] = m0*mtx2[0] + m1*mtx2[4] + m2*mtx2[8] + m3*mtx2[12];
+ nmtx[9] = m0*mtx2[1] + m1*mtx2[5] + m2*mtx2[9] + m3*mtx2[13];
+ nmtx[10] = m0*mtx2[2] + m1*mtx2[6] + m2*mtx2[10] + m3*mtx2[14];
+ nmtx[11] = m0*mtx2[3] + m1*mtx2[7] + m2*mtx2[11] + m3*mtx2[15];
+
+ m0 = mtx1[12]; m1 = mtx1[13]; m2 = mtx1[14]; m3 = mtx1[15];
+ nmtx[12] = m0*mtx2[0] + m1*mtx2[4] + m2*mtx2[8] + m3*mtx2[12];
+ nmtx[13] = m0*mtx2[1] + m1*mtx2[5] + m2*mtx2[9] + m3*mtx2[13];
+ nmtx[14] = m0*mtx2[2] + m1*mtx2[6] + m2*mtx2[10] + m3*mtx2[14];
+ nmtx[15] = m0*mtx2[3] + m1*mtx2[7] + m2*mtx2[11] + m3*mtx2[15];
+
+ return nmtx;
+ }
+
+
+ /**
+ * Multiplies two 4x4 matricies together, and places them
+ * in the specified output matrix. The multiplication is done
+ * fast, at the expense of code. The output matrix may not
+ * be the same as one of the input matrices or the results
+ * are undefined.
+ *
+ * @param mtx1 The 1st matrix being multiplied.
+ * @param mtx2 The 2nd matrix being multiplied.
+ * @param dest The output matrix (results go here). Must not be
+ * one of the input matrices.
+ * @return A reference to the output matrix "dest" is returned.
+ **/
+ public static final float[] multiply(float mtx1[], float mtx2[], float dest[]) {
+
+ float m0 = mtx1[0], m1 = mtx1[1], m2 = mtx1[2], m3 = mtx1[3];
+ dest[0] = m0*mtx2[0] + m1*mtx2[4] + m2*mtx2[8] + m3*mtx2[12];
+ dest[1] = m0*mtx2[1] + m1*mtx2[5] + m2*mtx2[9] + m3*mtx2[13];
+ dest[2] = m0*mtx2[2] + m1*mtx2[6] + m2*mtx2[10] + m3*mtx2[14];
+ dest[3] = m0*mtx2[3] + m1*mtx2[7] + m2*mtx2[11] + m3*mtx2[15];
+
+ m0 = mtx1[4]; m1 = mtx1[5]; m2 = mtx1[6]; m3 = mtx1[7];
+ dest[4] = m0*mtx2[0] + m1*mtx2[4] + m2*mtx2[8] + m3*mtx2[12];
+ dest[5] = m0*mtx2[1] + m1*mtx2[5] + m2*mtx2[9] + m3*mtx2[13];
+ dest[6] = m0*mtx2[2] + m1*mtx2[6] + m2*mtx2[10] + m3*mtx2[14];
+ dest[7] = m0*mtx2[3] + m1*mtx2[7] + m2*mtx2[11] + m3*mtx2[15];
+
+ m0 = mtx1[8]; m1 = mtx1[9]; m2 = mtx1[10]; m3 = mtx1[11];
+ dest[8] = m0*mtx2[0] + m1*mtx2[4] + m2*mtx2[8] + m3*mtx2[12];
+ dest[9] = m0*mtx2[1] + m1*mtx2[5] + m2*mtx2[9] + m3*mtx2[13];
+ dest[10] = m0*mtx2[2] + m1*mtx2[6] + m2*mtx2[10] + m3*mtx2[14];
+ dest[11] = m0*mtx2[3] + m1*mtx2[7] + m2*mtx2[11] + m3*mtx2[15];
+
+ m0 = mtx1[12]; m1 = mtx1[13]; m2 = mtx1[14]; m3 = mtx1[15];
+ dest[12] = m0*mtx2[0] + m1*mtx2[4] + m2*mtx2[8] + m3*mtx2[12];
+ dest[13] = m0*mtx2[1] + m1*mtx2[5] + m2*mtx2[9] + m3*mtx2[13];
+ dest[14] = m0*mtx2[2] + m1*mtx2[6] + m2*mtx2[10] + m3*mtx2[14];
+ dest[15] = m0*mtx2[3] + m1*mtx2[7] + m2*mtx2[11] + m3*mtx2[15];
+
+ return dest;
+ }
+
+ /****************************************************************
+ * The following are matrix post concatenation routines that *
+ * can be used as speedy replacements for the more standard *
+ * matrix mult. routine to generate combined rotations. *
+ ****************************************************************/
+ /**
+ * Multiply an existing 4x4 transformation matrix by an X-axis
+ * rotation matrix quickly. This is much faster than calling
+ * setRotateX() followed by multiply().
+ * Equiv. to: T = T*Rx
+ *
+ * Rx = 1 0 0 0
+ * 0 cos(a) sin(a) 0
+ * 0 -sin(a) cos(a) 0
+ * 0 0 0 1
+ *
+ * @param angle The rotation angle about the X-axis in radians.
+ * @param mtx The 4x4 matrix to be multiplied by the rotation matrix.
+ * @return A reference to the output matrix "mtx" is returned.
+ **/
+ public static final float[] rotateX(float angle, float mtx[]) {
+ float rsin = (float)Math.sin(angle);
+ float rcos = (float)Math.cos(angle);
+
+ for (int i = 0 ; i < 4 ; i++) {
+ int i1 = i*4 + 1;
+ int i2 = i1 + 1;
+ float t = mtx[i1];
+ mtx[i1] = t*rcos - mtx[i2]*rsin;
+ mtx[i2] = t*rsin + mtx[i2]*rcos;
+ }
+
+ return mtx;
+ }
+
+ /**
+ * Multiply an existing 4x4 transformation matrix by a Y-axis
+ * rotation matrix quickly. This is much faster than calling
+ * setRotateY() followed by multiply().
+ * Equiv. to: T = T*Ry
+ *
+ * Ry = 1 0 0 0
+ * 0 cos(a) sin(a) 0
+ * 0 -sin(a) cos(a) 0
+ * 0 0 0 1
+ *
+ * @param angle The rotation angle about the Y-axis in radians.
+ * @param mtx The 4x4 matrix to be multiplied by the rotation matrix.
+ * @return A reference to the output matrix "mtx" is returned.
+ **/
+ public static final float[] rotateY(float angle, float mtx[]) {
+ float rsin = (float)Math.sin(angle);
+ float rcos = (float)Math.cos(angle);
+
+ for (int i = 0 ; i < 4 ; i++) {
+ int i0 = i*4;
+ int i2 = i0 + 2;
+ float t = mtx[i0];
+ mtx[i0] = t*rcos + mtx[i2]*rsin;
+ mtx[i2] = mtx[i2]*rcos - t*rsin;
+ }
+
+ return mtx;
+ }
+
+ /**
+ * Multiply an existing 4x4 transformation matrix by a Z-axis
+ * rotation matrix quickly. This is much faster than calling
+ * setRotateZ() followed by multiply().
+ * Equiv. to: T = T*Rz
+ *
+ * Rz = 1 0 0 0
+ * 0 cos(a) sin(a) 0
+ * 0 -sin(a) cos(a) 0
+ * 0 0 0 1
+ *
+ * @param angle The rotation angle about the Y-axis in radians.
+ * @param mtx The 4x4 matrix to be multiplied by the rotation matrix.
+ * @return A reference to the output matrix "mtx" is returned.
+ **/
+ public static final float[] rotateZ(float angle, float mtx[]) {
+ float rsin = (float)Math.sin(angle);
+ float rcos = (float)Math.cos(angle);
+
+ for (int i = 0 ; i < 4 ; i++) {
+ int i0 = i*4;
+ int i1 = i0 + 1;
+ float t = mtx[i0];
+ mtx[i0] = t*rcos - mtx[i1]*rsin;
+ mtx[i1] = t*rsin + mtx[i1]*rcos;
+ }
+
+ return mtx;
+ }
+
+ /**
+ * Multiply an existing 4x4 transformation matrix by a set of
+ * scale factors quickly. This is much faster than calling
+ * setScale() followed by multiply().
+ * Equiv. to: T = T*S
+ *
+ * S = sx 0 0 0
+ * 0 sy 0 0
+ * 0 0 sz 0
+ * 0 0 0 1
+ *
+ * @param sx The scale factor in the X-axis direction.
+ * @param sy The scale factor in the Y-axis direction.
+ * @param sz The scale factor in the Z-axis direction.
+ * @param mtx The 4x4 matrix to be multiplied by the scale factor matrix.
+ * @param A reference to the output matrix "mtx" is returned.
+ **/
+ public static final float[] scale(float sx, float sy, float sz, float mtx[]) {
+ for (int i = 0 ; i < 4 ; i++) {
+ int i0 = i*4;
+ mtx[i0] *= sx;
+ mtx[i0 + 1] *= sy;
+ mtx[i0 + 2] *= sz;
+ }
+
+ return mtx;
+ }
+
+ /**
+ * Multiply an existing 4x4 transformation matrix by a
+ * translation matrix quickly. This is much faster than calling
+ * setTranslate() followed by multiply().
+ * Equiv. to: T = T*Tr
+ *
+ * Tr = 1 0 0 Tx
+ * 0 1 0 Ty
+ * 0 0 1 Tz
+ * 0 0 0 1
+ *
+ * @param tx The translation amount in the X-axis direction.
+ * @param ty The translation amount in the Y-axis direction.
+ * @param tz The translation amount in the Z-axis direction.
+ * @param mtx The 4x4 matrix to be multiplied by the translation matrix.
+ * @return A reference to the output matrix "mtx" is returned.
+ **/
+ public static final float[] translate(float tx, float ty, float tz, float mtx[]) {
+ for (int i=0 ; i < 4 ; i++) {
+ int i0 = i*4;
+ int i3 = i0 + 3;
+ mtx[i0] += mtx[i3]*tx;
+ mtx[i0 + 1] += mtx[i3]*ty;
+ mtx[i0 + 2] += mtx[i3]*tz;
+ }
+
+ return mtx;
+ }
+
+}
diff --git a/demos/MiscDemos/jahuwaldt/gl/VirtualSphere.java b/demos/MiscDemos/jahuwaldt/gl/VirtualSphere.java
new file mode 100644
index 0000000..2ec7917
--- /dev/null
+++ b/demos/MiscDemos/jahuwaldt/gl/VirtualSphere.java
@@ -0,0 +1,255 @@
+/*
+* VirtualSphere -- A class that implements the Virtual Sphere algorithm for 3D rotation.
+*
+* Copyright (C) 2001 by Joseph A. Huwaldt <[email protected]>.
+* All rights reserved.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Library General Public
+* License as published by the Free Software Foundation; either
+* version 2 of the License, or (at your option) any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Library General Public License for more details.
+**/
+
+package jahuwaldt.gl;
+
+
+import java.awt.*;
+
+
+/**
+* Implements the Virtual Sphere algorithm for 3D rotation using a 2D input device.
+* See paper "A Study in Interactive 3-D Rotation Using 2-D Control Devices" by
+* Michael Chen, S. Joy Mountford and Abigail Sellen published in the ACM Siggraph '88
+* proceedings (Volume 22, Number 4, August 1988) for more detail. The code here
+* provides a much simpler implementation than that described in the paper.
+* This is also known by as the "virtual track ball" or "cue ball" interface.
+*
+* <p> Ported from C to Java by Joseph A. Huwaldt, February 19, 2001 </p>
+* <p> Original C version had the following comments:
+* Author: Michael Chen, Human Interface Group / ATG,
+* Copyright � 1991-1993 Apple Computer, Inc. All rights reserved.
+* Part of Virtual Sphere Sample Code Release v1.1.
+* </p>
+*
+* <p> Modified by: Joseph A.Huwaldt </p>
+*
+* @author: Joseph A. Huwaldt Date: Feburary 19, 2001
+* @version February 20, 2001
+**/
+public class VirtualSphere {
+
+ // Some constants for convenience.
+ private static final int X = 0;
+ private static final int Y = 1;
+ private static final int Z = 2;
+
+ /**
+ * Storage for 3D point information passed between methods.
+ **/
+ private final float[] op = new float[3], oq = new float[3], a = new float[3];
+
+ /**
+ * Calculate a rotation matrix based on the axis and angle of rotation
+ * from the last 2 locations of the mouse relative to the Virtual
+ * Sphere cue circle.
+ *
+ * @param pnt1 The 1st mouse location in the window.
+ * @param pnt2 The 2nd mouse location in the window.
+ * @param cueCenter The center of the virtual sphere in the window.
+ * @param cueRadius The radius of the virtual sphere.
+ * @param rotMatrix Preallocated rotation matrix to be filled in
+ * by this method. Must have 16 floating point
+ * elements. This matrix will be overwritten by
+ * this method.
+ * @return A reference to the input rotMatrix is returned with the elements filled in.
+ **/
+ public float[] makeRotationMtx(Point pnt1, Point pnt2, Point cueCenter, int cueRadius,
+ float[] rotMatrix) {
+
+ // Vectors op and oq are defined as class variables to avoid wastefull memory allocations.
+
+ // Project mouse points to 3-D points on the +z hemisphere of a unit sphere.
+ pointOnUnitSphere (pnt1, cueCenter, cueRadius, op);
+ pointOnUnitSphere (pnt2, cueCenter, cueRadius, oq);
+
+ /* Consider the two projected points as vectors from the center of the
+ * unit sphere. Compute the rotation matrix that will transform vector
+ * op to oq. */
+ setRotationMatrix(rotMatrix, op, oq);
+
+ return rotMatrix;
+ }
+
+
+ /**
+ * Draw a 2D representation of the virtual sphere to the specified graphics context.
+ * The representation includes a circle for the perimiter of the virtual sphere
+ * and a cross-hair indicating where the mouse pointer is over the virtual sphere.
+ *
+ * @param gc The graphics context to be drawn into.
+ * @param mousePnt The location in window of the mouse.
+ * @param cueCenter The location in the window of the center of the virtual sphere.
+ * @param cueRadius The radius (in pixels) of the virtual sphere in the window.
+ **/
+ public void draw(Graphics gc, Point mousePnt, Point cueCenter, int cueRadius) {
+
+ // Draw the outline of the virtual sphere.
+ int x = cueCenter.x - cueRadius;
+ int y = cueCenter.y - cueRadius;
+ int diameter = 2*cueRadius;
+ gc.drawOval(x, y, diameter, diameter);
+
+ int mouseX = mousePnt.x - cueCenter.x;
+ int mouseY = cueCenter.y - mousePnt.y;
+ int mouseX2 = mouseX*mouseX;
+ int mouseY2 = mouseY*mouseY;
+ int cueRadius2 = cueRadius*cueRadius;
+
+ // Draw the mouse cue if we are over the sphere.
+ if (mouseX2 + mouseY2 < cueRadius2) {
+
+ // Draw the vertical cue line.
+ if (Math.abs(mouseX) > 4) {
+ // Draw a vertical elliptical arc through the mouse point.
+ double a = Math.sqrt(mouseX2/(1 - mouseY2/(float)cueRadius2));
+ double newMouseX = mouseX*cueRadius/a;
+ int angle = (int)(Math.atan2(mouseY, newMouseX)*180/Math.PI);
+ int width = (int)(2*a);
+ int nx = cueCenter.x - (int)a;
+ gc.drawArc(nx, y, width, diameter, angle - 10, 20);
+
+ } else {
+ // Mouse X near zero is a special case, just draw a vertical line.
+ float vy = mouseY/(float)cueRadius;
+ float vy2 = vy*vy;
+ double vz = Math.sqrt(1 - vy2);
+ double angle = Math.atan2(vy, vz) - 10*Math.PI/180;
+ double length = Math.sqrt(vy2 + vz*vz)*cueRadius;
+ int yl = cueCenter.y - (int)(length*Math.sin(angle));
+ int yh = cueCenter.y - (int)(length*Math.sin(angle + 20*Math.PI/180));
+ gc.drawLine(mousePnt.x, yl, mousePnt.x, yh);
+ }
+
+ // Draw the horizontal cue line.
+ if (Math.abs(mouseY) > 4) {
+ // Draw a horizontal elliptical arc through the mouse point.
+ double a = Math.sqrt(mouseY2/(1 - mouseX2/(float)cueRadius2));
+ double newMouseY = mouseY*cueRadius/a;
+ int angle = (int)(Math.atan2(newMouseY, mouseX)*180/Math.PI);
+ int width = (int)(2*a);
+ y = cueCenter.y - (int)a;
+ gc.drawArc(x, y, diameter, width, angle - 10, 20);
+
+ } else {
+ // Mouse Y near zero is a special case, just draw a horizontal line.
+ float vx = mouseX/(float)cueRadius;
+ float vx2 = vx*vx;
+ double vz = Math.sqrt(1 - vx2);
+ double angle = Math.atan2(vx, vz) - 10*Math.PI/180;
+ double length = Math.sqrt(vx2 + vz*vz)*cueRadius;
+ int xl = cueCenter.x + (int)(length*Math.sin(angle));
+ int xh = cueCenter.x + (int)(length*Math.sin(angle + 20*Math.PI/180));
+ gc.drawLine(xl, mousePnt.y, xh, mousePnt.y);
+ }
+ }
+ }
+
+ /**
+ * Project a 2D point on a circle to a 3D point on the +z hemisphere of a unit sphere.
+ * If the 2D point is outside the circle, it is first mapped to the nearest point on
+ * the circle before projection.
+ * Orthographic projection is used, though technically the field of view of the camera
+ * should be taken into account. However, the discrepancy is neglegible.
+ *
+ * @param p Window point to be projected onto the sphere.
+ * @param cueCenter Location of center of virtual sphere in window.
+ * @param cueRadius The radius of the virtual sphere.
+ * @param v Storage for the 3D projected point created by this method.
+ **/
+ private static void pointOnUnitSphere(Point p, Point cueCenter, int cueRadius, float[] v) {
+
+ /* Turn the mouse points into vectors relative to the center of the circle
+ * and normalize them. Note we need to flip the y value since the 3D coordinate
+ * has positive y going up. */
+ float vx = (p.x - cueCenter.x)/(float)cueRadius;
+ float vy = (cueCenter.y - p.y)/(float)cueRadius;
+ float lengthSqared = vx*vx + vy*vy;
+
+ /* Project the point onto the sphere, assuming orthographic projection.
+ * Points beyond the virtual sphere are normalized onto
+ * edge of the sphere (where z = 0). */
+ float vz = 0;
+ if (lengthSqared < 1)
+ vz = (float)Math.sqrt(1.0 - lengthSqared);
+
+ else {
+ float length = (float)Math.sqrt(lengthSqared);
+ vx /= length;
+ vy /= length;
+ }
+
+ v[X] = vx;
+ v[Y] = vy;
+ v[Z] = vz;
+ }
+
+ /**
+ * Computes a rotation matrix that would map (rotate) vectors op onto oq.
+ * The rotation is about an axis perpendicular to op and oq.
+ * Note this routine won't work if op or oq are zero vectors, or if they
+ * are parallel or antiparallel to each other.
+ *
+ * <p> Modification of Michael Pique's formula in
+ * Graphics Gems Vol. 1. Andrew Glassner, Ed. Addison-Wesley. </p>
+ *
+ * @param rotationMatrix The 16 element rotation matrix to be filled in.
+ * @param op The 1st 3D vector.
+ * @param oq The 2nd 3D vector.
+ **/
+ private void setRotationMatrix(float[] rotationMatrix, float[] op, float[] oq) {
+
+ // Vector a is defined as a class variable to avoid wastefull memory allocations.
+
+ GLTools.crossProduct3D(op, oq, a);
+ float s = GLTools.length3D(a);
+ float c = GLTools.dotProduct3D(op, oq);
+ float t = 1 - c;
+
+ float ax = a[X];
+ float ay = a[Y];
+ float az = a[Z];
+ if (s > 0) {
+ ax /= s;
+ ay /= s;
+ az /= s;
+ }
+
+ float tax = t*ax;
+ float taxay = tax*ay, taxaz = tax*az;
+ float saz = s*az, say = s*ay;
+ rotationMatrix[0] = tax*ax + c;
+ rotationMatrix[1] = taxay + saz;
+ rotationMatrix[2] = taxaz - say;
+
+ float tay = t*ay;
+ float tayaz = tay*az;
+ float sax = s*ax;
+ rotationMatrix[4] = taxay - saz;
+ rotationMatrix[5] = tay*ay + c;
+ rotationMatrix[6] = tayaz + sax;
+
+ rotationMatrix[8] = taxaz + say;
+ rotationMatrix[9] = tayaz - sax;
+ rotationMatrix[10] = t*az*az + c;
+
+ rotationMatrix[3] = rotationMatrix[7] = rotationMatrix[11] =
+ rotationMatrix[12] = rotationMatrix[13] = rotationMatrix[14] = 0;
+ rotationMatrix[15] = 1;
+ }
+}
+
diff --git a/gl4java/utils/glf/GLF.java b/gl4java/utils/glf/GLF.java
new file mode 100755
index 0000000..60e7c92
--- /dev/null
+++ b/gl4java/utils/glf/GLF.java
@@ -0,0 +1,102 @@
+/**
+ * @(#) GLF.java
+ */
+
+package gl4java.utils.glf;
+
+import java.net.*;
+import java.io.*;
+
+import gl4java.*;
+import gl4java.utils.*;
+
+/**
+ * The default implementation class for GLF native function mapping
+ *
+ * @version 2.00, 21. April 1999
+ * @author Sven Goethel
+ */
+public class GLF
+ extends GLFFuncJNI
+{
+ public GLF()
+ {
+ super();
+ glfInit();
+ }
+
+ protected void finalize()
+ throws Throwable
+ {
+ glfClose();
+ super.finalize();
+ }
+
+ public final int glfLoadFont ( String fontname )
+ {
+ return glfLoadFont(null, fontname);
+ }
+
+ public final int glfLoadFont ( URL baseURL, String fontURI )
+ {
+ int fontd = 0;
+ long filed = Tool.copyResource2TempFile(this, baseURL, fontURI);
+ if(filed!=0)
+ {
+ fontd = glfLoadFontNative(filed);
+ Tool.tmpfileClose(filed);
+ return fontd;
+ }
+ return GLF.GLF_ERROR;
+ }
+
+ public final int glfLoadBFont ( String fontname )
+ {
+ return glfLoadBFont(null, fontname);
+ }
+
+ public final int glfLoadBFont ( URL baseURL, String fontURI )
+ {
+ int fontd = 0;
+ long filed = Tool.copyResource2TempFile(this, baseURL, fontURI);
+ if(filed!=0)
+ {
+ fontd = glfLoadBFontNative(filed);
+ Tool.tmpfileClose(filed);
+ return fontd;
+ }
+
+ return GLF.GLF_ERROR;
+ }
+
+ public static void main( String args[] )
+ {
+ String fontURI = null;
+
+ if(args.length==0)
+ {
+ System.out.println("java gl4java.utils.glf.GLF <font-URI> [<baseURL>]");
+ System.out.println("... using default font times_new1.glf, now !");
+ fontURI="times_new1.glf";
+ } else fontURI = args[0];
+
+ URL baseURL = null;
+
+ if(args.length>1)
+ {
+ try {
+ baseURL = new URL(args[1]);
+ } catch (Exception ex) {
+ System.out.println(ex);
+ }
+ }
+
+ if(GLContext.doLoadNativeLibraries(null, null, null)==false)
+ System.out.println("could not load def. native libs.");
+
+ GLF glf = new GLF();
+
+ glf.glfLoadFont(baseURL, fontURI);
+ }
+}
+
diff --git a/gl4java/utils/glf/GLFEnum.java b/gl4java/utils/glf/GLFEnum.java
new file mode 100755
index 0000000..9a59c4b
--- /dev/null
+++ b/gl4java/utils/glf/GLFEnum.java
@@ -0,0 +1,57 @@
+/* WARNING ! WARNING *** THIS FILE IS GENERATED BY C2J !!!
+
+ DO NOT MAKE ANY CHANGES *** MAKE CHANGES IN THE SKELETON FILES !!!
+*/
+
+
+/**
+ * @(#) GLFEnum.java
+ */
+
+
+package gl4java.utils.glf;
+
+/**
+ * The base interface for GLF enumerates,
+ * which provides you all the C-API style enumerates
+ *
+ * @version 1.00, 23. Mai 2001
+ * @author Sven Goethel
+ */
+public interface GLFEnum
+{
+
+/**
+ * C2J Parser Version 2.2
+ * Jausoft - Sven Goethel Software Development
+ * Reading from file: glf-enum-auto.orig.h . . .
+ * Destination-Class: gl4java_GLFEnum !
+ */
+
+ public static final int GLF_ERROR = - 1;
+ public static final int GLF_OK = 0;
+ public static final int GLF_YES = 1;
+ public static final int GLF_NO = 2;
+ public static final int GLF_CONSOLE_MESSAGES = 10;
+ public static final int GLF_TEXTURING = 11;
+ public static final int GLF_CONTOURING = 12;
+ public static final int GLF_LEFT_UP = 20;
+ public static final int GLF_LEFT_CENTER = 21;
+ public static final int GLF_LEFT_DOWN = 22;
+ public static final int GLF_CENTER_UP = 23;
+ public static final int GLF_CENTER_CENTER = 24;
+ public static final int GLF_CENTER_DOWN = 25;
+ public static final int GLF_RIGHT_UP = 26;
+ public static final int GLF_RIGHT_CENTER = 27;
+ public static final int GLF_RIGHT_DOWN = 28;
+ public static final int GLF_CENTER = 24;
+ public static final int GLF_LEFT = 1;
+ public static final int GLF_RIGHT = 2;
+ public static final int GLF_UP = 3;
+ public static final int GLF_DOWN = 4;
+ public static final int GLF_CONSOLE_CURSOR = 30;
+/* C2J Parser Version 2.2: Java program parsed successfully. */
+
+
+}
+
diff --git a/gl4java/utils/glf/GLFFuncJNI.java b/gl4java/utils/glf/GLFFuncJNI.java
new file mode 100755
index 0000000..33e9031
--- /dev/null
+++ b/gl4java/utils/glf/GLFFuncJNI.java
@@ -0,0 +1,671 @@
+/* WARNING ! WARNING *** THIS FILE IS GENERATED BY C2J !!!
+
+ DO NOT MAKE ANY CHANGES *** MAKE CHANGES IN THE SKELETON FILES !!!
+*/
+
+
+/**
+ * @(#) GLFFuncJNI.java
+ */
+
+
+package gl4java.utils.glf;
+
+import java.net.*;
+
+/**
+ * The default implementation class for GLF native function mapping
+ *
+ * @version 2.00, 21. April 1999
+ * @author Sven Goethel
+ */
+public abstract class GLFFuncJNI
+ implements GLFEnum
+{
+
+public abstract int glfLoadFont ( String fontname );
+
+public abstract int glfLoadFont ( URL baseURL, String fontURI );
+
+public abstract int glfLoadBFont ( String fontname );
+
+public abstract int glfLoadBFont ( URL baseURL, String fontURI );
+
+public final native String getNativeVendor ( ) ;
+public final native String getNativeVersion ( ) ;
+
+public final String getClassVendor ( )
+{ return "Jausoft - Sven Goethel Software Development"; }
+
+public final String getClassVersion ( )
+{ return "1.4.0.0"; }
+
+/**
+ * Load Vector font to memory, by (FILE *) fontf
+ */
+protected final native int glfLoadFontNative (long fontf);
+
+/**
+ * Load Bitmap font to memory, by (FILE *) fontf
+ */
+protected final native int glfLoadBFontNative (long fontf);
+
+/**
+ * C2J Parser Version 2.2
+ * Jausoft - Sven Goethel Software Development
+ * Reading from file: glf-proto-auto.orig.h . . .
+ * Destination-Class: gl4java_utils_glf_GLF !
+ */
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfInit ( ) ;
+ * </pre>
+ */
+ public final native void glfInit (
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfClose ( ) ;
+ * </pre>
+ */
+ public final native void glfClose (
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ int glfUnloadFont ( ) ;
+ * </pre>
+ */
+ public final native int glfUnloadFont (
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ int glfUnloadBFont ( ) ;
+ * </pre>
+ */
+ public final native int glfUnloadBFont (
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ int glfUnloadFontD ( int font_descriptor ) ;
+ * </pre>
+ */
+ public final native int glfUnloadFontD (
+ int font_descriptor
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ int glfUnloadBFontD ( int bmf_descriptor ) ;
+ * </pre>
+ */
+ public final native int glfUnloadBFontD (
+ int bmf_descriptor
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawWiredSymbol ( char s ) ;
+ * </pre>
+ */
+ public final native void glfDrawWiredSymbol (
+ byte s
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawWiredString ( const char * s ) ;
+ * </pre>
+ */
+ public final native void glfDrawWiredString (
+ String s
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawSolidSymbol ( char s ) ;
+ * </pre>
+ */
+ public final native void glfDrawSolidSymbol (
+ byte s
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawSolidString ( const char * s ) ;
+ * </pre>
+ */
+ public final native void glfDrawSolidString (
+ String s
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDraw3DWiredSymbol ( char s ) ;
+ * </pre>
+ */
+ public final native void glfDraw3DWiredSymbol (
+ byte s
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDraw3DWiredString ( const char * s ) ;
+ * </pre>
+ */
+ public final native void glfDraw3DWiredString (
+ String s
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDraw3DSolidSymbol ( char s ) ;
+ * </pre>
+ */
+ public final native void glfDraw3DSolidSymbol (
+ byte s
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDraw3DSolidString ( const char * s ) ;
+ * </pre>
+ */
+ public final native void glfDraw3DSolidString (
+ String s
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ int glfBeginBFont ( int Font_Descriptor ) ;
+ * </pre>
+ */
+ public final native int glfBeginBFont (
+ int Font_Descriptor
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfEndBFont ( ) ;
+ * </pre>
+ */
+ public final native void glfEndBFont (
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawBSymbol ( char s ) ;
+ * </pre>
+ */
+ public final native void glfDrawBSymbol (
+ byte s
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawBString ( const char * s ) ;
+ * </pre>
+ */
+ public final native void glfDrawBString (
+ String s
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawBMaskSymbol ( char s ) ;
+ * </pre>
+ */
+ public final native void glfDrawBMaskSymbol (
+ byte s
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawBMaskString ( const char * s ) ;
+ * </pre>
+ */
+ public final native void glfDrawBMaskString (
+ String s
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawWiredSymbolF ( int font_descriptor , char s ) ;
+ * </pre>
+ */
+ public final native void glfDrawWiredSymbolF (
+ int font_descriptor,
+ byte s
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawWiredStringF ( int font_descriptor , const char * s ) ;
+ * </pre>
+ */
+ public final native void glfDrawWiredStringF (
+ int font_descriptor,
+ String s
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawSolidSymbolF ( int font_descriptor , char s ) ;
+ * </pre>
+ */
+ public final native void glfDrawSolidSymbolF (
+ int font_descriptor,
+ byte s
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDrawSolidStringF ( int font_descriptor , const char * s ) ;
+ * </pre>
+ */
+ public final native void glfDrawSolidStringF (
+ int font_descriptor,
+ String s
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDraw3DWiredSymbolF ( int font_descriptor , char s ) ;
+ * </pre>
+ */
+ public final native void glfDraw3DWiredSymbolF (
+ int font_descriptor,
+ byte s
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDraw3DWiredStringF ( int font_descriptor , const char * s ) ;
+ * </pre>
+ */
+ public final native void glfDraw3DWiredStringF (
+ int font_descriptor,
+ String s
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDraw3DSolidSymbolF ( int font_descriptor , char s ) ;
+ * </pre>
+ */
+ public final native void glfDraw3DSolidSymbolF (
+ int font_descriptor,
+ byte s
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDraw3DSolidStringF ( int font_descriptor , const char * s ) ;
+ * </pre>
+ */
+ public final native void glfDraw3DSolidStringF (
+ int font_descriptor,
+ String s
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfGetStringBoundsF ( int fd , const char * s , float * minx , float * miny , float * maxx , float * maxy ) ;
+ * </pre>
+ */
+ public final native void glfGetStringBoundsF (
+ int fd,
+ String s,
+ float[] minx,
+ float[] miny,
+ float[] maxx,
+ float[] maxy
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfGetStringBounds ( const char * s , float * minx , float * miny , float * maxx , float * maxy ) ;
+ * </pre>
+ */
+ public final native void glfGetStringBounds (
+ String s,
+ float[] minx,
+ float[] miny,
+ float[] maxx,
+ float[] maxy
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfSetSymbolSpace ( float sp ) ;
+ * </pre>
+ */
+ public final native void glfSetSymbolSpace (
+ float sp
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ float glfGetSymbolSpace ( ) ;
+ * </pre>
+ */
+ public final native float glfGetSymbolSpace (
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfSetSpaceSize ( float sp ) ;
+ * </pre>
+ */
+ public final native void glfSetSpaceSize (
+ float sp
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ float glfGetSpaceSize ( ) ;
+ * </pre>
+ */
+ public final native float glfGetSpaceSize (
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfSetSymbolDepth ( float dpth ) ;
+ * </pre>
+ */
+ public final native void glfSetSymbolDepth (
+ float dpth
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ float glfGetSymbolDepth ( ) ;
+ * </pre>
+ */
+ public final native float glfGetSymbolDepth (
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ int glfSetCurrentFont ( int Font_Descriptor ) ;
+ * </pre>
+ */
+ public final native int glfSetCurrentFont (
+ int Font_Descriptor
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ int glfSetCurrentBFont ( int Font_Descriptor ) ;
+ * </pre>
+ */
+ public final native int glfSetCurrentBFont (
+ int Font_Descriptor
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ int glfGetCurrentFont ( ) ;
+ * </pre>
+ */
+ public final native int glfGetCurrentFont (
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ int glfGetCurrentBFont ( ) ;
+ * </pre>
+ */
+ public final native int glfGetCurrentBFont (
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfSetAnchorPoint ( int anchp ) ;
+ * </pre>
+ */
+ public final native void glfSetAnchorPoint (
+ int anchp
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfSetContourColor ( float r , float g , float b , float a ) ;
+ * </pre>
+ */
+ public final native void glfSetContourColor (
+ float r,
+ float g,
+ float b,
+ float a
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfEnable ( int what ) ;
+ * </pre>
+ */
+ public final native void glfEnable (
+ int what
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfDisable ( int what ) ;
+ * </pre>
+ */
+ public final native void glfDisable (
+ int what
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfSetConsoleParam ( int width , int height ) ;
+ * </pre>
+ */
+ public final native void glfSetConsoleParam (
+ int width,
+ int height
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ int glfSetConsoleFont ( int Font_Descriptor ) ;
+ * </pre>
+ */
+ public final native int glfSetConsoleFont (
+ int Font_Descriptor
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfConsoleClear ( ) ;
+ * </pre>
+ */
+ public final native void glfConsoleClear (
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfPrint ( const char * s , int lenght ) ;
+ * </pre>
+ */
+ public final native void glfPrint (
+ String s,
+ int lenght
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfPrintString ( const char * s ) ;
+ * </pre>
+ */
+ public final native void glfPrintString (
+ String s
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfPrintChar ( char s ) ;
+ * </pre>
+ */
+ public final native void glfPrintChar (
+ byte s
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfConsoleDraw ( ) ;
+ * </pre>
+ */
+ public final native void glfConsoleDraw (
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfSetCursorBlinkRate ( int Rate ) ;
+ * </pre>
+ */
+ public final native void glfSetCursorBlinkRate (
+ int Rate
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfStringCentering ( GLboolean center ) ;
+ * </pre>
+ */
+ public final native void glfStringCentering (
+ boolean center
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ GLboolean glfGetStringCentering ( ) ;
+ * </pre>
+ */
+ public final native boolean glfGetStringCentering (
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfBitmapStringCentering ( GLboolean center ) ;
+ * </pre>
+ */
+ public final native void glfBitmapStringCentering (
+ boolean center
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ GLboolean glfBitmapGetStringCentering ( ) ;
+ * </pre>
+ */
+ public final native boolean glfBitmapGetStringCentering (
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfStringDirection ( GLuint direction ) ;
+ * </pre>
+ */
+ public final native void glfStringDirection (
+ int direction
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ GLuint glfGetStringDirection ( ) ;
+ * </pre>
+ */
+ public final native int glfGetStringDirection (
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfSetRotateAngle ( float angle ) ;
+ * </pre>
+ */
+ public final native void glfSetRotateAngle (
+ float angle
+ ) ;
+
+/**
+ * Original Function-Prototype :
+ * <pre>
+ void glfSetBRotateAngle ( float angle ) ;
+ * </pre>
+ */
+ public final native void glfSetBRotateAngle (
+ float angle
+ ) ;
+
+/* C2J Parser Version 2.2: Java program parsed successfully. */
+
+
+}
+