summaryrefslogtreecommitdiffstats
path: root/src/demos/context/DualContext.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2005-09-25 07:26:00 +0000
committerKenneth Russel <[email protected]>2005-09-25 07:26:00 +0000
commit02510865a2ff5468f11df23afcba370789fc6372 (patch)
tree0ed5ff426c87969a18e9314265e16d9547e3d1f7 /src/demos/context/DualContext.java
parent5f73e61aea5b72ba75d3cccac848bfb2a2a799d5 (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/context/DualContext.java')
-rwxr-xr-xsrc/demos/context/DualContext.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/demos/context/DualContext.java b/src/demos/context/DualContext.java
index 01ea2ba..0f9fea9 100755
--- a/src/demos/context/DualContext.java
+++ b/src/demos/context/DualContext.java
@@ -57,6 +57,7 @@ public class DualContext extends Canvas {
private GLDrawable drawable;
private GLContext context1;
private GLContext context2;
+ private GLU glu;
private GLUT glut;
private int repaintNum;
@@ -65,6 +66,7 @@ public class DualContext extends Canvas {
drawable = GLDrawableFactory.getFactory().getGLDrawable(this, capabilities, null);
context1 = drawable.createContext(null);
context2 = drawable.createContext(null);
+ glu = new GLU();
glut = new GLUT();
}
@@ -87,7 +89,6 @@ public class DualContext extends Canvas {
int res = context1.makeCurrent();
if (res != GLContext.CONTEXT_NOT_CURRENT) {
clearAndDraw(context1.getGL(),
- context1.getGLU(),
1, 0, 0,
0, 0, mid, height, str);
context1.release();
@@ -96,7 +97,6 @@ public class DualContext extends Canvas {
res = context2.makeCurrent();
if (res != GLContext.CONTEXT_NOT_CURRENT) {
clearAndDraw(context2.getGL(),
- context2.getGLU(),
0, 0, 1,
mid, 0, width - mid, height, str);
context2.release();
@@ -106,7 +106,6 @@ public class DualContext extends Canvas {
}
private void clearAndDraw(GL gl,
- GLU glu,
float br,
float bg,
float bb,
@@ -125,7 +124,7 @@ public class DualContext extends Canvas {
gl.glLoadIdentity();
glu.gluOrtho2D(x, x + width, y, y + height);
gl.glTranslatef(x + (width - length) / 2, y + height / 2, 0);
- glut.glutStrokeString(gl, GLUT.STROKE_ROMAN, str);
+ glut.glutStrokeString(GLUT.STROKE_ROMAN, str);
}
public static void main(String[] args) {