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.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);
}

View File

@ -38,7 +38,7 @@ package org.lwjgl.opengl;
* <p/>
* Instants of this class are immutable. An example of the expected way to set
* 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/>
* 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 {
/**