Added supported check to Pbuffer constructor
This commit is contained in:
parent
78e665d773
commit
9d770148ca
|
@ -175,6 +175,8 @@ public final class Pbuffer {
|
||||||
* with the Display context (if created).
|
* with the Display context (if created).
|
||||||
*/
|
*/
|
||||||
public Pbuffer(int width, int height, PixelFormat pixel_format, RenderTexture renderTexture, Pbuffer shared_context) throws LWJGLException {
|
public Pbuffer(int width, int height, PixelFormat pixel_format, RenderTexture renderTexture, Pbuffer shared_context) throws LWJGLException {
|
||||||
|
if ((getPbufferCaps() & PBUFFER_SUPPORTED) == 0)
|
||||||
|
throw new IllegalStateException("Pbuffers are not supported");
|
||||||
this.width = width;
|
this.width = width;
|
||||||
this.height = height;
|
this.height = height;
|
||||||
this.handle = createPbuffer(width, height, pixel_format, renderTexture, shared_context != null ? shared_context.handle : null);
|
this.handle = createPbuffer(width, height, pixel_format, renderTexture, shared_context != null ? shared_context.handle : null);
|
||||||
|
|
Loading…
Reference in New Issue