[FIXED] Throwing a better exception than NPE

Started by ra4king, September 05, 2012, 22:56:50

Previous topic - Next topic

ra4king

If Display.create() is not called or an exception is thrown while creating a GL context, the ContextCapabilities class is never initialized, causing all GL methods to throw an NPE when invoked. This has caused massive confusion for users when they don't realize that their context has never been created.

I request a better exception to be thrown if GLContext.getCapabilities() returns null.
-Roi

spasi


princec


spasi

GLContext.getCapabilities() will throw a RuntimeException instead of returning null when there's no current GL context in the current thread.

ra4king

-Roi