Check for null pixel format in Display.create
This commit is contained in:
parent
40e821ffff
commit
839306597b
|
@ -625,12 +625,14 @@ public final class Display {
|
||||||
* <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 pixel_format Describes the minimum specifications the context must fulfill.
|
* @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
|
* @throws LWJGLException
|
||||||
*/
|
*/
|
||||||
public static void create(PixelFormat pixel_format, Drawable shared_drawable) throws LWJGLException {
|
public static void create(PixelFormat pixel_format, Drawable shared_drawable) throws LWJGLException {
|
||||||
if (isCreated())
|
if (isCreated())
|
||||||
throw new IllegalStateException("Only one LWJGL context may be instantiated at any one time.");
|
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)
|
if (fullscreen)
|
||||||
switchDisplayMode();
|
switchDisplayMode();
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue