aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun/opengl/impl/x11
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2009-03-05 01:23:34 +0000
committerSven Gothel <[email protected]>2009-03-05 01:23:34 +0000
commit6833b2827d31a7bf08e22963b0d44be6470bdf07 (patch)
tree0a4db7776d9a1489d2bec772227a6410eeb62cf6 /src/classes/com/sun/opengl/impl/x11
parent8e2154eebe45e2f5fd6b0c6598a26ef16617e425 (diff)
- Fixed rootrel.build usage, this works properly through gluegen, jogl-demos and this build.
You can say -Drootrel.build=build-x86_64 for example. - Fixed jogl-demos in regard to this changeset - Gluegen - Fixed gluegen BuildComposablePipeline's 'getGL*' methods. Now they return 'this', otherwise the pipeline would be broken/removed. - Add BuildComposablePipeline CustomPipeline, which allows customized class composition with an interface (to be wrapped), prolog class and the downstream class. - Add GlueGen (incl. ant task) 'outputRootDir' to be able to set a top output root dir via ant / commandline. - GL fixed function - Package 'javax.media.opengl.sub.fixed.*' defines some fixed function interfaces. This allows partitioning of custom implementation. - Using gluegen's new CustomPipeline to compose a GLFixedFuncIf implementation, using a GL downstream and a GLFixedFuncHookIf prolog. The latter implements the fixed functionality. Example is the GLFixedFuncImpl. gl.getContext().setGL( new GLFixedFuncImpl(gl, new FixedFuncHook(gl.getGL2ES2())) ) ; or gl.getContext().setGL( new GLFixedFuncImpl(gl, gl.getGL2ES1()) ) ; - The example GLFixedFuncHookIf impl FixedFuncPipeline/ can be instantiated with custom shader code. - ES2 and all other interfaces only contain the original functionality, besides minor convenient data access methods. - Fix: GL2ES2 createCompileShader() and createLoadShader() is moved to ShaderCode util class. - Updated PMVMatrix - Add: GLAutoDrawable.setContext() .. and all it's implementations Necessary to set a new GLContext. - Add: GLContext getAttachedObject(int) and putAttachedObject(int, Object), to allow the user to attach application specific and TLS sensitive objects to the GLContext. - git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1856 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/opengl/impl/x11')
-rw-r--r--src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java16
-rw-r--r--src/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java10
-rw-r--r--src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXContext.java2
-rw-r--r--src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXDrawable.java12
4 files changed, 25 insertions, 15 deletions
diff --git a/src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java b/src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java
index d99b237e5..9ee93793a 100644
--- a/src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java
+++ b/src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java
@@ -278,11 +278,11 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
int[] res = new int[MAX_ATTRIBS];
int idx = 0;
if (pbuffer) {
- res[idx++] = GLXExt.GLX_DRAWABLE_TYPE;
- res[idx++] = GLXExt.GLX_PBUFFER_BIT;
+ res[idx++] = GLX.GLX_DRAWABLE_TYPE;
+ res[idx++] = GLX.GLX_PBUFFER_BIT;
- res[idx++] = GLXExt.GLX_RENDER_TYPE;
- res[idx++] = GLXExt.GLX_RGBA_BIT;
+ res[idx++] = GLX.GLX_RENDER_TYPE;
+ res[idx++] = GLX.GLX_RGBA_BIT;
} else {
res[idx++] = GLX.GLX_RGBA;
}
@@ -334,9 +334,9 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
res[idx++] = caps.getAccumAlphaBits();
}
if (isMultisampleAvailable && caps.getSampleBuffers()) {
- res[idx++] = GLXExt.GLX_SAMPLE_BUFFERS;
+ res[idx++] = GLX.GLX_SAMPLE_BUFFERS;
res[idx++] = GL.GL_TRUE;
- res[idx++] = GLXExt.GLX_SAMPLES;
+ res[idx++] = GLX.GLX_SAMPLES;
res[idx++] = caps.getNumSamples();
}
if (pbuffer) {
@@ -411,11 +411,11 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
caps.setAccumAlphaBits(ivalues[i]);
break;
- case GLXExt.GLX_SAMPLE_BUFFERS:
+ case GLX.GLX_SAMPLE_BUFFERS:
caps.setSampleBuffers(ivalues[i] != GL.GL_FALSE);
break;
- case GLXExt.GLX_SAMPLES:
+ case GLX.GLX_SAMPLES:
caps.setNumSamples(ivalues[i]);
break;
diff --git a/src/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java b/src/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java
index 23835f21b..ac228b68a 100644
--- a/src/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java
+++ b/src/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java
@@ -81,4 +81,14 @@ public class X11OnscreenGLXDrawable extends X11GLXDrawable {
protected void setChosenGLCapabilities(GLCapabilities caps) {
super.setChosenGLCapabilities(caps);
}
+
+ public void setRealized(boolean realized) {
+ if (realized) {
+ X11GLXDrawableFactory factory = (X11GLXDrawableFactory) getFactory();
+ NativeWindow window = getNativeWindow();
+ setChosenGLCapabilities(factory.lookupCapabilitiesByScreenAndVisualID(window.getScreenIndex(),
+ window.getVisualID()));
+ }
+ super.setRealized(realized);
+ }
}
diff --git a/src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXContext.java b/src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXContext.java
index 377d92f98..a32ee99d7 100644
--- a/src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXContext.java
+++ b/src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXContext.java
@@ -83,7 +83,7 @@ public class X11PbufferGLXContext extends X11GLXContext {
}
}
context = GLX.glXCreateNewContext(drawable.getNativeWindow().getDisplayHandle(),
- drawable.getFBConfig(), GLXExt.GLX_RGBA_TYPE, share, true);
+ drawable.getFBConfig(), GLX.GLX_RGBA_TYPE, share, true);
if (context == 0) {
throw new GLException("pbuffer creation error: glXCreateNewContext() failed");
}
diff --git a/src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXDrawable.java b/src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXDrawable.java
index 390ca96a4..d720fe7e8 100644
--- a/src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXDrawable.java
+++ b/src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXDrawable.java
@@ -149,9 +149,9 @@ public class X11PbufferGLXDrawable extends X11GLXDrawable {
// Create the p-buffer.
int niattribs = 0;
- iattributes[niattribs++] = GLXExt.GLX_PBUFFER_WIDTH;
+ iattributes[niattribs++] = GLX.GLX_PBUFFER_WIDTH;
iattributes[niattribs++] = nw.getWidth();
- iattributes[niattribs++] = GLXExt.GLX_PBUFFER_HEIGHT;
+ iattributes[niattribs++] = GLX.GLX_PBUFFER_HEIGHT;
iattributes[niattribs++] = nw.getHeight();
iattributes[niattribs++] = 0;
@@ -167,8 +167,8 @@ public class X11PbufferGLXDrawable extends X11GLXDrawable {
this.fbConfig = fbConfig;
// Pick innocent query values if multisampling or floating point buffers not available
- int sbAttrib = X11Util.isMultisampleAvailable() ? GLXExt.GLX_SAMPLE_BUFFERS: GLX.GLX_RED_SIZE;
- int samplesAttrib = X11Util.isMultisampleAvailable() ? GLXExt.GLX_SAMPLES: GLX.GLX_RED_SIZE;
+ int sbAttrib = X11Util.isMultisampleAvailable() ? GLX.GLX_SAMPLE_BUFFERS: GLX.GLX_RED_SIZE;
+ int samplesAttrib = X11Util.isMultisampleAvailable() ? GLX.GLX_SAMPLES: GLX.GLX_RED_SIZE;
int floatNV = capabilities.getPbufferFloatingPointBuffers() ? GLXExt.GLX_FLOAT_COMPONENTS_NV : GLX.GLX_RED_SIZE;
// Query the fbconfig to determine its GLCapabilities
@@ -196,9 +196,9 @@ public class X11PbufferGLXDrawable extends X11GLXDrawable {
// Determine the actual width and height we were able to create.
int[] tmp = new int[1];
- GLX.glXQueryDrawable(display, drawable, GLXExt.GLX_WIDTH, tmp, 0);
+ GLX.glXQueryDrawable(display, drawable, GLX.GLX_WIDTH, tmp, 0);
int width = tmp[0];
- GLX.glXQueryDrawable(display, drawable, GLXExt.GLX_HEIGHT, tmp, 0);
+ GLX.glXQueryDrawable(display, drawable, GLX.GLX_HEIGHT, tmp, 0);
int height = tmp[0];
nw.setSize(width, height);