diff options
author | Michael Bien <[email protected]> | 2010-09-10 22:03:49 +0200 |
---|---|---|
committer | Michael Bien <[email protected]> | 2010-09-10 22:03:49 +0200 |
commit | fbe5e85e6017d757ae97a897690b31e897242b38 (patch) | |
tree | 54dd3f1b0000e4ff23626f32c82d8ba24284bfa8 /src/com/jogamp/opencl/demos/info/CLInfo.java | |
parent | fdf5b4006df497a5b2a2e7c013cd621e7a50e248 (diff) |
exception reporter for CLInfo.
Diffstat (limited to 'src/com/jogamp/opencl/demos/info/CLInfo.java')
-rw-r--r-- | src/com/jogamp/opencl/demos/info/CLInfo.java | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/com/jogamp/opencl/demos/info/CLInfo.java b/src/com/jogamp/opencl/demos/info/CLInfo.java index af7e30c..0975f7b 100644 --- a/src/com/jogamp/opencl/demos/info/CLInfo.java +++ b/src/com/jogamp/opencl/demos/info/CLInfo.java @@ -4,24 +4,43 @@ package com.jogamp.opencl.demos.info; +import com.jogamp.common.JogampRuntimeException; import com.jogamp.opencl.CLDevice; import com.jogamp.opencl.CLPlatform; +import com.jogamp.opencl.util.ExceptionReporter; import java.awt.Container; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.swing.JEditorPane; import javax.swing.JFrame; import javax.swing.JScrollPane; +import javax.swing.UIManager; /** - * + * Displays OpenCL information in a table. * @author Michael Bien */ public class CLInfo { public static void main(String[] args) { + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (Exception ex) { + Logger.getLogger(CLInfo.class.getName()).log(Level.INFO, null, ex); + } + + try{ + CLPlatform.initialize(); + }catch(JogampRuntimeException ex) { + Logger.getLogger(CLInfo.class.getName()).log(Level.SEVERE, null, ex); + ExceptionReporter.appear("I tried hard but I really can't initialize JOCL. Is OpenCL properly set up?", ex); + return; + } + JFrame frame = new JFrame("OpenCL Info"); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); Container contentPane = frame.getContentPane(); |