Package org.lwjgl

Examples of org.lwjgl.LWJGLException


      case LWJGLUtil.PLATFORM_MACOSX:
        libname = "openal";
        library_names = new String[]{"openal.dylib"};
        break;
      default:
        throw new LWJGLException("Unknown platform: " + LWJGLUtil.getPlatform());
    }
    String[] oalPaths = LWJGLUtil.getLibraryPaths(libname, library_names, AL.class.getClassLoader());
    LWJGLUtil.log("Found " + oalPaths.length + " OpenAL paths");
    for ( String oalPath : oalPaths ) {
      try {
        nCreate(oalPath);
        created = true;
        init(deviceArguments, contextFrequency, contextRefresh, contextSynchronized, openDevice);
        break;
      } catch (LWJGLException e) {
        LWJGLUtil.log("Failed to load " + oalPath + ": " + e.getMessage());
      }
    }
    if (!created && LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_MACOSX) {
      // Try to load OpenAL from the framework instead
      nCreateDefault();
      created = true;
      init(deviceArguments, contextFrequency, contextRefresh, contextSynchronized, openDevice);
    }
    if (!created)
      throw new LWJGLException("Could not locate OpenAL library.");
  }
View Full Code Here


      ALC10.initNativeStubs();

      if(openDevice) {
        device = ALC10.alcOpenDevice(deviceArguments);
        if (device == null) {
          throw new LWJGLException("Could not open ALC device");
        }

        if (contextFrequency == -1) {
          context = ALC10.alcCreateContext(device, null);
        } else {
View Full Code Here

     scratchBuffer.rewind();
     scratchBuffer.get(sources = new int[channels]);

     // could we allocate all channels?
     if(AL10.alGetError() != AL10.AL_NO_ERROR) {
       throw new LWJGLException("Unable to allocate " + channels + " sources");
     }

     // we have sound
     soundOutput = true;
    } catch (LWJGLException le) {
View Full Code Here

*/
abstract class MacOSXPeerInfo extends PeerInfo {
  MacOSXPeerInfo(PixelFormat pixel_format, boolean use_display_bpp, boolean support_window, boolean support_pbuffer, boolean double_buffered) throws LWJGLException {
    super(createHandle());
    if (pixel_format.isFloatingPoint() && !LWJGLUtil.isMacOSXEqualsOrBetterThan(10, 4))
      throw new LWJGLException("Floating point pixel format requested, but is not supported");
    choosePixelFormat(pixel_format, use_display_bpp, support_window, support_pbuffer, double_buffered);
  }
View Full Code Here

   * @throws LWJGLException if the cursor could not be created for any reason
   */
  public Cursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException {
    synchronized (OpenGLPackageAccess.global_lock) {
      if ((getCapabilities() & CURSOR_ONE_BIT_TRANSPARENCY) == 0)
        throw new LWJGLException("Native cursors not supported");
      images = NondirectBufferWrapper.wrapBuffer(images, width*height*numImages);
      if (delays != null)
        delays = NondirectBufferWrapper.wrapBuffer(delays, numImages);
      if (!Mouse.isCreated())
        throw new IllegalStateException("Mouse must be created before creating cursor objects");
View Full Code Here

  /**
   * The default paint() operation makes the context current and calls paintGL() which should
   * be overridden to do GL operations.
   */
  public final void paint(Graphics g) {
    LWJGLException exception = null;
    synchronized ( SYNC_LOCK ) {
      if ( !isDisplayable() )
        return;
      try {
        if ( peer_info == null ) {
View Full Code Here

        }
      });
      Integer screen = (Integer)getScreen_method.invoke(device);
      return screen;
    } catch (Exception e) {
      throw new LWJGLException(e);
    }
  }
View Full Code Here

        }
      });
      Integer visual = (Integer)getVisual_method.invoke(configuration);
      return visual;
    } catch (Exception e) {
      throw new LWJGLException(e);
    }
  }
View Full Code Here

            /** For some strange reason, the display mode is sometimes silently capped even though the mode is reported as supported */
            if ( requested_mode.getWidth() != real_mode.getWidth() || requested_mode.getHeight() != real_mode.getHeight() ) {
              getDevice().setFullScreenWindow(null);
              if (isDisplayable())
                dispose();
              throw new LWJGLException("AWT capped mode: requested mode = " + requested_mode.getWidth() + "x" + requested_mode.getHeight() +
                " but got " + real_mode.getWidth() + " " + real_mode.getHeight());
            }
            return null;
          }
        });
      } catch (PrivilegedActionException e) {
        throw new LWJGLException(e);
      }
    }
    pack();
    resize(x, y, mode.getWidth(), mode.getHeight());
    setVisible(true);
View Full Code Here

        createController(c);
      }

      created = true;
    } catch (Throwable e) {
      throw new LWJGLException("Failed to initialise controllers",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.