From 8bc1a27e399cf6d22806e680ca1c16b4f72b8930 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Thu, 26 Jun 2008 03:49:57 +0000 Subject: 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 --- src/demos/es1/RedSquare.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/demos') 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); -- cgit v1.2.3