diff options
Diffstat (limited to 'src/demos/GLInfo.java')
-rwxr-xr-x | src/demos/GLInfo.java | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/src/demos/GLInfo.java b/src/demos/GLInfo.java index d17ad28..a5a0a91 100755 --- a/src/demos/GLInfo.java +++ b/src/demos/GLInfo.java @@ -3,6 +3,7 @@ package demos; import java.nio.*; import javax.media.opengl.*; import javax.media.opengl.glu.*; +import javax.media.nativewindow.*; import com.sun.javafx.newt.*; import com.sun.javafx.newt.opengl.*; @@ -12,10 +13,14 @@ public class GLInfo implements GLEventListener { private GLWindow window; private void run(int type) { - int width = 10; - int height = 10; + int width = 256; + int height = 256; System.err.println("GLInfo.run()"); - GLProfile.setProfileGLAny(); + if(null==glprofile) { + GLProfile.setProfileGLAny(); + } else { + GLProfile.setProfile(glprofile); + } try { GLCapabilities caps = new GLCapabilities(); // For emulation library, use 16 bpp @@ -27,9 +32,10 @@ public class GLInfo implements GLEventListener { Window nWindow = null; if(0!=(type&USE_AWT)) { - Display nDisplay = NewtFactory.createDisplay(NewtFactory.AWT, null); // local display - Screen nScreen = NewtFactory.createScreen(NewtFactory.AWT, nDisplay, 0); // screen 0 - nWindow = NewtFactory.createWindow(NewtFactory.AWT, nScreen, caps); + Display nDisplay = NewtFactory.createDisplay(NativeWindowFactory.TYPE_AWT, null); // local display + Screen nScreen = NewtFactory.createScreen(NativeWindowFactory.TYPE_AWT, nDisplay, 0); // screen 0 + nWindow = NewtFactory.createWindow(NativeWindowFactory.TYPE_AWT, nScreen, caps); + System.err.println(nWindow); //nWindow.setVisible(true); } window = GLWindow.create(nWindow, caps); @@ -67,9 +73,19 @@ public class GLInfo implements GLEventListener { System.err.println(" Fixed: glBegin: "+gl.isFunctionAvailable("glBegin")); System.err.println(" ES1 : glClearColorx: "+gl.isFunctionAvailable("glClearColorx")); System.err.println(" GLSL : glUseProgram: "+gl.isFunctionAvailable("glUseProgram")); + System.err.println(" GL_ARB_vertex_array_object: "+gl.isExtensionAvailable("GL_ARB_vertex_array_object")); + System.err.println(" GL_ARB_vertex_array_object: glBindVertexArray: "+gl.isFunctionAvailable("glBindVertexArray")); + System.err.println(" GL_EXT_gpu_shader4: "+gl.isExtensionAvailable("GL_EXT_gpu_shader4")); + System.err.println(" GL_EXT_gpu_shader4: glBindFragDataLocation"+gl.isFunctionAvailable("glBindFragDataLocation")); + System.err.println(" GL_VERSION_3_0: "+gl.isExtensionAvailable("GL_VERSION_3_0")); + System.err.println(" GL_VERSION_3_0: glBeginConditionalRender: "+gl.isFunctionAvailable("glBeginConditionalRender")); + System.err.println(" GL_ARB_texture_buffer_object: "+gl.isExtensionAvailable("GL_ARB_texture_buffer_object")); + System.err.println(" GL_ARB_texture_buffer_object: glTexBuffer: "+gl.isFunctionAvailable("glTexBuffer")); + System.err.println(" GL_VERSION_3_1: "+gl.isExtensionAvailable("GL_VERSION_3_1")); System.err.println(" EGL : eglCreateContext: "+gl.isFunctionAvailable("eglCreateContext")); System.err.println(" EGLEx: eglCreateImage: "+gl.isFunctionAvailable("eglCreateImage")); System.err.println(" GLX : glXCreateWindow: "+gl.isFunctionAvailable("glXCreateWindow")); + System.err.println(" GLX_ARB_create_context: "+gl.isExtensionAvailable("GLX_ARB_create_context")); System.err.println(" WGL : wglCreateContext: "+gl.isFunctionAvailable("wglCreateContext")); System.err.println(" CGL : CGLCreateContext: "+gl.isFunctionAvailable("CGLCreateContext")); } @@ -88,6 +104,7 @@ public class GLInfo implements GLEventListener { public static int USE_NEWT = 0; public static int USE_AWT = 1 << 0; + public static String glprofile = null; public static void main(String[] args) { int type = USE_NEWT ; @@ -95,6 +112,9 @@ public class GLInfo implements GLEventListener { if(args[i].equals("-awt")) { type |= USE_AWT; } + if(args[i].startsWith("-GL")) { + glprofile=args[i].substring(1); + } } new GLInfo().run(type); System.exit(0); |