Example #1
0
  public static void getGLXVersion(long display, int major[], int minor[]) {
    if (0 == display) {
      throw new GLException("null display handle");
    }
    if (major.length < 1 || minor.length < 1) {
      throw new GLException("passed int arrays size is not >= 1");
    }

    if (!GLX.glXQueryVersion(display, major, 0, minor, 0)) {
      throw new GLException("glXQueryVersion failed");
    }

    // Work around bugs in ATI's Linux drivers where they report they
    // only implement GLX version 1.2 on the server side
    if (major[0] == 1 && minor[0] == 2) {
      String str = GLX.glXGetClientString(display, GLX.GLX_VERSION);
      try {
        // e.g. "1.3"
        major[0] = Integer.valueOf(str.substring(0, 1)).intValue();
        minor[0] = Integer.valueOf(str.substring(2, 3)).intValue();
      } catch (Exception e) {
        major[0] = 1;
        minor[0] = 2;
      }
    }
  }
Example #2
0
 /**
  * Workaround for apparent issue with ATI's proprietary drivers where direct contexts still send
  * GLX tokens for GL calls
  */
 public static String getVendorName(long display) {
   return GLX.glXGetClientString(display, GLX.GLX_VENDOR);
 }
Example #3
0
 public static String getExtension(long display) {
   return GLX.glXGetClientString(display, GLX.GLX_EXTENSIONS);
 }