diff --git a/src/java/org/lwjgl/opengl/AWTGLCanvas.java b/src/java/org/lwjgl/opengl/AWTGLCanvas.java index a1dfadab..1ce0d1e2 100644 --- a/src/java/org/lwjgl/opengl/AWTGLCanvas.java +++ b/src/java/org/lwjgl/opengl/AWTGLCanvas.java @@ -147,6 +147,8 @@ public class AWTGLCanvas extends Canvas implements Drawable, ComponentListener, */ public AWTGLCanvas(GraphicsDevice device, PixelFormat pixel_format, Drawable drawable) throws LWJGLException { super(implementation.findConfiguration(device, pixel_format)); + if (pixel_format == null) + throw new NullPointerException("Pixel format must be non-null"); addHierarchyListener(this); this.drawable = drawable; this.pixel_format = pixel_format; diff --git a/src/java/org/lwjgl/opengl/Display.java b/src/java/org/lwjgl/opengl/Display.java index 669a6ec0..93656c19 100644 --- a/src/java/org/lwjgl/opengl/Display.java +++ b/src/java/org/lwjgl/opengl/Display.java @@ -646,6 +646,8 @@ public final class Display { * @throws LWJGLException */ public static void create(PixelFormat pixel_format, Drawable shared_drawable) throws LWJGLException { + if (pixel_format == null) + throw new NullPointerException("Pixel format must be non-null"); if (isCreated()) throw new IllegalStateException("Only one LWJGL context may be instantiated at any one time."); if (pixel_format == null) diff --git a/src/java/org/lwjgl/opengl/Pbuffer.java b/src/java/org/lwjgl/opengl/Pbuffer.java index f9a2c1ac..fea38632 100644 --- a/src/java/org/lwjgl/opengl/Pbuffer.java +++ b/src/java/org/lwjgl/opengl/Pbuffer.java @@ -178,6 +178,8 @@ public final class Pbuffer implements Drawable { * with the Display context (if created). */ public Pbuffer(int width, int height, PixelFormat pixel_format, RenderTexture renderTexture, Drawable shared_drawable) throws LWJGLException { + if (pixel_format == null) + throw new NullPointerException("Pixel format must be non-null"); this.width = width; this.height = height; this.peer_info = createPbuffer(width, height, pixel_format, renderTexture);