Renamed LWJGLErrorException to LWJGLException

This commit is contained in:
Elias Naur 2004-03-27 15:05:24 +00:00
parent 63b33930b1
commit 9d55bbb302
14 changed files with 77 additions and 77 deletions

View File

@ -131,9 +131,9 @@ public final class Display {
* still need to query the display's characteristics using getDisplayMode(). * still need to query the display's characteristics using getDisplayMode().
* *
* @param mode The new display mode to set * @param mode The new display mode to set
* @throws LWJGLErrorException if the display mode could not be set * @throws LWJGLException if the display mode could not be set
*/ */
public static native void setDisplayMode(DisplayMode mode) throws LWJGLErrorException; public static native void setDisplayMode(DisplayMode mode) throws LWJGLException;
/** /**
* Reset the display mode to whatever it was when LWJGL was initialized. * Reset the display mode to whatever it was when LWJGL was initialized.
@ -195,14 +195,14 @@ public final class Display {
* @param brightness The brightness value between -1.0 and 1.0, inclusive * @param brightness The brightness value between -1.0 and 1.0, inclusive
* @param contrast The contrast, larger than 0.0. * @param contrast The contrast, larger than 0.0.
*/ */
public static void setDisplayConfiguration(float gamma, float brightness, float contrast) throws LWJGLErrorException { public static void setDisplayConfiguration(float gamma, float brightness, float contrast) throws LWJGLException {
if (brightness < -1.0f || brightness > 1.0f) if (brightness < -1.0f || brightness > 1.0f)
throw new IllegalArgumentException("Invalid brightness value"); throw new IllegalArgumentException("Invalid brightness value");
if (contrast < 0.0f) if (contrast < 0.0f)
throw new IllegalArgumentException("Invalid contrast value"); throw new IllegalArgumentException("Invalid contrast value");
int rampSize = getGammaRampLength(); int rampSize = getGammaRampLength();
if (rampSize == 0) { if (rampSize == 0) {
throw new LWJGLErrorException("Display configuration not supported"); throw new LWJGLException("Display configuration not supported");
} }
FloatBuffer gammaRamp = ByteBuffer.allocateDirect(rampSize*4).order(ByteOrder.nativeOrder()).asFloatBuffer(); FloatBuffer gammaRamp = ByteBuffer.allocateDirect(rampSize*4).order(ByteOrder.nativeOrder()).asFloatBuffer();
for (int i = 0; i < rampSize; i++) { for (int i = 0; i < rampSize; i++) {
@ -235,7 +235,7 @@ public final class Display {
/** /**
* Native method to set the gamma ramp. * Native method to set the gamma ramp.
*/ */
private static native void setGammaRamp(FloatBuffer gammaRamp) throws LWJGLErrorException; private static native void setGammaRamp(FloatBuffer gammaRamp) throws LWJGLException;
/** /**
* Get the driver adapter string. This is a unique string describing the actual card's hardware, eg. "Geforce2", "PS2", * Get the driver adapter string. This is a unique string describing the actual card's hardware, eg. "Geforce2", "PS2",

View File

@ -1,7 +0,0 @@
package org.lwjgl;
public class LWJGLErrorException extends Exception {
public LWJGLErrorException(String msg) {
super(msg);
}
}

View File

@ -0,0 +1,7 @@
package org.lwjgl;
public class LWJGLException extends Exception {
public LWJGLException(String msg) {
super(msg);
}
}

View File

@ -128,7 +128,7 @@ public final class Sys {
System.loadLibrary(LIBRARY_NAME); System.loadLibrary(LIBRARY_NAME);
String native_version = getNativeLibraryVersion(); String native_version = getNativeLibraryVersion();
if (!native_version.equals(VERSION)) if (!native_version.equals(VERSION))
throw new IllegalStateException("Version mismatch: jar version is '" + VERSION + throw new LinkageError("Version mismatch: jar version is '" + VERSION +
"', native libary version is '" + native_version + "'"); "', native libary version is '" + native_version + "'");
setDebug(DEBUG); setDebug(DEBUG);
setTime(0); setTime(0);

View File

@ -37,7 +37,7 @@ import java.util.Map;
import org.lwjgl.Sys; import org.lwjgl.Sys;
import org.lwjgl.opengl.Window; import org.lwjgl.opengl.Window;
import org.lwjgl.LWJGLErrorException; import org.lwjgl.LWJGLException;
/** /**
* $Id$ * $Id$
@ -164,9 +164,9 @@ public class Controller {
/** /**
* "Create" the controller. The display must first have been created. * "Create" the controller. The display must first have been created.
* @throws LWJGLErrorException if the controller could not be created for any reason * @throws LWJGLException if the controller could not be created for any reason
*/ */
public static void create() throws LWJGLErrorException { public static void create() throws LWJGLException {
if (!Window.isCreated()) if (!Window.isCreated())
throw new IllegalStateException("Window must be created before you can create Controller"); throw new IllegalStateException("Window must be created before you can create Controller");
initialize(); initialize();
@ -268,7 +268,7 @@ public class Controller {
/** /**
* Native method to create the controller * Native method to create the controller
*/ */
private static native void nCreate() throws LWJGLErrorException; private static native void nCreate() throws LWJGLException;
/** /**
* Native method the destroy the controller * Native method the destroy the controller

View File

@ -37,7 +37,7 @@ import java.nio.ByteOrder;
import java.nio.IntBuffer; import java.nio.IntBuffer;
import org.lwjgl.Sys; import org.lwjgl.Sys;
import org.lwjgl.LWJGLErrorException; import org.lwjgl.LWJGLException;
/** /**
* $Id$ * $Id$
@ -69,9 +69,9 @@ public class Cursor {
* @param numImages number of cursor images specified. Must be 1 if animations are not supported. * @param numImages number of cursor images specified. Must be 1 if animations are not supported.
* @param images A buffer containing the images. The origin is at the lower left corner, like OpenGL. * @param images A buffer containing the images. The origin is at the lower left corner, like OpenGL.
* @param delays An int buffer of animation frame delays, if numImages is greater than 1, else null * @param delays An int buffer of animation frame delays, if numImages is greater than 1, else null
* @throws LWJGLErrorException if the cursor could not be created for any reason * @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 LWJGLErrorException { public Cursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException {
if (!Mouse.isCreated()) if (!Mouse.isCreated())
throw new IllegalStateException("Mouse must be created before creating cursor objects"); throw new IllegalStateException("Mouse must be created before creating cursor objects");
if (width*height*numImages > images.remaining()) if (width*height*numImages > images.remaining())
@ -95,7 +95,7 @@ public class Cursor {
/** /**
* Creates the actual cursor, using a platform specific class * Creates the actual cursor, using a platform specific class
*/ */
private void createCursors(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLErrorException { private void createCursors(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException {
// create copy and flip images to match ogl // create copy and flip images to match ogl
IntBuffer images_copy = ByteBuffer.allocateDirect(images.remaining()*4).order(ByteOrder.nativeOrder()).asIntBuffer(); IntBuffer images_copy = ByteBuffer.allocateDirect(images.remaining()*4).order(ByteOrder.nativeOrder()).asIntBuffer();
flipImages(width, height, numImages, images, images_copy); flipImages(width, height, numImages, images, images_copy);

View File

@ -41,7 +41,7 @@ import java.util.Map;
import org.lwjgl.BufferUtils; import org.lwjgl.BufferUtils;
import org.lwjgl.Sys; import org.lwjgl.Sys;
import org.lwjgl.opengl.Window; import org.lwjgl.opengl.Window;
import org.lwjgl.LWJGLErrorException; import org.lwjgl.LWJGLException;
/** /**
* $Id$ * $Id$
@ -285,9 +285,9 @@ public class Keyboard {
* "Create" the keyboard. The display must first have been created. The * "Create" the keyboard. The display must first have been created. The
* reason for this is so the keyboard has a window to "focus" in. * reason for this is so the keyboard has a window to "focus" in.
* *
* @throws LWJGLErrorException if the keyboard could not be created for any reason * @throws LWJGLException if the keyboard could not be created for any reason
*/ */
public static void create() throws LWJGLErrorException { public static void create() throws LWJGLException {
if (!Window.isCreated()) if (!Window.isCreated())
throw new IllegalStateException("Window must be created before you can create Keyboard"); throw new IllegalStateException("Window must be created before you can create Keyboard");
if (!initialized) if (!initialized)
@ -301,7 +301,7 @@ public class Keyboard {
/** /**
* Native method to create the keyboard * Native method to create the keyboard
*/ */
private static native void nCreate() throws LWJGLErrorException; private static native void nCreate() throws LWJGLException;
/** /**
* @return true if the keyboard has been created * @return true if the keyboard has been created
@ -389,7 +389,7 @@ public class Keyboard {
* Enable keyboard translation. Must be called after the keyboard is created, * Enable keyboard translation. Must be called after the keyboard is created,
* and keyboard buffering must be enabled. * and keyboard buffering must be enabled.
*/ */
public static void enableTranslation() throws LWJGLErrorException { public static void enableTranslation() throws LWJGLException {
if (!created) if (!created)
throw new IllegalStateException("Keyboard must be created before you can read events"); throw new IllegalStateException("Keyboard must be created before you can read events");
if (readBuffer == null) if (readBuffer == null)
@ -401,12 +401,12 @@ public class Keyboard {
/** /**
* Native method to enable the translation buffer * Native method to enable the translation buffer
*/ */
private static native void nEnableTranslation() throws LWJGLErrorException; private static native void nEnableTranslation() throws LWJGLException;
/** /**
* Enable keyboard buffering. Must be called after the keyboard is created. * Enable keyboard buffering. Must be called after the keyboard is created.
*/ */
public static void enableBuffer() throws LWJGLErrorException { public static void enableBuffer() throws LWJGLException {
if (!created) if (!created)
throw new IllegalStateException("Keyboard must be created before you can enable buffering"); throw new IllegalStateException("Keyboard must be created before you can enable buffering");
readBuffer = BufferUtils.createByteBuffer(4*BUFFER_SIZE); readBuffer = BufferUtils.createByteBuffer(4*BUFFER_SIZE);
@ -419,7 +419,7 @@ public class Keyboard {
* @return the event buffer, * @return the event buffer,
* or null if no buffer can be allocated * or null if no buffer can be allocated
*/ */
private static native void nEnableBuffer() throws LWJGLErrorException; private static native void nEnableBuffer() throws LWJGLException;
/** /**
* Checks to see if a key is down. * Checks to see if a key is down.

View File

@ -39,7 +39,7 @@ import java.util.Map;
import org.lwjgl.BufferUtils; import org.lwjgl.BufferUtils;
import org.lwjgl.Sys; import org.lwjgl.Sys;
import org.lwjgl.opengl.Window; import org.lwjgl.opengl.Window;
import org.lwjgl.LWJGLErrorException; import org.lwjgl.LWJGLException;
/** /**
* $Id$ * $Id$
@ -165,9 +165,9 @@ public class Mouse {
* *
* @param cursor the native cursor object to bind. May be null. * @param cursor the native cursor object to bind. May be null.
* @return The previous Cursor object set, or null. * @return The previous Cursor object set, or null.
* @throws LWJGLErrorException if the cursor could not be set for any reason * @throws LWJGLException if the cursor could not be set for any reason
*/ */
public static Cursor setNativeCursor(Cursor cursor) throws LWJGLErrorException { public static Cursor setNativeCursor(Cursor cursor) throws LWJGLException {
if (!created) if (!created)
throw new IllegalStateException("Create the Mouse before setting the native cursor"); throw new IllegalStateException("Create the Mouse before setting the native cursor");
if ((getNativeCursorCaps() & CURSOR_ONE_BIT_TRANSPARENCY) == 0) if ((getNativeCursorCaps() & CURSOR_ONE_BIT_TRANSPARENCY) == 0)
@ -184,7 +184,7 @@ public class Mouse {
} }
/** Native method to set the native cursor */ /** Native method to set the native cursor */
private static native void nSetNativeCursor(long handle) throws LWJGLErrorException; private static native void nSetNativeCursor(long handle) throws LWJGLException;
/** /**
* Gets the minimum size of a native cursor. Can only be called if * Gets the minimum size of a native cursor. Can only be called if
@ -239,9 +239,9 @@ public class Mouse {
/** /**
* "Create" the mouse. The display must first have been created. * "Create" the mouse. The display must first have been created.
* *
* @throws LWJGLErrorException if the mouse could not be created for any reason * @throws LWJGLException if the mouse could not be created for any reason
*/ */
public static void create() throws LWJGLErrorException { public static void create() throws LWJGLException {
if (!Window.isCreated()) if (!Window.isCreated())
throw new IllegalStateException("Window must be created prior to creating mouse"); throw new IllegalStateException("Window must be created prior to creating mouse");
@ -294,7 +294,7 @@ public class Mouse {
if (currentCursor != null) { if (currentCursor != null) {
try { try {
setNativeCursor(null); setNativeCursor(null);
} catch (LWJGLErrorException e) { } catch (LWJGLException e) {
if (Sys.DEBUG) if (Sys.DEBUG)
e.printStackTrace(); e.printStackTrace();
} }
@ -402,7 +402,7 @@ public class Mouse {
/** /**
* Enable mouse button buffering. Must be called after the mouse is created. * Enable mouse button buffering. Must be called after the mouse is created.
*/ */
public static void enableBuffer() throws LWJGLErrorException { public static void enableBuffer() throws LWJGLException {
if (!created) if (!created)
throw new IllegalStateException("Mouse must be created before you can enable buffering"); throw new IllegalStateException("Mouse must be created before you can enable buffering");
readBuffer = BufferUtils.createByteBuffer(2*BUFFER_SIZE); readBuffer = BufferUtils.createByteBuffer(2*BUFFER_SIZE);
@ -415,7 +415,7 @@ public class Mouse {
* @return the event buffer, * @return the event buffer,
* or null if no buffer can be allocated * or null if no buffer can be allocated
*/ */
private static native void nEnableBuffer() throws LWJGLErrorException; private static native void nEnableBuffer() throws LWJGLException;
/** /**
* Reads all button events since last read. * Reads all button events since last read.
@ -546,7 +546,7 @@ public class Mouse {
currentCursor.nextCursor(); currentCursor.nextCursor();
try { try {
setNativeCursor(currentCursor); setNativeCursor(currentCursor);
} catch (LWJGLErrorException e) { } catch (LWJGLException e) {
if (Sys.DEBUG) if (Sys.DEBUG)
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -37,7 +37,7 @@ import java.util.StringTokenizer;
import org.lwjgl.Display; import org.lwjgl.Display;
import org.lwjgl.Sys; import org.lwjgl.Sys;
import org.lwjgl.LWJGLErrorException; import org.lwjgl.LWJGLException;
/** /**
* $Id$ * $Id$
@ -87,7 +87,7 @@ public abstract class AL {
* @param oalPaths Array of strings containing paths to search for OpenAL library * @param oalPaths Array of strings containing paths to search for OpenAL library
* @return true if the AL creation process succeeded * @return true if the AL creation process succeeded
*/ */
protected static native void nCreate(String[] oalPaths) throws LWJGLErrorException; protected static native void nCreate(String[] oalPaths) throws LWJGLException;
/** /**
* Native method the destroy the AL * Native method the destroy the AL
@ -112,7 +112,7 @@ public abstract class AL {
* @param contextSynchronized Flag, indicating a synchronous context.* * @param contextSynchronized Flag, indicating a synchronous context.*
*/ */
public static void create(String deviceArguments, int contextFrequency, int contextRefresh, boolean contextSynchronized) public static void create(String deviceArguments, int contextFrequency, int contextRefresh, boolean contextSynchronized)
throws LWJGLErrorException { throws LWJGLException {
if (created) { if (created) {
return; return;
@ -131,7 +131,7 @@ public abstract class AL {
* Creates an OpenAL instance. The empty create will cause OpenAL to * Creates an OpenAL instance. The empty create will cause OpenAL to
* open the default device, and create a context using default values. * open the default device, and create a context using default values.
*/ */
public static void create() throws LWJGLErrorException { public static void create() throws LWJGLException {
if(created) { if(created) {
return; return;
} }
@ -152,7 +152,7 @@ public abstract class AL {
jwsLibname = "openal"; jwsLibname = "openal";
break; break;
default: default:
throw new LWJGLErrorException("Unknown platform"); throw new LWJGLException("Unknown platform");
} }
String jwsPath = getPathFromJWS(jwsLibname); String jwsPath = getPathFromJWS(jwsLibname);

View File

@ -35,7 +35,7 @@ import java.nio.Buffer;
import java.nio.IntBuffer; import java.nio.IntBuffer;
import org.lwjgl.Sys; import org.lwjgl.Sys;
import org.lwjgl.LWJGLErrorException; import org.lwjgl.LWJGLException;
/** /**
* $Id$ * $Id$
@ -159,9 +159,9 @@ public class ALC {
/** /**
* Creates the ALC instance * Creates the ALC instance
* *
* @throws LWJGLErrorException if a failiure occured in the ALC creation process * @throws LWJGLException if a failiure occured in the ALC creation process
*/ */
protected static void create() throws LWJGLErrorException { protected static void create() throws LWJGLException {
if (created) { if (created) {
return; return;
} }

View File

@ -33,7 +33,7 @@
package org.lwjgl.openal.eax; package org.lwjgl.openal.eax;
import org.lwjgl.Sys; import org.lwjgl.Sys;
import org.lwjgl.LWJGLErrorException; import org.lwjgl.LWJGLException;
/** /**
* $Id$ * $Id$
@ -54,15 +54,15 @@ public class EAX {
/** /**
* Loads the EAX functions * Loads the EAX functions
* *
* @throws LWJGLErrorException if the EAX extensions couldn't be loaded * @throws LWJGLException if the EAX extensions couldn't be loaded
*/ */
public static void create() throws LWJGLErrorException { public static void create() throws LWJGLException {
if (created) { if (created) {
return; return;
} }
if (!nCreate()) { if (!nCreate()) {
throw new LWJGLErrorException("EAX instance could not be created."); throw new LWJGLException("EAX instance could not be created.");
} }
EAX20.init(); EAX20.init();
created = true; created = true;

View File

@ -33,7 +33,7 @@
package org.lwjgl.opengl; package org.lwjgl.opengl;
import org.lwjgl.Sys; import org.lwjgl.Sys;
import org.lwjgl.LWJGLErrorException; import org.lwjgl.LWJGLException;
import java.nio.IntBuffer; import java.nio.IntBuffer;
@ -160,7 +160,7 @@ public final class Pbuffer {
} }
/** /**
* Construct an instance of a Pbuffer. If this fails then an LWJGLErrorException will be thrown. The buffer is single-buffered. * Construct an instance of a Pbuffer. If this fails then an LWJGLException will be thrown. The buffer is single-buffered.
* <p/> * <p/>
* NOTE: An OpenGL window must be created before a Pbuffer can be created. The Pbuffer will have its own context that shares * NOTE: An OpenGL window must be created before a Pbuffer can be created. The Pbuffer will have its own context that shares
* display lists and textures with the OpenGL window context, but it will have its own OpenGL state. Therefore, state changes * display lists and textures with the OpenGL window context, but it will have its own OpenGL state. Therefore, state changes
@ -183,7 +183,7 @@ public final class Pbuffer {
* 0 to disable multisampling. This parameter is ignored if GL_ARB_multisample is not supported. * 0 to disable multisampling. This parameter is ignored if GL_ARB_multisample is not supported.
* @param renderTexture * @param renderTexture
*/ */
public Pbuffer(int width, int height, int bpp, int alpha, int depth, int stencil, int samples, RenderTexture renderTexture) throws LWJGLErrorException { public Pbuffer(int width, int height, int bpp, int alpha, int depth, int stencil, int samples, RenderTexture renderTexture) throws LWJGLException {
this.width = width; this.width = width;
this.height = height; this.height = height;
@ -241,7 +241,7 @@ public final class Pbuffer {
int bpp, int alpha, int depth, int stencil, int bpp, int alpha, int depth, int stencil,
int samples, int samples,
IntBuffer pixelFormatCaps, int pixelFormatCapsSize, IntBuffer pixelFormatCaps, int pixelFormatCapsSize,
IntBuffer pBufferAttribs, int pBufferAttribsSize) throws LWJGLErrorException; IntBuffer pBufferAttribs, int pBufferAttribsSize) throws LWJGLException;
/** /**
* Destroys the Pbuffer. After this call, there will be no valid GL rendering context - regardless of whether this Pbuffer was * Destroys the Pbuffer. After this call, there will be no valid GL rendering context - regardless of whether this Pbuffer was

View File

@ -52,7 +52,7 @@ import org.lwjgl.Sys;
import org.lwjgl.input.Controller; import org.lwjgl.input.Controller;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse; import org.lwjgl.input.Mouse;
import org.lwjgl.LWJGLErrorException; import org.lwjgl.LWJGLException;
public final class Window { public final class Window {
@ -287,33 +287,33 @@ public final class Window {
* buffer, probably no alpha buffer, and probably no multisampling. * buffer, probably no alpha buffer, and probably no multisampling.
* <p>The window created will be set up in orthographic 2D projection, with 1:1 pixel ratio with GL coordinates. * <p>The window created will be set up in orthographic 2D projection, with 1:1 pixel ratio with GL coordinates.
* @param title * @param title
* @throws LWJGLErrorException * @throws LWJGLException
*/ */
public static void create(String title) throws LWJGLErrorException { public static void create(String title) throws LWJGLException {
create(title, Display.getDepth(), 0, 16, 8, 0); create(title, Display.getDepth(), 0, 16, 8, 0);
} }
/** /**
* Create a fullscreen window. If the underlying OS does not * Create a fullscreen window. If the underlying OS does not
* support fullscreen mode, then a window will be created instead. If this * support fullscreen mode, then a window will be created instead. If this
* fails too then an LWJGLErrorException will be thrown. * fails too then an LWJGLException will be thrown.
* <p>The window created will be set up in orthographic 2D projection, with 1:1 pixel ratio with GL coordinates. * <p>The window created will be set up in orthographic 2D projection, with 1:1 pixel ratio with GL coordinates.
* @param title The title of the window * @param title The title of the window
* @param bpp Minimum bits per pixel * @param bpp Minimum bits per pixel
* @param alpha Minimum bits per pixel in alpha buffer * @param alpha Minimum bits per pixel in alpha buffer
* @param depth Minimum bits per pixel in depth buffer * @param depth Minimum bits per pixel in depth buffer
* @param stencil Minimum bits per pixel in stencil buffer * @param stencil Minimum bits per pixel in stencil buffer
* @throws LWJGLErrorException if the window could not be created for any reason; typically because * @throws LWJGLException if the window could not be created for any reason; typically because
* the minimum requirements could not be met satisfactorily * the minimum requirements could not be met satisfactorily
*/ */
public static void create(String title, int bpp, int alpha, int depth, int stencil) throws LWJGLErrorException { public static void create(String title, int bpp, int alpha, int depth, int stencil) throws LWJGLException {
create(title, bpp, alpha, depth, stencil, 0); create(title, bpp, alpha, depth, stencil, 0);
} }
/** /**
* Create a fullscreen window. If the underlying OS does not * Create a fullscreen window. If the underlying OS does not
* support fullscreen mode, then a window will be created instead. If this * support fullscreen mode, then a window will be created instead. If this
* fails too then an LWJGLErrorException will be thrown. * fails too then an LWJGLException will be thrown.
* <p>The window created will be set up in orthographic 2D projection, with 1:1 pixel ratio with GL coordinates. * <p>The window created will be set up in orthographic 2D projection, with 1:1 pixel ratio with GL coordinates.
* @param title The title of the window * @param title The title of the window
* @param bpp Minimum bits per pixel * @param bpp Minimum bits per pixel
@ -322,10 +322,10 @@ public final class Window {
* @param stencil Minimum bits per pixel in stencil buffer * @param stencil Minimum bits per pixel in stencil buffer
* @param samples Minimum samples in multisample buffer (corresponds to GL_SAMPLES_ARB in GL_ARB_multisample spec). * @param samples Minimum samples in multisample buffer (corresponds to GL_SAMPLES_ARB in GL_ARB_multisample spec).
Pass 0 to disable multisampling. This parameter is ignored if GL_ARB_multisample is not supported. Pass 0 to disable multisampling. This parameter is ignored if GL_ARB_multisample is not supported.
* @throws LWJGLErrorException if the window could not be created for any reason; typically because * @throws LWJGLException if the window could not be created for any reason; typically because
* the minimum requirements could not be met satisfactorily * the minimum requirements could not be met satisfactorily
*/ */
public static void create(String title, int bpp, int alpha, int depth, int stencil, int samples) throws LWJGLErrorException { public static void create(String title, int bpp, int alpha, int depth, int stencil, int samples) throws LWJGLException {
if (isCreated()) if (isCreated())
throw new IllegalStateException("Only one LWJGL window may be instantiated at any one time."); throw new IllegalStateException("Only one LWJGL window may be instantiated at any one time.");
Window.fullscreen = true; Window.fullscreen = true;
@ -339,7 +339,7 @@ public final class Window {
/** /**
* Create a window. If the underlying OS does not have "floating" windows, then a fullscreen * Create a window. If the underlying OS does not have "floating" windows, then a fullscreen
* display will be created instead. If this fails too then an LWJGLErrorException will be thrown. * display will be created instead. If this fails too then an LWJGLException will be thrown.
* If the window is created fullscreen, then its size may not match the specified size * If the window is created fullscreen, then its size may not match the specified size
* here. * here.
* <p>The window created will be set up in orthographic 2D projection, with 1:1 pixel ratio with GL coordinates. * <p>The window created will be set up in orthographic 2D projection, with 1:1 pixel ratio with GL coordinates.
@ -353,16 +353,16 @@ public final class Window {
* @param depth Minimum bits per pixel in depth buffer * @param depth Minimum bits per pixel in depth buffer
* @param samples Minimum samples in multisample buffer (corresponds to GL_SAMPLES_ARB in GL_ARB_multisample spec). * @param samples Minimum samples in multisample buffer (corresponds to GL_SAMPLES_ARB in GL_ARB_multisample spec).
Pass 0 to disable multisampling. This parameter is ignored if GL_ARB_multisample is not supported. Pass 0 to disable multisampling. This parameter is ignored if GL_ARB_multisample is not supported.
* @throws LWJGLErrorException if the window could not be created for any reason; typically because * @throws LWJGLException if the window could not be created for any reason; typically because
* the minimum requirements could not be met satisfactorily * the minimum requirements could not be met satisfactorily
*/ */
public static void create(String title, int x, int y, int width, int height, int bpp, int alpha, int depth, int stencil) throws LWJGLErrorException { public static void create(String title, int x, int y, int width, int height, int bpp, int alpha, int depth, int stencil) throws LWJGLException {
create(title, x, y, width, height, bpp, alpha, depth, stencil, 0); create(title, x, y, width, height, bpp, alpha, depth, stencil, 0);
} }
/** /**
* Create a window. If the underlying OS does not have "floating" windows, then a fullscreen * Create a window. If the underlying OS does not have "floating" windows, then a fullscreen
* display will be created instead. If this fails too then an LWJGLErrorException will be thrown. * display will be created instead. If this fails too then an LWJGLException will be thrown.
* If the window is created fullscreen, then its size may not match the specified size * If the window is created fullscreen, then its size may not match the specified size
* here. * here.
* <p>The window created will be set up in orthographic 2D projection, with 1:1 pixel ratio with GL coordinates. * <p>The window created will be set up in orthographic 2D projection, with 1:1 pixel ratio with GL coordinates.
@ -377,11 +377,11 @@ public final class Window {
* @param stencil Minimum bits per pixel in stencil buffer * @param stencil Minimum bits per pixel in stencil buffer
* @param samples Minimum samples in multisample buffer (corresponds to GL_SAMPLES_ARB in GL_ARB_multisample spec). * @param samples Minimum samples in multisample buffer (corresponds to GL_SAMPLES_ARB in GL_ARB_multisample spec).
Pass 0 to disable multisampling. This parameter is ignored if GL_ARB_multisample is not supported. Pass 0 to disable multisampling. This parameter is ignored if GL_ARB_multisample is not supported.
* @throws LWJGLErrorException if the window could not be created for any reason; typically because * @throws LWJGLException if the window could not be created for any reason; typically because
* the minimum requirements could not be met satisfactorily * the minimum requirements could not be met satisfactorily
*/ */
public static void create(String title, int x, int y, int width, int height, int bpp, int alpha, int depth, int stencil, int samples) public static void create(String title, int x, int y, int width, int height, int bpp, int alpha, int depth, int stencil, int samples)
throws LWJGLErrorException { throws LWJGLException {
if (isCreated()) if (isCreated())
throw new IllegalStateException("Only one LWJGL window may be instantiated at any one time."); throw new IllegalStateException("Only one LWJGL window may be instantiated at any one time.");
Window.fullscreen = false; Window.fullscreen = false;
@ -395,7 +395,7 @@ public final class Window {
/** /**
* Create the native window peer. * Create the native window peer.
* @throws LWJGLErrorException * @throws LWJGLException
*/ */
private static native void nCreate( private static native void nCreate(
String title, String title,
@ -409,9 +409,9 @@ public final class Window {
int depth, int depth,
int stencil, int stencil,
int samples) int samples)
throws LWJGLErrorException; throws LWJGLException;
private static void createWindow(int bpp, int alpha, int depth, int stencil, int samples) throws LWJGLErrorException { private static void createWindow(int bpp, int alpha, int depth, int stencil, int samples) throws LWJGLException {
nCreate(title, x, y, width, height, fullscreen, bpp, alpha, depth, stencil, samples); nCreate(title, x, y, width, height, fullscreen, bpp, alpha, depth, stencil, samples);
context = new Window(); context = new Window();
makeCurrent(); makeCurrent();
@ -431,7 +431,7 @@ public final class Window {
Mouse.create(); Mouse.create();
createdMouse = true; createdMouse = true;
Mouse.enableBuffer(); Mouse.enableBuffer();
} catch (LWJGLErrorException e) { } catch (LWJGLException e) {
if (Sys.DEBUG) { if (Sys.DEBUG) {
e.printStackTrace(System.err); e.printStackTrace(System.err);
} else { } else {
@ -445,7 +445,7 @@ public final class Window {
createdKeyboard = true; createdKeyboard = true;
Keyboard.enableBuffer(); Keyboard.enableBuffer();
Keyboard.enableTranslation(); Keyboard.enableTranslation();
} catch (LWJGLErrorException e) { } catch (LWJGLException e) {
if (Sys.DEBUG) { if (Sys.DEBUG) {
e.printStackTrace(System.err); e.printStackTrace(System.err);
} else { } else {
@ -457,7 +457,7 @@ public final class Window {
try { try {
Controller.create(); Controller.create();
createdController = true; createdController = true;
} catch (LWJGLErrorException e) { } catch (LWJGLException e) {
if (Sys.DEBUG) { if (Sys.DEBUG) {
e.printStackTrace(System.err); e.printStackTrace(System.err);
} else { } else {

View File

@ -120,7 +120,7 @@ void throwOpenALException(JNIEnv * env, const char * err) {
} }
void throwException(JNIEnv * env, const char * err) { void throwException(JNIEnv * env, const char * err) {
throwGeneralException(env, "org/lwjgl/LWJGLErrorException", err); throwGeneralException(env, "org/lwjgl/LWJGLException", err);
} }
void doExtension(JNIEnv *env, jobject ext_set, const char *method_name, const char *ext) { void doExtension(JNIEnv *env, jobject ext_set, const char *method_name, const char *ext) {