aboutsummaryrefslogtreecommitdiffstats
path: root/make/config/jogl/glu-CustomJavaCode-base.java
diff options
context:
space:
mode:
Diffstat (limited to 'make/config/jogl/glu-CustomJavaCode-base.java')
-rw-r--r--make/config/jogl/glu-CustomJavaCode-base.java34
1 files changed, 20 insertions, 14 deletions
diff --git a/make/config/jogl/glu-CustomJavaCode-base.java b/make/config/jogl/glu-CustomJavaCode-base.java
index 49722b469..e8047d9d7 100644
--- a/make/config/jogl/glu-CustomJavaCode-base.java
+++ b/make/config/jogl/glu-CustomJavaCode-base.java
@@ -83,11 +83,16 @@ static {
Class _gl2Class=null;
Class _gl2es1Class=null;
try {
- _gl2Class = Class.forName("javax.media.opengl.glu.gl2.GLUgl2");
- _gl2es1Class = Class.forName("javax.media.opengl.glu.gl2es1.GLUgl2es1");
+ final ClassLoader cl = GLU.class.getClassLoader();
+ _gl2Class = Class.forName("javax.media.opengl.glu.gl2.GLUgl2", false, cl);
+ _gl2es1Class = Class.forName("javax.media.opengl.glu.gl2es1.GLUgl2es1", false, cl);
} catch (Throwable t) {}
gl2Class = _gl2Class;
gl2es1Class = _gl2es1Class;
+ /** Not required nor forced
+ if( !initializeImpl() ) {
+ throw new RuntimeException("Initialization failure");
+ } */
}
/**
@@ -123,14 +128,7 @@ public static final GLU createGLU(GL gl) throws GLException {
public GLU()
{
- this.project = new ProjectFloat();
-}
-
-public void destroy() {
- if(null!=this.project) {
- this.project.destroy();
- this.project=null;
- }
+ project = new ProjectFloat();
}
public static final GL getCurrentGL() throws GLException {
@@ -1250,16 +1248,24 @@ public final void gluDisk(GLUquadric quad, double inner, double outer, int slice
/** Option (throws GLException if not available in profile). <br> Interface to C language function: <br> <code> GLUquadric * gluNewQuadric(void); </code> */
public final GLUquadric gluNewQuadric() {
- return gluNewQuadric(false);
+ return gluNewQuadric(false, null, 0);
+}
+
+public final GLUquadric gluNewQuadric(boolean useGLSL, ShaderState st) {
+ return gluNewQuadric(useGLSL, st, 0);
+}
+
+public final GLUquadric gluNewQuadric(boolean useGLSL, int shaderProgram) {
+ return gluNewQuadric(useGLSL, null, shaderProgram);
}
-public final GLUquadric gluNewQuadric(boolean useGLSL) {
+private final GLUquadric gluNewQuadric(boolean useGLSL, ShaderState st, int shaderProgram) {
GL gl = getCurrentGL();
if(useGLSL && !gl.isGL2ES2()) {
throw new GLException("GLUquadric GLSL implementation not supported for profile: "+gl);
}
validateGLUquadricImpl();
- return new GLUquadricImpl(gl, useGLSL);
+ return new GLUquadricImpl(gl, useGLSL, st, shaderProgram);
}
/** Option (throws GLException if not available in profile). <br> Interface to C language function: <br> <code> void gluPartialDisk(GLUquadric * quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep); </code> */
@@ -1302,7 +1308,7 @@ public final void gluSphere(GLUquadric quad, double radius, int slices, int stac
// Projection routines
//
-private ProjectFloat project;
+private final ProjectFloat project;
public void gluOrtho2D(float left, float right, float bottom, float top) {
project.gluOrtho2D(getCurrentGL().getGL2ES1(), left, right, bottom, top);