コード例 #1
0
ファイル: GLXUtil.java プロジェクト: rsantina/jogl
  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;
      }
    }
  }