From 12b92fb46d7d8e887405f1bb12b1c65cfbdda924 Mon Sep 17 00:00:00 2001 From: Ioannis Tsakpinis Date: Wed, 24 Aug 2011 23:18:56 +0000 Subject: [PATCH] Fixed Pbuffer init when Display has not been created. --- src/java/org/lwjgl/opengl/Pbuffer.java | 6 +++--- src/java/org/lwjgl/opengl/PixelFormat.java | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/java/org/lwjgl/opengl/Pbuffer.java b/src/java/org/lwjgl/opengl/Pbuffer.java index 75a56542..f2228298 100644 --- a/src/java/org/lwjgl/opengl/Pbuffer.java +++ b/src/java/org/lwjgl/opengl/Pbuffer.java @@ -217,11 +217,11 @@ public final class Pbuffer extends DrawableGL { this.width = width; this.height = height; this.peer_info = createPbuffer(width, height, pixel_format, renderTexture); - Context shared_context; + Context shared_context = null; + if ( shared_drawable == null ) + shared_drawable = Display.getDrawable(); // May be null if (shared_drawable != null) shared_context = ((DrawableLWJGL)shared_drawable).getContext(); - else - shared_context = ((DrawableLWJGL)Display.getDrawable()).getContext(); // May be null this.context = new ContextGL(peer_info, attribs, (ContextGL)shared_context); } diff --git a/src/java/org/lwjgl/opengl/PixelFormat.java b/src/java/org/lwjgl/opengl/PixelFormat.java index 02f14f73..10559f30 100644 --- a/src/java/org/lwjgl/opengl/PixelFormat.java +++ b/src/java/org/lwjgl/opengl/PixelFormat.java @@ -38,7 +38,7 @@ package org.lwjgl.opengl; *

* Instants of this class are immutable. An example of the expected way to set * the PixelFormat property values is the following: - * PixelFormat pf = new PixelFormat().withDepth(24).withSamples(4).withSRGB(true); + * PixelFormat pf = new PixelFormat().withDepthBits(24).withSamples(4).withSRGB(true); *

* WARNING: Some pixel formats are known to cause troubles on certain buggy drivers. * Example: Under Windows, specifying samples != 0 will enable the ARB @@ -47,7 +47,6 @@ package org.lwjgl.opengl; * @author elias_naur@sourceforge.net * @version $Revision$ */ - public final class PixelFormat implements PixelFormatLWJGL { /**