Mac OS X: Fixed an issue where pbuffer contexts could not share with the display context.

This commit is contained in:
Elias Naur 2005-11-04 12:38:59 +00:00
parent be343cf334
commit a9bd41f12e
5 changed files with 16 additions and 8 deletions

View File

@ -42,8 +42,8 @@ import org.lwjgl.LWJGLException;
final class MacOSXAWTGLCanvasPeerInfo extends MacOSXCanvasPeerInfo {
private final AWTGLCanvas canvas;
public MacOSXAWTGLCanvasPeerInfo(AWTGLCanvas canvas, PixelFormat pixel_format) throws LWJGLException {
super(pixel_format);
public MacOSXAWTGLCanvasPeerInfo(AWTGLCanvas canvas, PixelFormat pixel_format, boolean support_pbuffer) throws LWJGLException {
super(pixel_format, support_pbuffer);
this.canvas = canvas;
}

View File

@ -44,7 +44,11 @@ import org.lwjgl.LWJGLException;
*/
final class MacOSXCanvasImplementation implements AWTCanvasImplementation {
public PeerInfo createPeerInfo(AWTGLCanvas canvas, PixelFormat pixel_format) throws LWJGLException {
return new MacOSXAWTGLCanvasPeerInfo(canvas, pixel_format);
try {
return new MacOSXAWTGLCanvasPeerInfo(canvas, pixel_format, true);
} catch (LWJGLException e) {
return new MacOSXAWTGLCanvasPeerInfo(canvas, pixel_format, false);
}
}
/**

View File

@ -45,8 +45,8 @@ import org.lwjgl.LWJGLException;
abstract class MacOSXCanvasPeerInfo extends MacOSXPeerInfo {
private final AWTSurfaceLock awt_surface = new AWTSurfaceLock();
public MacOSXCanvasPeerInfo(PixelFormat pixel_format) throws LWJGLException {
super(pixel_format, true, true, false, true);
public MacOSXCanvasPeerInfo(PixelFormat pixel_format, boolean support_pbuffer) throws LWJGLException {
super(pixel_format, true, true, support_pbuffer, true);
}
protected void initHandle(Canvas canvas) throws LWJGLException {

View File

@ -215,7 +215,11 @@ final class MacOSXDisplay implements DisplayImplementation {
}
public PeerInfo createPeerInfo(PixelFormat pixel_format) throws LWJGLException {
return new MacOSXDisplayPeerInfo(pixel_format);
try {
return new MacOSXDisplayPeerInfo(pixel_format, true);
} catch (LWJGLException e) {
return new MacOSXDisplayPeerInfo(pixel_format, false);
}
}
private final static IntBuffer current_viewport = BufferUtils.createIntBuffer(16);

View File

@ -44,8 +44,8 @@ import org.lwjgl.LWJGLException;
final class MacOSXDisplayPeerInfo extends MacOSXCanvasPeerInfo {
private boolean locked = false;
public MacOSXDisplayPeerInfo(PixelFormat pixel_format) throws LWJGLException {
super(pixel_format);
public MacOSXDisplayPeerInfo(PixelFormat pixel_format, boolean support_pbuffer) throws LWJGLException {
super(pixel_format, support_pbuffer);
}
protected void doLockAndInitHandle() throws LWJGLException {