Move getPbufferCaps to DisplayImplementation. Mac OS X pbuffer support

This commit is contained in:
Elias Naur 2004-11-18 12:10:28 +00:00
parent c307e9a13e
commit 9ec94cb364
10 changed files with 182 additions and 43 deletions

View file

@ -234,4 +234,7 @@ public interface DisplayImplementation {
public Object createCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException;
public void destroyCursor(Object cursor_handle);
/* Pbuffer caps */
public int getPbufferCaps();
}

View file

@ -102,4 +102,5 @@ final class LinuxDisplay implements DisplayImplementation {
}
public native void destroyCursor(Object cursorHandle);
public native int getPbufferCaps();
}

View file

@ -376,6 +376,10 @@ final class MacOSXDisplay implements DisplayImplementation {
public void destroyCursor(Object cursor_handle) {
}
public int getPbufferCaps() {
return GL11.glGetString(GL11.GL_EXTENSIONS).indexOf("GL_APPLE_pixel_buffer") != -1 ? Pbuffer.PBUFFER_SUPPORTED : 0;
}
/**
* This class captures com.apple.eawt.ApplicationEvents through reflection
* to enable compilation on other platforms than Mac OS X

View file

@ -236,7 +236,9 @@ public final class Pbuffer {
*
* @return a bitmask of Pbuffer capabilities.
*/
public static native int getPbufferCaps();
public static int getPbufferCaps() {
return Display.getImplementation().getPbufferCaps();
}
/**
* Native method to create a Pbuffer

View file

@ -102,4 +102,5 @@ final class Win32Display implements DisplayImplementation {
}
public native void destroyCursor(Object cursorHandle);
public native int getPbufferCaps();
}