From 79ad31bd9fcf0fbf6e4b9aa40619f8675e18e29c Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Thu, 22 Apr 2010 03:38:54 +0200
Subject: Quick test/fix for GL/CL shared memory devices

---
 .../jogamp/opencl/demos/joglinterop/GLCLInteroperabilityDemo.java    | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'src/com/jogamp/opencl/demos/joglinterop/GLCLInteroperabilityDemo.java')

diff --git a/src/com/jogamp/opencl/demos/joglinterop/GLCLInteroperabilityDemo.java b/src/com/jogamp/opencl/demos/joglinterop/GLCLInteroperabilityDemo.java
index 24af1fe..3abe1de 100644
--- a/src/com/jogamp/opencl/demos/joglinterop/GLCLInteroperabilityDemo.java
+++ b/src/com/jogamp/opencl/demos/joglinterop/GLCLInteroperabilityDemo.java
@@ -124,6 +124,9 @@ public class GLCLInteroperabilityDemo implements GLEventListener {
                     break;
                 }
             }
+            if(null==device) {
+                throw new RuntimeException("couldn't find any CL/GL memory sharing devices ..");
+            }
             // create OpenCL context before creating any OpenGL objects
             // you want to share with OpenCL (AMD driver requirement)
             clContext = CLGLContext.create(drawable.getContext(), device);
@@ -274,4 +277,4 @@ public class GLCLInteroperabilityDemo implements GLEventListener {
         new GLCLInteroperabilityDemo();
     }
 
-}
\ No newline at end of file
+}
-- 
cgit v1.2.3