From 61979d242e6a942b3cbbdd8d5f3b326260517eed Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Fri, 9 Sep 2005 07:35:27 +0000 Subject: Instantiated HDR demo's CgPipeline class reflectively to break compile-time dependence on Cg. Fixed bug in JNI name mangling in GlueGen with object array arguments. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JSR-231@123 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4 --- src/demos/hdr/HDR.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/demos/hdr/HDR.java b/src/demos/hdr/HDR.java index 20122f4..e10072a 100755 --- a/src/demos/hdr/HDR.java +++ b/src/demos/hdr/HDR.java @@ -9,7 +9,6 @@ import javax.swing.*; import javax.media.opengl.*; import com.sun.opengl.utils.*; -import com.sun.opengl.cg.*; import com.sun.opengl.utils.*; import demos.common.*; import demos.util.*; @@ -1020,7 +1019,14 @@ public class HDR extends Demo { private String shaderRoot = "demos/hdr/shaders/"; private void initCg(GL gl) { - pipeline = new CgPipeline(); + // NOTE: need to instantiate CgPipeline reflectively to avoid + // compile-time dependence (since Cg support might not be present) + try { + Class cgPipelineClass = Class.forName("demos.hdr.CgPipeline"); + pipeline = (Pipeline) cgPipelineClass.newInstance(); + } catch (Exception e) { + throw new GLException(e); + } pipeline.init(); try { -- cgit v1.2.3