From 048f09aafe49e4eaddfe25ec4b302268510bc27b Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Thu, 2 Sep 2010 22:56:19 +0200 Subject: CLPlatform.getDefault() returns now the platform with the latest version --- src/com/jogamp/opencl/CLPlatform.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/com/jogamp') diff --git a/src/com/jogamp/opencl/CLPlatform.java b/src/com/jogamp/opencl/CLPlatform.java index 70b27a0a..802a6e9c 100644 --- a/src/com/jogamp/opencl/CLPlatform.java +++ b/src/com/jogamp/opencl/CLPlatform.java @@ -113,9 +113,13 @@ public final class CLPlatform { */ public static CLPlatform getDefault() { CLPlatform[] platforms = listCLPlatforms(); - if(platforms.length > 0) - return platforms[0]; - return null; + CLPlatform best = platforms[0]; + for (CLPlatform platform : platforms) { + if(platform.version.compareTo(best.version) > 0) { + best = platform; + } + } + return best; } /** -- cgit v1.2.3