diff options
author | Kenneth Russel <[email protected]> | 2005-09-25 07:26:00 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2005-09-25 07:26:00 +0000 |
commit | 02510865a2ff5468f11df23afcba370789fc6372 (patch) | |
tree | 0ed5ff426c87969a18e9314265e16d9547e3d1f7 /src/demos/vertexProgWarp/VertexProgWarp.java | |
parent | 5f73e61aea5b72ba75d3cccac848bfb2a2a799d5 (diff) |
Changed GLU to be a single class rather than a separate interface and
implementing class. Broke dependence from GLContext and GLAutoDrawable
down to GLU package; removed getGLU()/setGLU() routines. A GLU object
may now be instantiated via "new GLU()" at any point in the program.
When routines on it are called which require an OpenGL context, the
GLU implementation fetches the current GLContext and the GL object
from within it to do its work via the new public API
GLU.getCurrentGL(). This avoids needing to pass down a GL object
everywhere or to tie the GLU object to a particular GL object.
Restructured GLUT implementation similarly so GL and GLU objects do
not need to be passed to it as arguments any more. Restructured all
demos to conform to new APIs. Fixed bugs in GlueGen around new
functionality of being able to emit only an implementing class with no
associated interface. Deleted obsolete GLU-related .cfg files.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JSR-231@135 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
Diffstat (limited to 'src/demos/vertexProgWarp/VertexProgWarp.java')
-rw-r--r-- | src/demos/vertexProgWarp/VertexProgWarp.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/demos/vertexProgWarp/VertexProgWarp.java b/src/demos/vertexProgWarp/VertexProgWarp.java index d8ac581..cd39a01 100644 --- a/src/demos/vertexProgWarp/VertexProgWarp.java +++ b/src/demos/vertexProgWarp/VertexProgWarp.java @@ -139,12 +139,12 @@ public class VertexProgWarp extends Demo { private float freq = 8.0f; private float d = 4.0f; + private GLU glu = new GLU(); private ExaminerViewer viewer; public void init(GLAutoDrawable drawable) { initComplete = false; GL gl = drawable.getGL(); - GLU glu = drawable.getGLU(); float cc = 0.0f; gl.glClearColor(cc, cc, cc, 1); @@ -162,7 +162,7 @@ public class VertexProgWarp extends Demo { for(int i=0; i<NUM_OBJS; i++) { gl.glNewList(i+1, GL.GL_COMPILE); - drawObject(gl, glu, i); + drawObject(gl, i); gl.glEndList(); } @@ -246,7 +246,6 @@ public class VertexProgWarp extends Demo { time.update(); GL gl = drawable.getGL(); - GLU glu = drawable.getGLU(); gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); @@ -431,7 +430,7 @@ public class VertexProgWarp extends Demo { titleSetter.setTitle("SpaceWarp - " + programNames[program]); } - private void drawObject(GL gl, GLU glu, int which) { + private void drawObject(GL gl, int which) { switch(which) { case 0: drawSphere(gl, 0.5f, 100, 100); @@ -455,7 +454,7 @@ public class VertexProgWarp extends Demo { break; case 4: - drawCylinder(gl, glu); + drawCylinder(gl); break; } } @@ -605,7 +604,7 @@ public class VertexProgWarp extends Demo { } } - private void drawCylinder(GL gl, GLU glu) { + private void drawCylinder(GL gl) { GLUquadric quad; quad = glu.gluNewQuadric(); |