Added supported check to Pbuffer constructor

This commit is contained in:
Elias Naur 2005-01-18 11:58:33 +00:00
parent 78e665d773
commit 9d770148ca
1 changed files with 2 additions and 0 deletions

View File

@ -175,6 +175,8 @@ public final class Pbuffer {
* with the Display context (if created).
*/
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.height = height;
this.handle = createPbuffer(width, height, pixel_format, renderTexture, shared_context != null ? shared_context.handle : null);