Fixed Pbuffer init when Display has not been created.

This commit is contained in:
Ioannis Tsakpinis 2011-08-24 23:18:56 +00:00
parent 87c04cc995
commit 12b92fb46d
2 changed files with 4 additions and 5 deletions

View File

@ -217,11 +217,11 @@ public final class Pbuffer extends DrawableGL {
this.width = width; this.width = width;
this.height = height; this.height = height;
this.peer_info = createPbuffer(width, height, pixel_format, renderTexture); 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) if (shared_drawable != null)
shared_context = ((DrawableLWJGL)shared_drawable).getContext(); 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); this.context = new ContextGL(peer_info, attribs, (ContextGL)shared_context);
} }

View File

@ -38,7 +38,7 @@ package org.lwjgl.opengl;
* <p/> * <p/>
* Instants of this class are immutable. An example of the expected way to set * Instants of this class are immutable. An example of the expected way to set
* the PixelFormat property values is the following: * the PixelFormat property values is the following:
* <code>PixelFormat pf = new PixelFormat().withDepth(24).withSamples(4).withSRGB(true);</code> * <code>PixelFormat pf = new PixelFormat().withDepthBits(24).withSamples(4).withSRGB(true);</code>
* <p/> * <p/>
* WARNING: Some pixel formats are known to cause troubles on certain buggy drivers. * WARNING: Some pixel formats are known to cause troubles on certain buggy drivers.
* Example: Under Windows, specifying samples != 0 will enable the ARB * Example: Under Windows, specifying samples != 0 will enable the ARB
@ -47,7 +47,6 @@ package org.lwjgl.opengl;
* @author elias_naur@sourceforge.net * @author elias_naur@sourceforge.net
* @version $Revision$ * @version $Revision$
*/ */
public final class PixelFormat implements PixelFormatLWJGL { public final class PixelFormat implements PixelFormatLWJGL {
/** /**