From 7288aa58ff166cbccc914697e6e994dc8eb05ec9 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Thu, 5 Feb 2004 17:14:51 +0000 Subject: [PATCH] Removed native GLU --- src/java/org/lwjgl/opengl/GLU.java | 204 ---------- .../org/lwjgl/opengl/OpenGLException.java | 7 + src/native/common/Makefile.am | 4 +- src/native/common/checkGLerror.h | 4 +- src/native/common/extgl.cpp | 200 +--------- src/native/common/extgl.h | 349 ------------------ src/native/common/org_lwjgl_opengl_GLU.cpp | 176 --------- src/native/common/org_lwjgl_opengl_GLU.h | 101 ----- 8 files changed, 15 insertions(+), 1030 deletions(-) delete mode 100644 src/java/org/lwjgl/opengl/GLU.java delete mode 100644 src/native/common/org_lwjgl_opengl_GLU.cpp delete mode 100644 src/native/common/org_lwjgl_opengl_GLU.h diff --git a/src/java/org/lwjgl/opengl/GLU.java b/src/java/org/lwjgl/opengl/GLU.java deleted file mode 100644 index 2a4825a7..00000000 --- a/src/java/org/lwjgl/opengl/GLU.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Copyright (c) 2002 Lightweight Java Game Library Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'Light Weight Java Game Library' nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package org.lwjgl.opengl; - -import org.lwjgl.Sys; - -import java.nio.ByteBuffer; -import java.nio.IntBuffer; -import java.nio.DoubleBuffer; - -/** - * $Id$ - * - * GL Utilities library. - * - * @author cix_foo - * @version $Revision$ - */ -public abstract class GLU implements GLUConstants { - - static { - System.loadLibrary(Sys.getLibraryName()); - } - - public static native String gluErrorString(int errCode); - - public static native String gluGetString(int name); - - public static native void gluOrtho2D( - double left, - double right, - double bottom, - double top); - - public static native void gluPerspective( - double fovy, - double aspect, - double zNear, - double zFar); - - public static void gluPickMatrix(double x, double y, double width, double height, IntBuffer viewport) { - ngluPickMatrix(x, y, width, height, viewport, viewport.position()); - } - private static native void ngluPickMatrix(double x, double y, double width, double height, IntBuffer viewport, int viewport_offset); - - public static native void gluLookAt( - double eyex, - double eyey, - double eyez, - double centerx, - double centery, - double centerz, - double upx, - double upy, - double upz); - - public static int gluProject( - double objx, - double objy, - double objz, - DoubleBuffer modelMatrix, - DoubleBuffer projMatrix, - IntBuffer viewport, - DoubleBuffer win - ) { - return ngluProject(objx, objy, objz, modelMatrix, modelMatrix.position(), projMatrix, projMatrix.position(), viewport, viewport.position(), win, win.position()); - } - - private static native int ngluProject( - double objx, - double objy, - double objz, - DoubleBuffer modelMatrix, - int modelMatrix_offset, - DoubleBuffer projMatrix, - int projMatrix_offset, - IntBuffer viewport, - int viewport_ofset, - DoubleBuffer win, - int win_offset - ); - - public static int gluUnProject( - double winx, - double winy, - double winz, - DoubleBuffer modelMatrix, - DoubleBuffer projMatrix, - IntBuffer viewport, - DoubleBuffer obj - ) { - return ngluUnProject(winx, winy, winz, modelMatrix, modelMatrix.position(), projMatrix, projMatrix.position(), viewport, viewport.position(), obj, obj.position()); - } - - private static native int ngluUnProject( - double winx, - double winy, - double winz, - DoubleBuffer modelMatrix, - int modelMatrix_offset, - DoubleBuffer projMatrix, - int projMatrix_offset, - IntBuffer viewport, - int viewport_offset, - DoubleBuffer obj, - int obj_offset - ); - - public static int gluScaleImage( - int format, - int widthin, - int heightin, - int typein, - ByteBuffer datain, - int widthout, int heightout, int typeout, ByteBuffer dataout - ) { - return ngluScaleImage(format, widthin, heightin, typein, datain, datain.position(), widthout, heightout, typeout, dataout, dataout.position()); - } - - private static native int ngluScaleImage( - int format, - int widthin, - int heightin, - int typein, - ByteBuffer datain, - int datain_offset, - int widthout, int heightout, int typeout, ByteBuffer dataout, int dataout_offset - ); - - public static int gluBuild1DMipmaps( - int target, - int components, - int width, - int format, - int type, - ByteBuffer data - ) { - return ngluBuild1DMipmaps(target, components, width, format, type, data, data.position()); - } - - private static native int ngluBuild1DMipmaps( - int target, - int components, - int width, - int format, - int type, - ByteBuffer data, - int data_offset - ); - - public static int gluBuild2DMipmaps( - int target, - int components, - int width, - int height, - int format, - int type, - ByteBuffer data - ) { - return ngluBuild2DMipmaps(target, components, width, height, format, type, data, data.position()); - } - - private static native int ngluBuild2DMipmaps( - int target, - int components, - int width, - int height, - int format, - int type, - ByteBuffer data, - int data_offset - ); - -} diff --git a/src/java/org/lwjgl/opengl/OpenGLException.java b/src/java/org/lwjgl/opengl/OpenGLException.java index 3a2bccc1..d35a1e3b 100644 --- a/src/java/org/lwjgl/opengl/OpenGLException.java +++ b/src/java/org/lwjgl/opengl/OpenGLException.java @@ -43,6 +43,13 @@ package org.lwjgl.opengl; */ public class OpenGLException extends RuntimeException { + /** + * Constructor for OpenGLException. + */ + public OpenGLException(int gl_error_code) { + super("GL error code: " + gl_error_code); + } + /** * Constructor for OpenGLException. */ diff --git a/src/native/common/Makefile.am b/src/native/common/Makefile.am index 099f7c1b..54be5f04 100644 --- a/src/native/common/Makefile.am +++ b/src/native/common/Makefile.am @@ -40,7 +40,5 @@ COMMON = \ org_lwjgl_opengl_GL12.h \ org_lwjgl_opengl_GL13.cpp \ org_lwjgl_opengl_GL13.h \ - org_lwjgl_opengl_GL14.cpp \ - org_lwjgl_opengl_GLU.cpp \ - org_lwjgl_opengl_GLU.h + org_lwjgl_opengl_GL14.cpp diff --git a/src/native/common/checkGLerror.h b/src/native/common/checkGLerror.h index 5f99bc2f..cd54823d 100644 --- a/src/native/common/checkGLerror.h +++ b/src/native/common/checkGLerror.h @@ -20,7 +20,9 @@ int err = glGetError(); \ if (err != GL_NO_ERROR) { \ jclass cls = env->FindClass("org/lwjgl/opengl/OpenGLException"); \ - env->ThrowNew(cls, (const char *)gluErrorString(err)); \ + jmethodID ctor = env->GetMethodID(cls, "", "(I)V"); \ + jthrowable exception = (jthrowable)env->NewObject(cls, ctor, err); \ + env->Throw(exception); \ env->DeleteLocalRef(cls); \ } \ } \ diff --git a/src/native/common/extgl.cpp b/src/native/common/extgl.cpp index 9b0417ae..9df1876f 100755 --- a/src/native/common/extgl.cpp +++ b/src/native/common/extgl.cpp @@ -128,66 +128,6 @@ aglResetLibraryPROC aglResetLibrary = NULL; aglSurfaceTexturePROC aglSurfaceTexture = NULL; #endif -gluBeginCurvePROC gluBeginCurve = NULL; -gluBeginPolygonPROC gluBeginPolygon = NULL; -gluBeginSurfacePROC gluBeginSurface = NULL; -gluBeginTrimPROC gluBeginTrim = NULL; -gluBuild1DMipmapLevelsPROC gluBuild1DMipmapLevels = NULL; -gluBuild1DMipmapsPROC gluBuild1DMipmaps = NULL; -gluBuild2DMipmapLevelsPROC gluBuild2DMipmapLevels = NULL; -gluBuild2DMipmapsPROC gluBuild2DMipmaps = NULL; -gluBuild3DMipmapLevelsPROC gluBuild3DMipmapLevels = NULL; -gluBuild3DMipmapsPROC gluBuild3DMipmaps = NULL; -gluCheckExtensionPROC gluCheckExtension = NULL; -gluCylinderPROC gluCylinder = NULL; -gluDeleteNurbsRendererPROC gluDeleteNurbsRenderer = NULL; -gluDeleteQuadricPROC gluDeleteQuadric = NULL; -gluDeleteTessPROC gluDeleteTess = NULL; -gluDiskPROC gluDisk = NULL; -gluEndCurvePROC gluEndCurve = NULL; -gluEndPolygonPROC gluEndPolygon = NULL; -gluEndSurfacePROC gluEndSurface = NULL; -gluEndTrimPROC gluEndTrim = NULL; -gluErrorStringPROC gluErrorString = NULL; -gluGetNurbsPropertyPROC gluGetNurbsProperty = NULL; -gluGetStringPROC gluGetString = NULL; -gluGetTessPropertyPROC gluGetTessProperty = NULL; -gluLoadSamplingMatricesPROC gluLoadSamplingMatrices = NULL; -gluLookAtPROC gluLookAt = NULL; -gluNewNurbsRendererPROC gluNewNurbsRenderer = NULL; -gluNewQuadricPROC gluNewQuadric = NULL; -gluNewTessPROC gluNewTess = NULL; -gluNextContourPROC gluNextContour = NULL; -gluNurbsCallbackPROC gluNurbsCallback = NULL; -gluNurbsCallbackDataPROC gluNurbsCallbackData = NULL; -gluNurbsCallbackDataEXTPROC gluNurbsCallbackDataEXT = NULL; -gluNurbsCurvePROC gluNurbsCurve = NULL; -gluNurbsPropertyPROC gluNurbsProperty = NULL; -gluNurbsSurfacePROC gluNurbsSurface = NULL; -gluOrtho2DPROC gluOrtho2D = NULL; -gluPartialDiskPROC gluPartialDisk = NULL; -gluPerspectivePROC gluPerspective = NULL; -gluPickMatrixPROC gluPickMatrix = NULL; -gluProjectPROC gluProject = NULL; -gluPwlCurvePROC gluPwlCurve = NULL; -gluQuadricCallbackPROC gluQuadricCallback = NULL; -gluQuadricDrawStylePROC gluQuadricDrawStyle = NULL; -gluQuadricNormalsPROC gluQuadricNormals = NULL; -gluQuadricOrientationPROC gluQuadricOrientation = NULL; -gluQuadricTexturePROC gluQuadricTexture = NULL; -gluScaleImagePROC gluScaleImage = NULL; -gluSpherePROC gluSphere = NULL; -gluTessBeginContourPROC gluTessBeginContour = NULL; -gluTessBeginPolygonPROC gluTessBeginPolygon = NULL; -gluTessCallbackPROC gluTessCallback = NULL; -gluTessEndContourPROC gluTessEndContour = NULL; -gluTessEndPolygonPROC gluTessEndPolygon = NULL; -gluTessNormalPROC gluTessNormal = NULL; -gluTessPropertyPROC gluTessProperty = NULL; -gluTessVertexPROC gluTessVertex = NULL; -gluUnProjectPROC gluUnProject = NULL; -gluUnProject4PROC gluUnProject4 = NULL; - /* function variables */ /*glAccumPROC glAccum = NULL; @@ -643,12 +583,10 @@ struct ExtensionTypes extgl_Extensions; #ifdef _WIN32 HMODULE lib_gl_handle = NULL; -HMODULE lib_glu_handle = NULL; #endif #ifdef _X11 void * lib_gl_handle = NULL; -void * lib_glu_handle = NULL; #endif #ifdef _AGL @@ -759,11 +697,8 @@ void *extgl_GetProcAddress(const char *name) t = GetProcAddress(lib_gl_handle, name); if (t == NULL) { - t = GetProcAddress(lib_glu_handle, name); - if (t == NULL) { - printfDebug("Could not locate symbol %s\n", name); - extgl_error = true; - } + printfDebug("Could not locate symbol %s\n", name); + extgl_error = true; } } return t; @@ -776,11 +711,8 @@ void *extgl_GetProcAddress(const char *name) t = dlsym(lib_gl_handle, name); if (t == NULL) { - t = dlsym(lib_glu_handle, name); - if (t == NULL) { - printfDebug("Could not locate symbol %s\n", name); - extgl_error = true; - } + printfDebug("Could not locate symbol %s\n", name); + extgl_error = true; } } return t; @@ -1049,12 +981,6 @@ static bool GLXQueryExtension(JNIEnv* env, jobject ext_set, Display *disp, int s } #endif -/** returns true if the extention is available */ -static bool GLUQueryExtension(JNIEnv *env, jobject ext_set, const char *name) -{ - return QueryExtension(env, ext_set, gluGetString(GLU_EXTENSIONS), name); -} - /** returns true if the extention is available */ static bool GLQueryExtension(JNIEnv *env, jobject ext_set, const char *name) { @@ -1093,83 +1019,6 @@ static void extgl_InitEXTCullVertex(JNIEnv *env, jobject ext_set) } */ -static void extgl_InitGLU12(void) -{ - gluBeginCurve = (gluBeginCurvePROC) extgl_GetProcAddress("gluBeginCurve"); - gluBeginPolygon = (gluBeginPolygonPROC) extgl_GetProcAddress("gluBeginPolygon"); - gluBeginSurface = (gluBeginSurfacePROC) extgl_GetProcAddress("gluBeginSurface"); - gluBeginTrim = (gluBeginTrimPROC) extgl_GetProcAddress("gluBeginTrim"); - gluBuild1DMipmaps = (gluBuild1DMipmapsPROC) extgl_GetProcAddress("gluBuild1DMipmaps"); - gluBuild2DMipmaps = (gluBuild2DMipmapsPROC) extgl_GetProcAddress("gluBuild2DMipmaps"); - gluCylinder = (gluCylinderPROC) extgl_GetProcAddress("gluCylinder"); - gluDeleteNurbsRenderer = (gluDeleteNurbsRendererPROC) extgl_GetProcAddress("gluDeleteNurbsRenderer"); - gluDeleteQuadric = (gluDeleteQuadricPROC) extgl_GetProcAddress("gluDeleteQuadric"); - gluDeleteTess = (gluDeleteTessPROC) extgl_GetProcAddress("gluDeleteTess"); - gluDisk = (gluDiskPROC) extgl_GetProcAddress("gluDisk"); - gluEndCurve = (gluEndCurvePROC) extgl_GetProcAddress("gluEndCurve"); - gluEndPolygon = (gluEndPolygonPROC) extgl_GetProcAddress("gluEndPolygon"); - gluEndSurface = (gluEndSurfacePROC) extgl_GetProcAddress("gluEndSurface"); - gluEndTrim = (gluEndTrimPROC) extgl_GetProcAddress("gluEndTrim"); - gluErrorString = (gluErrorStringPROC) extgl_GetProcAddress("gluErrorString"); - gluGetNurbsProperty = (gluGetNurbsPropertyPROC) extgl_GetProcAddress("gluGetNurbsProperty"); - gluGetString = (gluGetStringPROC) extgl_GetProcAddress("gluGetString"); - gluGetTessProperty = (gluGetTessPropertyPROC) extgl_GetProcAddress("gluGetTessProperty"); - gluLoadSamplingMatrices = (gluLoadSamplingMatricesPROC) extgl_GetProcAddress("gluLoadSamplingMatrices"); - gluLookAt = (gluLookAtPROC) extgl_GetProcAddress("gluLookAt"); - gluNewNurbsRenderer = (gluNewNurbsRendererPROC) extgl_GetProcAddress("gluNewNurbsRenderer"); - gluNewQuadric = (gluNewQuadricPROC) extgl_GetProcAddress("gluNewQuadric"); - gluNewTess = (gluNewTessPROC) extgl_GetProcAddress("gluNewTess"); - gluNextContour = (gluNextContourPROC) extgl_GetProcAddress("gluNextContour"); - gluNurbsCallback = (gluNurbsCallbackPROC) extgl_GetProcAddress("gluNurbsCallback"); - gluNurbsCurve = (gluNurbsCurvePROC) extgl_GetProcAddress("gluNurbsCurve"); - gluNurbsProperty = (gluNurbsPropertyPROC) extgl_GetProcAddress("gluNurbsProperty"); - gluNurbsSurface = (gluNurbsSurfacePROC) extgl_GetProcAddress("gluNurbsSurface"); - gluOrtho2D = (gluOrtho2DPROC) extgl_GetProcAddress("gluOrtho2D"); - gluPartialDisk = (gluPartialDiskPROC) extgl_GetProcAddress("gluPartialDisk"); - gluPerspective = (gluPerspectivePROC) extgl_GetProcAddress("gluPerspective"); - gluPickMatrix = (gluPickMatrixPROC) extgl_GetProcAddress("gluPickMatrix"); - gluProject = (gluProjectPROC) extgl_GetProcAddress("gluProject"); - gluPwlCurve = (gluPwlCurvePROC) extgl_GetProcAddress("gluPwlCurve"); - gluQuadricCallback = (gluQuadricCallbackPROC) extgl_GetProcAddress("gluQuadricCallback"); - gluQuadricDrawStyle = (gluQuadricDrawStylePROC) extgl_GetProcAddress("gluQuadricDrawStyle"); - gluQuadricNormals = (gluQuadricNormalsPROC) extgl_GetProcAddress("gluQuadricNormals"); - gluQuadricOrientation = (gluQuadricOrientationPROC) extgl_GetProcAddress("gluQuadricOrientation"); - gluQuadricTexture = (gluQuadricTexturePROC) extgl_GetProcAddress("gluQuadricTexture"); - gluScaleImage = (gluScaleImagePROC) extgl_GetProcAddress("gluScaleImage"); - gluSphere = (gluSpherePROC) extgl_GetProcAddress("gluSphere"); - gluTessBeginContour = (gluTessBeginContourPROC) extgl_GetProcAddress("gluTessBeginContour"); - gluTessBeginPolygon = (gluTessBeginPolygonPROC) extgl_GetProcAddress("gluTessBeginPolygon"); - gluTessCallback = (gluTessCallbackPROC) extgl_GetProcAddress("gluTessCallback"); - gluTessEndContour = (gluTessEndContourPROC) extgl_GetProcAddress("gluTessEndContour"); - gluTessEndPolygon = (gluTessEndPolygonPROC) extgl_GetProcAddress("gluTessEndPolygon"); - gluTessNormal = (gluTessNormalPROC) extgl_GetProcAddress("gluTessNormal"); - gluTessProperty = (gluTessPropertyPROC) extgl_GetProcAddress("gluTessProperty"); - gluTessVertex = (gluTessVertexPROC) extgl_GetProcAddress("gluTessVertex"); - gluUnProject = (gluUnProjectPROC) extgl_GetProcAddress("gluUnProject"); -} - -static void extgl_InitGLU13(JNIEnv *env, jobject ext_set) -{ - if (extgl_Extensions.GLU13 != 1) - return; - gluUnProject4 = (gluUnProject4PROC) extgl_GetProcAddress("gluUnProject4"); - gluBuild1DMipmapLevels = (gluBuild1DMipmapLevelsPROC) extgl_GetProcAddress("gluBuild1DMipmapLevels"); - gluBuild2DMipmapLevels = (gluBuild2DMipmapLevelsPROC) extgl_GetProcAddress("gluBuild2DMipmapLevels"); - gluBuild3DMipmapLevels = (gluBuild3DMipmapLevelsPROC) extgl_GetProcAddress("gluBuild3DMipmapLevels"); - gluBuild3DMipmaps = (gluBuild3DMipmapsPROC) extgl_GetProcAddress("gluBuild3DMipmaps"); - gluNurbsCallbackData = (gluNurbsCallbackDataPROC) extgl_GetProcAddress("gluNurbsCallbackData"); - gluCheckExtension = (gluCheckExtensionPROC) extgl_GetProcAddress("gluCheckExtension"); - EXTGL_SANITY_CHECK(env, ext_set, GLU13) -} - -/*static void extgl_InitEXTNurbsTesselator(JNIEnv *env, jobject ext_set) -{ - if (!extgl_Extensions.GLU_EXT_nurbs_tessellator) - return; - gluNurbsCallbackDataEXT = (gluNurbsCallbackDataEXTPROC) extgl_GetProcAddress("gluNurbsCallbackDataEXT"); - EXTGL_SANITY_CHECK(env, ext_set, GLU_EXT_nurbs_tessellator) -} -*/ #ifdef _X11 static void extgl_InitGLX13(JNIEnv *env, jobject ext_set) { @@ -1258,30 +1107,6 @@ bool extgl_InitGLX(JNIEnv *env, jobject ext_set, Display *disp, int screen) #endif -static void extgl_InitGLUSupportedExtensions(JNIEnv *env, jobject ext_set) -{ - const char *s = (const char *)gluGetString(GLU_VERSION); - if (!s) - return; - s = strstr(s, "1."); - extgl_Extensions.GLU12 = 0; - extgl_Extensions.GLU13 = 0; - if (s != NULL) - { - if( s[2] >= '3' ) - { - extgl_Extensions.GLU12 = 1; - extgl_Extensions.GLU13 = 1; - } - if( s[2] == '2' ) - { - extgl_Extensions.GLU12 = 1; - } - } - extgl_Extensions.GLU_EXT_nurbs_tessellator = GLUQueryExtension(env, ext_set, "GLU_EXT_nurbs_tessellator"); - extgl_Extensions.GLU_EXT_object_space_tess = GLUQueryExtension(env, ext_set, "GLU_EXT_object_space_tess"); -} - static void extgl_InitSupportedExtensions(JNIEnv *env, jobject ext_set) { char *s = (char*) glGetString(GL_VERSION); @@ -1471,11 +1296,9 @@ bool extgl_Initialize(JNIEnv *env, jobject ext_set) { extgl_error = false; extgl_InitOpenGL1_1(); - extgl_InitGLU12(); if (extgl_error) return false; - extgl_InitGLUSupportedExtensions(env, ext_set); extgl_InitSupportedExtensions(env, ext_set); //extgl_InitEXTNurbsTesselator(env, ext_set); @@ -1541,8 +1364,6 @@ bool extgl_Initialize(JNIEnv *env, jobject ext_set) extgl_InitOpenGL1_3(env, ext_set); extgl_InitOpenGL1_4(env, ext_set); - extgl_InitGLU13(env, ext_set); - #ifdef _WIN32 /* load WGL extensions */ extgl_InitializeWGL(env, ext_set); @@ -1572,12 +1393,6 @@ bool extgl_Open() printfDebug("Error loading libGL.so.1: %s\n", dlerror()); return false; } - lib_glu_handle = dlopen("libGLU.so.1", RTLD_LAZY | RTLD_GLOBAL); - if (lib_glu_handle == NULL) { - printfDebug("Error loading libGLU.so.1: %s\n", dlerror()); - dlclose(lib_gl_handle); - return false; - } return true; } @@ -1591,11 +1406,6 @@ bool extgl_Open(void) lib_gl_handle = LoadLibrary("opengl32.dll"); if (lib_gl_handle == NULL) return false; - lib_glu_handle = LoadLibrary("glu32.dll"); - if (lib_glu_handle == NULL) { - FreeLibrary(lib_gl_handle); - return false; - } return true; } #endif /* WIN32 */ @@ -1603,12 +1413,10 @@ bool extgl_Open(void) void extgl_Close(void) { #ifdef _X11 - dlclose(lib_glu_handle); dlclose(lib_gl_handle); #endif #ifdef _WIN32 FreeLibrary(lib_gl_handle); - FreeLibrary(lib_glu_handle); #endif #ifdef _AGL aglUnloadFramework(opengl_bundle_ref); diff --git a/src/native/common/extgl.h b/src/native/common/extgl.h index dc0defb4..5f9be131 100644 --- a/src/native/common/extgl.h +++ b/src/native/common/extgl.h @@ -191,8 +191,6 @@ WGL_NV_render_texture_rectangle /* for mingw compatibility */ typedef void (*_GLfuncptr)(); -typedef void (*_GLUfuncptr)(); - #define GLAPI extern #define GLAPIENTRY @@ -817,349 +815,6 @@ extern aglSurfaceTexturePROC aglSurfaceTexture; #endif /* _AGL */ -/*************************************************************/ -/* GLU functions */ - - -/* Boolean */ -#define GLU_FALSE 0 -#define GLU_TRUE 1 - -/* Version */ -#define GLU_VERSION_1_1 1 -#define GLU_VERSION_1_2 1 -#define GLU_VERSION_1_3 1 - -/* StringName */ -#define GLU_VERSION 100800 -#define GLU_EXTENSIONS 100801 - -/* ErrorCode */ -#define GLU_INVALID_ENUM 100900 -#define GLU_INVALID_VALUE 100901 -#define GLU_OUT_OF_MEMORY 100902 -#define GLU_INVALID_OPERATION 100904 - -/* NurbsDisplay */ -/* GLU_FILL */ -#define GLU_OUTLINE_POLYGON 100240 -#define GLU_OUTLINE_PATCH 100241 - -/* NurbsCallback */ -#define GLU_NURBS_ERROR 100103 -#define GLU_ERROR 100103 -#define GLU_NURBS_BEGIN 100164 -#define GLU_NURBS_BEGIN_EXT 100164 -#define GLU_NURBS_VERTEX 100165 -#define GLU_NURBS_VERTEX_EXT 100165 -#define GLU_NURBS_NORMAL 100166 -#define GLU_NURBS_NORMAL_EXT 100166 -#define GLU_NURBS_COLOR 100167 -#define GLU_NURBS_COLOR_EXT 100167 -#define GLU_NURBS_TEXTURE_COORD 100168 -#define GLU_NURBS_TEX_COORD_EXT 100168 -#define GLU_NURBS_END 100169 -#define GLU_NURBS_END_EXT 100169 -#define GLU_NURBS_BEGIN_DATA 100170 -#define GLU_NURBS_BEGIN_DATA_EXT 100170 -#define GLU_NURBS_VERTEX_DATA 100171 -#define GLU_NURBS_VERTEX_DATA_EXT 100171 -#define GLU_NURBS_NORMAL_DATA 100172 -#define GLU_NURBS_NORMAL_DATA_EXT 100172 -#define GLU_NURBS_COLOR_DATA 100173 -#define GLU_NURBS_COLOR_DATA_EXT 100173 -#define GLU_NURBS_TEXTURE_COORD_DATA 100174 -#define GLU_NURBS_TEX_COORD_DATA_EXT 100174 -#define GLU_NURBS_END_DATA 100175 -#define GLU_NURBS_END_DATA_EXT 100175 - -/* NurbsError */ -#define GLU_NURBS_ERROR1 100251 -#define GLU_NURBS_ERROR2 100252 -#define GLU_NURBS_ERROR3 100253 -#define GLU_NURBS_ERROR4 100254 -#define GLU_NURBS_ERROR5 100255 -#define GLU_NURBS_ERROR6 100256 -#define GLU_NURBS_ERROR7 100257 -#define GLU_NURBS_ERROR8 100258 -#define GLU_NURBS_ERROR9 100259 -#define GLU_NURBS_ERROR10 100260 -#define GLU_NURBS_ERROR11 100261 -#define GLU_NURBS_ERROR12 100262 -#define GLU_NURBS_ERROR13 100263 -#define GLU_NURBS_ERROR14 100264 -#define GLU_NURBS_ERROR15 100265 -#define GLU_NURBS_ERROR16 100266 -#define GLU_NURBS_ERROR17 100267 -#define GLU_NURBS_ERROR18 100268 -#define GLU_NURBS_ERROR19 100269 -#define GLU_NURBS_ERROR20 100270 -#define GLU_NURBS_ERROR21 100271 -#define GLU_NURBS_ERROR22 100272 -#define GLU_NURBS_ERROR23 100273 -#define GLU_NURBS_ERROR24 100274 -#define GLU_NURBS_ERROR25 100275 -#define GLU_NURBS_ERROR26 100276 -#define GLU_NURBS_ERROR27 100277 -#define GLU_NURBS_ERROR28 100278 -#define GLU_NURBS_ERROR29 100279 -#define GLU_NURBS_ERROR30 100280 -#define GLU_NURBS_ERROR31 100281 -#define GLU_NURBS_ERROR32 100282 -#define GLU_NURBS_ERROR33 100283 -#define GLU_NURBS_ERROR34 100284 -#define GLU_NURBS_ERROR35 100285 -#define GLU_NURBS_ERROR36 100286 -#define GLU_NURBS_ERROR37 100287 - -/* NurbsProperty */ -#define GLU_AUTO_LOAD_MATRIX 100200 -#define GLU_CULLING 100201 -#define GLU_SAMPLING_TOLERANCE 100203 -#define GLU_DISPLAY_MODE 100204 -#define GLU_PARAMETRIC_TOLERANCE 100202 -#define GLU_SAMPLING_METHOD 100205 -#define GLU_U_STEP 100206 -#define GLU_V_STEP 100207 -#define GLU_NURBS_MODE 100160 -#define GLU_NURBS_MODE_EXT 100160 -#define GLU_NURBS_TESSELLATOR 100161 -#define GLU_NURBS_TESSELLATOR_EXT 100161 -#define GLU_NURBS_RENDERER 100162 -#define GLU_NURBS_RENDERER_EXT 100162 - -/* NurbsSampling */ -#define GLU_OBJECT_PARAMETRIC_ERROR 100208 -#define GLU_OBJECT_PARAMETRIC_ERROR_EXT 100208 -#define GLU_OBJECT_PATH_LENGTH 100209 -#define GLU_OBJECT_PATH_LENGTH_EXT 100209 -#define GLU_PATH_LENGTH 100215 -#define GLU_PARAMETRIC_ERROR 100216 -#define GLU_DOMAIN_DISTANCE 100217 - -/* NurbsTrim */ -#define GLU_MAP1_TRIM_2 100210 -#define GLU_MAP1_TRIM_3 100211 - -/* QuadricDrawStyle */ -#define GLU_POINT 100010 -#define GLU_LINE 100011 -#define GLU_FILL 100012 -#define GLU_SILHOUETTE 100013 - -/* QuadricCallback */ -/* GLU_ERROR */ - -/* QuadricNormal */ -#define GLU_SMOOTH 100000 -#define GLU_FLAT 100001 -#define GLU_NONE 100002 - -/* QuadricOrientation */ -#define GLU_OUTSIDE 100020 -#define GLU_INSIDE 100021 - -/* TessCallback */ -#define GLU_TESS_BEGIN 100100 -#define GLU_BEGIN 100100 -#define GLU_TESS_VERTEX 100101 -#define GLU_VERTEX 100101 -#define GLU_TESS_END 100102 -#define GLU_END 100102 -#define GLU_TESS_ERROR 100103 -#define GLU_TESS_EDGE_FLAG 100104 -#define GLU_EDGE_FLAG 100104 -#define GLU_TESS_COMBINE 100105 -#define GLU_TESS_BEGIN_DATA 100106 -#define GLU_TESS_VERTEX_DATA 100107 -#define GLU_TESS_END_DATA 100108 -#define GLU_TESS_ERROR_DATA 100109 -#define GLU_TESS_EDGE_FLAG_DATA 100110 -#define GLU_TESS_COMBINE_DATA 100111 - -/* TessContour */ -#define GLU_CW 100120 -#define GLU_CCW 100121 -#define GLU_INTERIOR 100122 -#define GLU_EXTERIOR 100123 -#define GLU_UNKNOWN 100124 - -/* TessProperty */ -#define GLU_TESS_WINDING_RULE 100140 -#define GLU_TESS_BOUNDARY_ONLY 100141 -#define GLU_TESS_TOLERANCE 100142 - -/* TessError */ -#define GLU_TESS_ERROR1 100151 -#define GLU_TESS_ERROR2 100152 -#define GLU_TESS_ERROR3 100153 -#define GLU_TESS_ERROR4 100154 -#define GLU_TESS_ERROR5 100155 -#define GLU_TESS_ERROR6 100156 -#define GLU_TESS_ERROR7 100157 -#define GLU_TESS_ERROR8 100158 -#define GLU_TESS_MISSING_BEGIN_POLYGON 100151 -#define GLU_TESS_MISSING_BEGIN_CONTOUR 100152 -#define GLU_TESS_MISSING_END_POLYGON 100153 -#define GLU_TESS_MISSING_END_CONTOUR 100154 -#define GLU_TESS_COORD_TOO_LARGE 100155 -#define GLU_TESS_NEED_COMBINE_CALLBACK 100156 - -/* TessWinding */ -#define GLU_TESS_WINDING_ODD 100130 -#define GLU_TESS_WINDING_NONZERO 100131 -#define GLU_TESS_WINDING_POSITIVE 100132 -#define GLU_TESS_WINDING_NEGATIVE 100133 -#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134 - -/*************************************************************/ -#ifdef __cplusplus - -class GLUnurbs; -class GLUquadric; -class GLUtesselator; - -typedef class GLUnurbs GLUnurbsObj; -typedef class GLUquadric GLUquadricObj; -typedef class GLUtesselator GLUtesselatorObj; -typedef class GLUtesselator GLUtriangulatorObj; - -#else - -typedef struct GLUnurbs GLUnurbs; -typedef struct GLUquadric GLUquadric; -typedef struct GLUtesselator GLUtesselator; - -typedef struct GLUnurbs GLUnurbsObj; -typedef struct GLUquadric GLUquadricObj; -typedef struct GLUtesselator GLUtesselatorObj; -typedef struct GLUtesselator GLUtriangulatorObj; - -#endif - -#define GLU_TESS_MAX_COORD 1.0e150 - -typedef void (APIENTRY * gluBeginCurvePROC) (GLUnurbs* nurb); -typedef void (APIENTRY * gluBeginPolygonPROC) (GLUtesselator* tess); -typedef void (APIENTRY * gluBeginSurfacePROC) (GLUnurbs* nurb); -typedef void (APIENTRY * gluBeginTrimPROC) (GLUnurbs* nurb); -typedef GLint (APIENTRY * gluBuild1DMipmapLevelsPROC) (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data); -typedef GLint (APIENTRY * gluBuild1DMipmapsPROC) (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void *data); -typedef GLint (APIENTRY * gluBuild2DMipmapLevelsPROC) (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data); -typedef GLint (APIENTRY * gluBuild2DMipmapsPROC) (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data); -typedef GLint (APIENTRY * gluBuild3DMipmapLevelsPROC) (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data); -typedef GLint (APIENTRY * gluBuild3DMipmapsPROC) (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); -typedef GLboolean (APIENTRY * gluCheckExtensionPROC) (const GLubyte *extName, const GLubyte *extString); -typedef void (APIENTRY * gluCylinderPROC) (GLUquadric* quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks); -typedef void (APIENTRY * gluDeleteNurbsRendererPROC) (GLUnurbs* nurb); -typedef void (APIENTRY * gluDeleteQuadricPROC) (GLUquadric* quad); -typedef void (APIENTRY * gluDeleteTessPROC) (GLUtesselator* tess); -typedef void (APIENTRY * gluDiskPROC) (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops); -typedef void (APIENTRY * gluEndCurvePROC) (GLUnurbs* nurb); -typedef void (APIENTRY * gluEndPolygonPROC) (GLUtesselator* tess); -typedef void (APIENTRY * gluEndSurfacePROC) (GLUnurbs* nurb); -typedef void (APIENTRY * gluEndTrimPROC) (GLUnurbs* nurb); -typedef const GLubyte * (APIENTRY * gluErrorStringPROC) (GLenum error); -typedef void (APIENTRY * gluGetNurbsPropertyPROC) (GLUnurbs* nurb, GLenum property, GLfloat* data); -typedef const GLubyte * (APIENTRY * gluGetStringPROC) (GLenum name); -typedef void (APIENTRY * gluGetTessPropertyPROC) (GLUtesselator* tess, GLenum which, GLdouble* data); -typedef void (APIENTRY * gluLoadSamplingMatricesPROC) (GLUnurbs* nurb, const GLfloat *model, const GLfloat *perspective, const GLint *view); -typedef void (APIENTRY * gluLookAtPROC) (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ); -typedef GLUnurbs * (APIENTRY * gluNewNurbsRendererPROC) (void); -typedef GLUquadric * (APIENTRY * gluNewQuadricPROC) (void); -typedef GLUtesselator * (APIENTRY * gluNewTessPROC) (void); -typedef void (APIENTRY * gluNextContourPROC) (GLUtesselator* tess, GLenum type); -typedef void (APIENTRY * gluNurbsCallbackPROC) (GLUnurbs* nurb, GLenum which, _GLUfuncptr CallBackFunc); -typedef void (APIENTRY * gluNurbsCallbackDataPROC) (GLUnurbs* nurb, GLvoid* userData); -typedef void (APIENTRY * gluNurbsCallbackDataEXTPROC) (GLUnurbs* nurb, GLvoid* userData); -typedef void (APIENTRY * gluNurbsCurvePROC) (GLUnurbs* nurb, GLint knotCount, GLfloat *knots, GLint stride, GLfloat *control, GLint order, GLenum type); -typedef void (APIENTRY * gluNurbsPropertyPROC) (GLUnurbs* nurb, GLenum property, GLfloat value); -typedef void (APIENTRY * gluNurbsSurfacePROC) (GLUnurbs* nurb, GLint sKnotCount, GLfloat* sKnots, GLint tKnotCount, GLfloat* tKnots, GLint sStride, GLint tStride, GLfloat* control, GLint sOrder, GLint tOrder, GLenum type); -typedef void (APIENTRY * gluOrtho2DPROC) (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top); -typedef void (APIENTRY * gluPartialDiskPROC) (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep); -typedef void (APIENTRY * gluPerspectivePROC) (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar); -typedef void (APIENTRY * gluPickMatrixPROC) (GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint *viewport); -typedef GLint (APIENTRY * gluProjectPROC) (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ); -typedef void (APIENTRY * gluPwlCurvePROC) (GLUnurbs* nurb, GLint count, GLfloat* data, GLint stride, GLenum type); -typedef void (APIENTRY * gluQuadricCallbackPROC) (GLUquadric* quad, GLenum which, _GLUfuncptr CallBackFunc); -typedef void (APIENTRY * gluQuadricDrawStylePROC) (GLUquadric* quad, GLenum draw); -typedef void (APIENTRY * gluQuadricNormalsPROC) (GLUquadric* quad, GLenum normal); -typedef void (APIENTRY * gluQuadricOrientationPROC) (GLUquadric* quad, GLenum orientation); -typedef void (APIENTRY * gluQuadricTexturePROC) (GLUquadric* quad, GLboolean texture); -typedef GLint (APIENTRY * gluScaleImagePROC) (GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid* dataOut); -typedef void (APIENTRY * gluSpherePROC) (GLUquadric* quad, GLdouble radius, GLint slices, GLint stacks); -typedef void (APIENTRY * gluTessBeginContourPROC) (GLUtesselator* tess); -typedef void (APIENTRY * gluTessBeginPolygonPROC) (GLUtesselator* tess, GLvoid* data); -typedef void (APIENTRY * gluTessCallbackPROC) (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc); -typedef void (APIENTRY * gluTessEndContourPROC) (GLUtesselator* tess); -typedef void (APIENTRY * gluTessEndPolygonPROC) (GLUtesselator* tess); -typedef void (APIENTRY * gluTessNormalPROC) (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ); -typedef void (APIENTRY * gluTessPropertyPROC) (GLUtesselator* tess, GLenum which, GLdouble data); -typedef void (APIENTRY * gluTessVertexPROC) (GLUtesselator* tess, GLdouble *location, GLvoid* data); -typedef GLint (APIENTRY * gluUnProjectPROC) (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX, GLdouble* objY, GLdouble* objZ); -typedef GLint (APIENTRY * gluUnProject4PROC) (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble near, GLdouble far, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW); - -extern gluBeginCurvePROC gluBeginCurve; -extern gluBeginPolygonPROC gluBeginPolygon; -extern gluBeginSurfacePROC gluBeginSurface; -extern gluBeginTrimPROC gluBeginTrim; -extern gluBuild1DMipmapLevelsPROC gluBuild1DMipmapLevels; -extern gluBuild1DMipmapsPROC gluBuild1DMipmaps; -extern gluBuild2DMipmapLevelsPROC gluBuild2DMipmapLevels; -extern gluBuild2DMipmapsPROC gluBuild2DMipmaps; -extern gluBuild3DMipmapLevelsPROC gluBuild3DMipmapLevels; -extern gluBuild3DMipmapsPROC gluBuild3DMipmaps; -extern gluCheckExtensionPROC gluCheckExtension; -extern gluCylinderPROC gluCylinder; -extern gluDeleteNurbsRendererPROC gluDeleteNurbsRenderer; -extern gluDeleteQuadricPROC gluDeleteQuadric; -extern gluDeleteTessPROC gluDeleteTess; -extern gluDiskPROC gluDisk; -extern gluEndCurvePROC gluEndCurve; -extern gluEndPolygonPROC gluEndPolygon; -extern gluEndSurfacePROC gluEndSurface; -extern gluEndTrimPROC gluEndTrim; -extern gluErrorStringPROC gluErrorString; -extern gluGetNurbsPropertyPROC gluGetNurbsProperty; -extern gluGetStringPROC gluGetString; -extern gluGetTessPropertyPROC gluGetTessProperty; -extern gluLoadSamplingMatricesPROC gluLoadSamplingMatrices; -extern gluLookAtPROC gluLookAt; -extern gluNewNurbsRendererPROC gluNewNurbsRenderer; -extern gluNewQuadricPROC gluNewQuadric; -extern gluNewTessPROC gluNewTess; -extern gluNextContourPROC gluNextContour; -extern gluNurbsCallbackPROC gluNurbsCallback; -extern gluNurbsCallbackDataPROC gluNurbsCallbackData; -extern gluNurbsCallbackDataEXTPROC gluNurbsCallbackDataEXT; -extern gluNurbsCurvePROC gluNurbsCurve; -extern gluNurbsPropertyPROC gluNurbsProperty; -extern gluNurbsSurfacePROC gluNurbsSurface; -extern gluOrtho2DPROC gluOrtho2D; -extern gluPartialDiskPROC gluPartialDisk; -extern gluPerspectivePROC gluPerspective; -extern gluPickMatrixPROC gluPickMatrix; -extern gluProjectPROC gluProject; -extern gluPwlCurvePROC gluPwlCurve; -extern gluQuadricCallbackPROC gluQuadricCallback; -extern gluQuadricDrawStylePROC gluQuadricDrawStyle; -extern gluQuadricNormalsPROC gluQuadricNormals; -extern gluQuadricOrientationPROC gluQuadricOrientation; -extern gluQuadricTexturePROC gluQuadricTexture; -extern gluScaleImagePROC gluScaleImage; -extern gluSpherePROC gluSphere; -extern gluTessBeginContourPROC gluTessBeginContour; -extern gluTessBeginPolygonPROC gluTessBeginPolygon; -extern gluTessCallbackPROC gluTessCallback; -extern gluTessEndContourPROC gluTessEndContour; -extern gluTessEndPolygonPROC gluTessEndPolygon; -extern gluTessNormalPROC gluTessNormal; -extern gluTessPropertyPROC gluTessProperty; -extern gluTessVertexPROC gluTessVertex; -extern gluUnProjectPROC gluUnProject; -extern gluUnProject4PROC gluUnProject4; - - #define GL_VERSION_1_1 1 #define GL_ACCUM 0x0100 #define GL_LOAD 0x0101 @@ -3511,10 +3166,6 @@ struct ExtensionTypes bool OpenGL12; bool OpenGL13; bool OpenGL14; - bool GLU12; - bool GLU13; - bool GLU_EXT_nurbs_tessellator; - bool GLU_EXT_object_space_tess; bool GL_ARB_imaging; bool GL_ARB_depth_texture; diff --git a/src/native/common/org_lwjgl_opengl_GLU.cpp b/src/native/common/org_lwjgl_opengl_GLU.cpp deleted file mode 100644 index e74f23f9..00000000 --- a/src/native/common/org_lwjgl_opengl_GLU.cpp +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (c) 2002 Light Weight Java Game Library Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'Light Weight Java Game Library' nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * $Id$ - * - * GLU library. - * - * @author cix_foo - * @version $Revision$ - */ - -#include "org_lwjgl_opengl_GLU.h" -#include "extgl.h" -#include "checkGLerror.h" - - -/* - * Class: org_lwjgl_opengl_GLU - * Method: getString - */ -JNIEXPORT jstring JNICALL Java_org_lwjgl_opengl_GLU_gluGetString(JNIEnv * env, jclass clazz, jint p0) -{ - const char * msg = (const char *) gluGetString((GLint) p0); - jstring ret = env->NewStringUTF(msg); - return ret; -} - -/* - * Class: org_lwjgl_opengl_GLU - * Method: errorString - */ -JNIEXPORT jstring JNICALL Java_org_lwjgl_opengl_GLU_gluErrorString(JNIEnv * env, jclass clazz, jint p0) -{ - const GLubyte * msg = gluErrorString((GLint) p0); - jstring ret = env->NewStringUTF((const char *) msg); - return ret; -} - -/* - * Class: org_lwjgl_opengl_GLU - * Method: ortho2D - */ -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLU_gluOrtho2D(JNIEnv * env, jclass clazz, jdouble p0, jdouble p1, jdouble p2, jdouble p3) -{ - gluOrtho2D((GLdouble) p0, (GLdouble) p1, (GLdouble) p2, (GLdouble) p3); - CHECK_GL_ERROR -} - -/* - * Class: org_lwjgl_opengl_GLU - * Method: perspective - */ -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLU_gluPerspective(JNIEnv * env, jclass clazz, jdouble p0, jdouble p1, jdouble p2, jdouble p3) -{ - gluPerspective((GLdouble) p0, (GLdouble) p1, (GLdouble) p2, (GLdouble) p3); - CHECK_GL_ERROR -} - -/* - * Class: org_lwjgl_opengl_GLU - * Method: pickMatrix - */ -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLU_ngluPickMatrix(JNIEnv * env, jclass clazz, jdouble p0, jdouble p1, jdouble p2, jdouble p3, jobject buffer, jint offset) -{ - GLint *address = offset + (GLint *)env->GetDirectBufferAddress(buffer); - gluPickMatrix((GLdouble) p0, (GLdouble) p1, (GLdouble) p2, (GLdouble) p3, address); - CHECK_GL_ERROR -} - -/* - * Class: org_lwjgl_opengl_GLU - * Method: lookAt - */ -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLU_gluLookAt(JNIEnv * env, jclass clazz, jdouble p0, jdouble p1, jdouble p2, jdouble p3, jdouble p4, jdouble p5, jdouble p6, jdouble p7, jdouble p8) -{ - gluLookAt((GLdouble) p0, (GLdouble) p1, (GLdouble) p2, (GLdouble) p3, (GLdouble) p4, (GLdouble) p5, (GLdouble) p6, (GLdouble) p7, (GLdouble) p8); - CHECK_GL_ERROR -} - -/* - * Class: org_lwjgl_opengl_GLU - * Method: project - */ -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GLU_ngluProject(JNIEnv * env, jclass clazz, jdouble p0, jdouble p1, jdouble p2, jobject buffer, jint buffer_offset, jobject buffer2, jint buffer2_offset, jobject buffer3, jint buffer3_offset, jobject win_buffer, jint win_offset) -{ - const GLdouble *address = buffer_offset + (const GLdouble *)env->GetDirectBufferAddress(buffer); - const GLdouble *address2 = buffer2_offset + (const GLdouble *)env->GetDirectBufferAddress(buffer2); - const GLint *address3 = buffer3_offset + (const GLint *)env->GetDirectBufferAddress(buffer3); - GLdouble *win_address = win_offset + (GLdouble *)env->GetDirectBufferAddress(win_buffer); - jint ret = (jint) gluProject((GLdouble) p0, (GLdouble) p1, (GLdouble) p2, address, address2, address3, win_address, win_address + 1, win_address + 2); - CHECK_GL_ERROR - return ret; -} - -/* - * Class: org_lwjgl_opengl_GLU - * Method: unProject - */ -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GLU_ngluUnProject(JNIEnv * env, jclass clazz, jdouble p0, jdouble p1, jdouble p2, jobject buffer, jint buffer_offset, jobject buffer2, jint buffer2_offset, jobject buffer3, jint buffer3_offset, jobject obj_buffer, jint obj_buffer_offset) -{ - const GLdouble *address = buffer_offset + (const GLdouble *)env->GetDirectBufferAddress(buffer); - const GLdouble *address2 = buffer2_offset + (const GLdouble *)env->GetDirectBufferAddress(buffer2); - const GLint *address3 = buffer3_offset + (const GLint *)env->GetDirectBufferAddress(buffer3); - GLdouble *obj_address = obj_buffer_offset + (GLdouble *)env->GetDirectBufferAddress(obj_buffer); - jint ret = (jint) gluUnProject((GLdouble) p0, (GLdouble) p1, (GLdouble) p2, address, address2, address3, obj_address, obj_address + 1, obj_address + 2); - CHECK_GL_ERROR - return ret; -} - -/* - * Class: org_lwjgl_opengl_GLU - * Method: scaleImage - */ -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GLU_ngluScaleImage(JNIEnv * env, jclass clazz, jint p0, jint p1, jint p2, jint p3, jobject buffer, jint offset, jint p5, jint p6, jint p7, jobject buffer2, jint offset2) -{ - const void *address = (const void *)(offset + (const GLbyte *)env->GetDirectBufferAddress(buffer)); - void *address2 = (void *)(offset2 + (GLbyte *)env->GetDirectBufferAddress(buffer2)); - jint ret = (jint) gluScaleImage((GLint) p0, (GLint) p1, (GLint) p2, (GLint) p3, address, (GLint) p5, (GLint) p6, (GLint) p7, address2); - CHECK_GL_ERROR - return ret; -} - -/* - * Class: org_lwjgl_opengl_GLU - * Method: build1DMipmaps - */ -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GLU_ngluBuild1DMipmaps(JNIEnv * env, jclass clazz, jint p0, jint p1, jint p2, jint p3, jint p4, jobject buffer, jint offset) -{ - const void *address = (const void *)(offset + (const GLbyte *)env->GetDirectBufferAddress(buffer)); - jint ret = (jint) gluBuild1DMipmaps((GLint) p0, (GLint) p1, (GLint) p2, (GLint) p3, (GLint) p4, address); - CHECK_GL_ERROR - return ret; -} - -/* - * Class: org_lwjgl_opengl_GLU - * Method: build2DMipmaps - */ -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GLU_ngluBuild2DMipmaps(JNIEnv * env, jclass clazz, jint p0, jint p1, jint p2, jint p3, jint p4, jint p5, jobject buffer, jint offset) -{ - const void *address = (const void *)(offset + (const GLbyte *)env->GetDirectBufferAddress(buffer)); - jint ret = (jint) gluBuild2DMipmaps((GLint) p0, (GLint) p1, (GLint) p2, (GLint) p3, (GLint) p4, (GLint) p5, address); - CHECK_GL_ERROR - return ret; -} - diff --git a/src/native/common/org_lwjgl_opengl_GLU.h b/src/native/common/org_lwjgl_opengl_GLU.h deleted file mode 100644 index 5f73353b..00000000 --- a/src/native/common/org_lwjgl_opengl_GLU.h +++ /dev/null @@ -1,101 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class org_lwjgl_opengl_GLU */ - -#ifndef _Included_org_lwjgl_opengl_GLU -#define _Included_org_lwjgl_opengl_GLU -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: org_lwjgl_opengl_GLU - * Method: gluErrorString - * Signature: (I)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_org_lwjgl_opengl_GLU_gluErrorString - (JNIEnv *, jclass, jint); - -/* - * Class: org_lwjgl_opengl_GLU - * Method: gluGetString - * Signature: (I)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_org_lwjgl_opengl_GLU_gluGetString - (JNIEnv *, jclass, jint); - -/* - * Class: org_lwjgl_opengl_GLU - * Method: gluOrtho2D - * Signature: (DDDD)V - */ -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLU_gluOrtho2D - (JNIEnv *, jclass, jdouble, jdouble, jdouble, jdouble); - -/* - * Class: org_lwjgl_opengl_GLU - * Method: gluPerspective - * Signature: (DDDD)V - */ -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLU_gluPerspective - (JNIEnv *, jclass, jdouble, jdouble, jdouble, jdouble); - -/* - * Class: org_lwjgl_opengl_GLU - * Method: ngluPickMatrix - * Signature: (DDDDLjava/nio/IntBuffer;I)V - */ -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLU_ngluPickMatrix - (JNIEnv *, jclass, jdouble, jdouble, jdouble, jdouble, jobject, jint); - -/* - * Class: org_lwjgl_opengl_GLU - * Method: gluLookAt - * Signature: (DDDDDDDDD)V - */ -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLU_gluLookAt - (JNIEnv *, jclass, jdouble, jdouble, jdouble, jdouble, jdouble, jdouble, jdouble, jdouble, jdouble); - -/* - * Class: org_lwjgl_opengl_GLU - * Method: ngluProject - * Signature: (DDDLjava/nio/DoubleBuffer;ILjava/nio/DoubleBuffer;ILjava/nio/IntBuffer;ILjava/nio/DoubleBuffer;I)I - */ -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GLU_ngluProject - (JNIEnv *, jclass, jdouble, jdouble, jdouble, jobject, jint, jobject, jint, jobject, jint, jobject, jint); - -/* - * Class: org_lwjgl_opengl_GLU - * Method: ngluUnProject - * Signature: (DDDLjava/nio/DoubleBuffer;ILjava/nio/DoubleBuffer;ILjava/nio/IntBuffer;ILjava/nio/DoubleBuffer;I)I - */ -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GLU_ngluUnProject - (JNIEnv *, jclass, jdouble, jdouble, jdouble, jobject, jint, jobject, jint, jobject, jint, jobject, jint); - -/* - * Class: org_lwjgl_opengl_GLU - * Method: ngluScaleImage - * Signature: (IIIILjava/nio/ByteBuffer;IIIILjava/nio/ByteBuffer;I)I - */ -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GLU_ngluScaleImage - (JNIEnv *, jclass, jint, jint, jint, jint, jobject, jint, jint, jint, jint, jobject, jint); - -/* - * Class: org_lwjgl_opengl_GLU - * Method: ngluBuild1DMipmaps - * Signature: (IIIIILjava/nio/ByteBuffer;I)I - */ -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GLU_ngluBuild1DMipmaps - (JNIEnv *, jclass, jint, jint, jint, jint, jint, jobject, jint); - -/* - * Class: org_lwjgl_opengl_GLU - * Method: ngluBuild2DMipmaps - * Signature: (IIIIIILjava/nio/ByteBuffer;I)I - */ -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GLU_ngluBuild2DMipmaps - (JNIEnv *, jclass, jint, jint, jint, jint, jint, jint, jobject, jint); - -#ifdef __cplusplus -} -#endif -#endif