Package org.lwjgl

Examples of org.lwjgl.LWJGLException


    Set<String> supported_extensions = new HashSet<String>(256);
    int profileMask = GLContext.getSupportedExtensions(supported_extensions);
    if ( supported_extensions.contains("OpenGL31") && !(supported_extensions.contains("GL_ARB_compatibility") || (profileMask & GL32.GL_CONTEXT_COMPATIBILITY_PROFILE_BIT) != 0) )
      forwardCompatible = true;
    if (!GL11_initNativeFunctionAddresses(forwardCompatible))
      throw new LWJGLException("GL11 not supported");
    if (supported_extensions.contains("GL_ARB_fragment_program"))
      supported_extensions.add("GL_ARB_program");
    if (supported_extensions.contains("GL_ARB_pixel_buffer_object"))
      supported_extensions.add("GL_ARB_buffer_object");
    if (supported_extensions.contains("GL_ARB_vertex_buffer_object"))
View Full Code Here


  private static int globalErrorHandler(long display, long event_ptr, long error_display, long serial, long error_code, long request_code, long minor_code) throws LWJGLException {
    if (xembedded && request_code == X_SetInputFocus) return 0; // ignore X error in xembeded mode to fix a browser issue when dragging or switching tabs
   
    if (display == getDisplay()) {
      String error_msg = getErrorText(display, error_code);
      throw new LWJGLException("X Error - disp: 0x" + Long.toHexString(error_display) + " serial: " + serial + " error: " + error_msg + " request_code: " + request_code + " minor_code: " + minor_code);
    } else if (saved_error_handler != 0)
      return callErrorHandler(saved_error_handler, display, event_ptr);
    return 0;
  }
View Full Code Here

  }
  private static native int nGetGammaRampLength(long display, int screen) throws LWJGLException;

  public void setGammaRamp(FloatBuffer gammaRamp) throws LWJGLException {
    if (!isXF86VidModeSupported())
      throw new LWJGLException("No gamma ramp support (Missing XF86VM extension)");
    doSetGamma(convertToNativeRamp(gammaRamp));
  }
View Full Code Here

      Compiz.init();

      delete_atom = internAtom("WM_DELETE_WINDOW", false);
      current_displaymode_extension = getBestDisplayModeExtension();
      if (current_displaymode_extension == NONE)
        throw new LWJGLException("No display mode extension is available");
      DisplayMode[] modes = getAvailableDisplayModes();
      if (modes == null || modes.length == 0)
        throw new LWJGLException("No modes available");
      switch (current_displaymode_extension) {
        case XRANDR:
          savedXrandrConfig = AccessController.doPrivileged(new PrivilegedAction<Screen[]>() {
            public Screen[] run() {
              return XRandR.getConfiguration();
            }
          });
          saved_mode = getCurrentXRandrMode();
          break;
        case XF86VIDMODE:
          saved_mode = modes[0];
          break;
        default:
          throw new LWJGLException("Unknown display mode extension: " + current_displaymode_extension);
      }
      current_mode = saved_mode;
      saved_gamma = getCurrentGammaRamp();
      current_gamma = saved_gamma;
      return saved_mode;
