summaryrefslogtreecommitdiffstats
path: root/src/demos
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2008-06-26 03:49:57 +0000
committerKenneth Russel <[email protected]>2008-06-26 03:49:57 +0000
commit8bc1a27e399cf6d22806e680ca1c16b4f72b8930 (patch)
tree7f150770e85e628b600e35968febe4b5b958d1f4 /src/demos
parentbb4b1bb18201e64386f7ac94a774aa21c1b3b88f (diff)
Added error checking during startup
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JOGL_2_SANDBOX@251 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
Diffstat (limited to 'src/demos')
-rwxr-xr-xsrc/demos/es1/RedSquare.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/demos/es1/RedSquare.java b/src/demos/es1/RedSquare.java
index 1e64d89..97b6730 100755
--- a/src/demos/es1/RedSquare.java
+++ b/src/demos/es1/RedSquare.java
@@ -64,7 +64,12 @@ public class RedSquare implements MouseListener {
window.setVisible(true);
drawable.setRealized(true);
GLContext context = drawable.createContext(null);
- context.makeCurrent();
+ System.out.println("Created context: " + context);
+ int res = context.makeCurrent();
+ if (res == GLContext.CONTEXT_NOT_CURRENT) {
+ System.out.println("Unable to make OpenGL context current, exiting...");
+ System.exit(0);
+ }
GL2ES1 gl = context.getGL().getGL2ES1();
System.out.println("Created GL: "+gl);