From 839306597b1863c4c6c7e7d0189400b5f44e426a Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Thu, 16 Jun 2005 20:59:55 +0000 Subject: [PATCH] Check for null pixel format in Display.create --- src/java/org/lwjgl/opengl/Display.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/java/org/lwjgl/opengl/Display.java b/src/java/org/lwjgl/opengl/Display.java index cf394827..184ecfa0 100644 --- a/src/java/org/lwjgl/opengl/Display.java +++ b/src/java/org/lwjgl/opengl/Display.java @@ -625,12 +625,14 @@ public final class Display { *

The window created will be set up in orthographic 2D projection, with 1:1 pixel ratio with GL coordinates. * * @param pixel_format Describes the minimum specifications the context must fulfill. - * @param shared_drawable The Drawable to share context with. + * @param shared_drawable The Drawable to share context with or null. * @throws LWJGLException */ public static void create(PixelFormat pixel_format, Drawable shared_drawable) throws LWJGLException { if (isCreated()) throw new IllegalStateException("Only one LWJGL context may be instantiated at any one time."); + if (pixel_format == null) + throw new NullPointerException("pixel_format cannot be null"); if (fullscreen) switchDisplayMode(); try {