aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/games/jogl/impl/x11/X11GLContext.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2004-04-20 00:54:26 +0000
committerKenneth Russel <[email protected]>2004-04-20 00:54:26 +0000
commit2ee2b7b51e3e82553e7dc17fe1a04e8cec5be8bf (patch)
tree53998aa0ec7a8566d52dcabf89992d861213d675 /src/net/java/games/jogl/impl/x11/X11GLContext.java
parentbebb33d0f10c4d75f2bc3c48c82f4f4f1278ee7c (diff)
Added full-scene antialiasing (FSAA) support
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@111 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/net/java/games/jogl/impl/x11/X11GLContext.java')
-rw-r--r--src/net/java/games/jogl/impl/x11/X11GLContext.java66
1 files changed, 26 insertions, 40 deletions
diff --git a/src/net/java/games/jogl/impl/x11/X11GLContext.java b/src/net/java/games/jogl/impl/x11/X11GLContext.java
index f1de46d5a..e3bb4ce72 100644
--- a/src/net/java/games/jogl/impl/x11/X11GLContext.java
+++ b/src/net/java/games/jogl/impl/x11/X11GLContext.java
@@ -290,47 +290,33 @@ public abstract class X11GLContext extends GLContext {
int screen = 0; // FIXME: provide way to specify this?
XVisualInfo vis = null;
- if (chooser == null) {
- // Note: this code path isn't taken any more now that the
- // DefaultGLCapabilitiesChooser is present. However, it is being
- // left in place for debugging purposes.
- int[] attribs = X11GLContextFactory.glCapabilities2AttribList(capabilities);
- vis = GLX.glXChooseVisual(display, screen, attribs);
- if (vis == null) {
- throw new GLException("Unable to find matching visual");
- }
- if (DEBUG) {
- System.err.println("Chosen visual from glXChooseVisual:");
- System.err.println(X11GLContextFactory.xvi2GLCapabilities(display, vis));
- }
- } else {
- int[] count = new int[1];
- XVisualInfo template = new XVisualInfo();
- template.screen(screen);
- XVisualInfo[] infos = GLX.XGetVisualInfo(display, GLX.VisualScreenMask, template, count);
- if (infos == null) {
- throw new GLException("Error while enumerating available XVisualInfos");
- }
- GLCapabilities[] caps = new GLCapabilities[infos.length];
- for (int i = 0; i < infos.length; i++) {
- caps[i] = X11GLContextFactory.xvi2GLCapabilities(display, infos[i]);
- }
- int chosen = chooser.chooseCapabilities(capabilities, caps, -1);
- if (chosen < 0 || chosen >= caps.length) {
- throw new GLException("GLCapabilitiesChooser specified invalid index (expected 0.." + (caps.length - 1) + ")");
- }
- if (DEBUG) {
- System.err.println("Chosen visual (" + chosen + "):");
- System.err.println(caps[chosen]);
- }
- vis = infos[chosen];
- if (vis == null) {
- throw new GLException("GLCapabilitiesChooser chose an invalid visual");
- }
- // FIXME: the storage for the infos array is leaked (should
- // clean it up somehow when we're done with the visual we're
- // returning)
+ int[] count = new int[1];
+ XVisualInfo template = new XVisualInfo();
+ template.screen(screen);
+ XVisualInfo[] infos = GLX.XGetVisualInfo(display, GLX.VisualScreenMask, template, count);
+ if (infos == null) {
+ throw new GLException("Error while enumerating available XVisualInfos");
+ }
+ GLCapabilities[] caps = new GLCapabilities[infos.length];
+ for (int i = 0; i < infos.length; i++) {
+ caps[i] = X11GLContextFactory.xvi2GLCapabilities(display, infos[i]);
+ }
+ int chosen = chooser.chooseCapabilities(capabilities, caps, -1);
+ if (chosen < 0 || chosen >= caps.length) {
+ throw new GLException("GLCapabilitiesChooser specified invalid index (expected 0.." + (caps.length - 1) + ")");
+ }
+ if (DEBUG) {
+ System.err.println("Chosen visual (" + chosen + "):");
+ System.err.println(caps[chosen]);
}
+ vis = infos[chosen];
+ if (vis == null) {
+ throw new GLException("GLCapabilitiesChooser chose an invalid visual");
+ }
+ // FIXME: the storage for the infos array is leaked (should
+ // clean it up somehow when we're done with the visual we're
+ // returning)
+
return vis;
}
}