aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun/opengl/impl/x11/glx
diff options
context:
space:
mode:
Diffstat (limited to 'src/classes/com/sun/opengl/impl/x11/glx')
-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);