View Full Code Here

                  final List output = Compiz.run(
                    "dbus-send", "--print-reply", "--type=method_call", "--dest=org.freedesktop.compiz", KEY, "org.freedesktop.compiz.get"
                  );

                  if ( output == null || output.size() < 2 )
                    throw new LWJGLException("Invalid Dbus reply.");

                  String line = (String)output.get(0);

                  if ( !line.startsWith("method return") )
                    throw new LWJGLException("Invalid Dbus reply.");

                  line = ((String)output.get(1)).trim(); // value
                  if ( !line.startsWith("boolean") || line.length() < 12)
                    throw new LWJGLException("Invalid Dbus reply.");

                  return "true".equalsIgnoreCase(line.substring("boolean".length() + 1));
                }

                public void setLegacyFullscreenSupport(final boolean state) throws LWJGLException {
                  if ( Compiz.run(
                    "dbus-send", "--type=method_call", "--dest=org.freedesktop.compiz", KEY, "org.freedesktop.compiz.set", "boolean:" + Boolean.toString(state)
                  ) == null )
                    throw new LWJGLException("Failed to apply Compiz LFS workaround.");
                }
              };
            } else {
              try {
                // Check if Gconf is available
                Runtime.getRuntime().exec("gconftool");

                providerName = "gconftool";
                provider = new Provider() {

                  private static final String KEY = "/apps/compiz/plugins/workarounds/allscreens/options/legacy_fullscreen";

                  public boolean hasLegacyFullscreenSupport() throws LWJGLException {
                    final List output = Compiz.run(new String[] {
                      "gconftool", "-g", KEY
                    });

                    if ( output == null || output.size() == 0 )
                      throw new LWJGLException("Invalid gconftool reply.");

                    return Boolean.parseBoolean(((String)output.get(0)).trim());
                  }

                  public void setLegacyFullscreenSupport(final boolean state) throws LWJGLException {
                    if ( Compiz.run(new String[] {
                      "gconftool", "-s", KEY, "-s", Boolean.toString(state), "-t", "bool"
                    }) == null )
                      throw new LWJGLException("Failed to apply Compiz LFS workaround.");

                    if ( state ) {
                      try {
                        // gconftool will not apply the workaround immediately, sleep a bit
                        // to make sure it will be ok when we create the window.
View Full Code Here

        try {
          final int exitValue = p.waitFor();
          if ( exitValue != 0 )
            return null;
        } catch (InterruptedException e) {
          throw new LWJGLException("Process interrupted.", e);
        }

        final BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));

        String line;
        while ( (line = br.readLine()) != null )
          output.add(line);

        br.close();
      } catch (final IOException e) {
        throw new LWJGLException("Process failed.", e);
      }

      return output;
    }
View Full Code Here

      if (equals(awt_mode, mode)) {
        requested_mode = awt_mode;
        return;
      }
    }
    throw new LWJGLException(mode + " is not supported");
  }
View Full Code Here

    hasParent = parent != null;
    long parent_hwnd = parent != null ? getHwnd(parent) : 0;
    this.hwnd = nCreateWindow(x, y, mode.getWidth(), mode.getHeight(), Display.isFullscreen() || isUndecorated(), parent != null, parent_hwnd);
    this.resizable=false;
    if (hwnd == 0) {
      throw new LWJGLException("Failed to create window");
    }
    this.hdc = getDC(hwnd);
    if (hdc == 0) {
      nDestroyWindow(hwnd);
      throw new LWJGLException("Failed to get dc");
    }

    try {
      if ( drawable instanceof DrawableGL ) {
        int format = WindowsPeerInfo.choosePixelFormat(getHdc(), 0, 0, (PixelFormat)drawable.getPixelFormat(), null, true, true, false, true);
View Full Code Here

    Set<String> supported_extensions = new HashSet<String>(256);
    int profileMask = GLContext.getSupportedExtensions(supported_extensions);
    if ( supported_extensions.contains("OpenGL31") && !(supported_extensions.contains("GL_ARB_compatibility") || (profileMask & GL32.GL_CONTEXT_COMPATIBILITY_PROFILE_BIT) != 0) )
      forwardCompatible = true;
    if (!GL11_initNativeFunctionAddresses(forwardCompatible))
      throw new LWJGLException("GL11 not supported");
    if (supported_extensions.contains("GL_ARB_fragment_program"))
      supported_extensions.add("GL_ARB_program");
    if (supported_extensions.contains("GL_ARB_pixel_buffer_object"))
      supported_extensions.add("GL_ARB_buffer_object");
    if (supported_extensions.contains("GL_ARB_vertex_buffer_object"))
View Full Code Here

      }
     
      return new Cursor(imageData.getTexWidth(), imageData.getTexHeight(), x, yspot, 1, buf.asIntBuffer(), null);
    } catch (Throwable e) {
      Log.info("Chances are you cursor is too small for this platform");
      throw new LWJGLException(e);
    }
  }
View Full Code Here

TOP

Related Classes of org.lwjgl.LWJGLException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.