diff options
Diffstat (limited to 'src/demos/GLInfo.java')
-rwxr-xr-x | src/demos/GLInfo.java | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/src/demos/GLInfo.java b/src/demos/GLInfo.java index d222944..157860e 100755 --- a/src/demos/GLInfo.java +++ b/src/demos/GLInfo.java @@ -17,7 +17,7 @@ public class GLInfo extends Thread implements GLEventListener { super(); } - private void start(String glprofile, int type) { + private void init(String glprofile, int type) { int width = 256; int height = 256; glp = GLProfile.GetProfile(glprofile); @@ -41,27 +41,41 @@ public class GLInfo extends Thread implements GLEventListener { } window = GLWindow.create(nWindow, caps); + System.err.println(glp+" GLWindow : "+window); + window.addGLEventListener(this); // Size OpenGL to Video Surface window.setSize(width, height); // window.setFullscreen(true); - start(); } catch (Throwable t) { t.printStackTrace(); } } + private void runInThread(String glprofile, int type) { + init(glprofile, type); + run(); + } + + private void start(String glprofile, int type) { + init(glprofile, type); + start(); + } public void run() { try { - System.err.println(glp+" GLInfo.run()"); + System.err.println(glp+" GLInfo.run() 1"); window.setVisible(true); + System.err.println(glp+" GLInfo.run() 2"); + window.display(); + System.err.println(glp+" GLInfo.run() 3"); + try { Thread.sleep(500); } catch (Exception e) {} @@ -138,19 +152,17 @@ public class GLInfo extends Thread implements GLEventListener { public static void main(String[] args) { String glprofile = null; int type = USE_NEWT ; - int num=0; for(int i=args.length-1; i>=0; i--) { if(args[i].equals("-awt")) { type |= USE_AWT; } if(args[i].startsWith("-GL")) { + if(null!=glprofile) { + new GLInfo().start(glprofile, type); + } glprofile=args[i].substring(1); - new GLInfo().start(glprofile, type); - num++; } } - if(0==num) { - new GLInfo().start(glprofile, type); - } + new GLInfo().runInThread(glprofile, type); } } |