Login  Register

Re: jogl + nvidia cg demos / tutorials

Posted by siddharth_univ on Feb 28, 2012; 4:55am
URL: https://forum.jogamp.org/SOLVED-jogl-nvidia-cg-demos-tutorials-tp3762403p3783027.html

Hello Sven,

I am sorry to reply to this thread late. I was caught up with work.

I downloaded jogl-demos from http://jogamp.org/deployment/jogamp-current/archive/jogl-demos.7z. I might be wrong, but i could not find cg examples. There were cg shader files themselves but no java files using them. Further these were binaries and no source included in the zip file.

I cloned your git repository  to get the demo source(  git clone http://github.com/sgothel/jogl-demos.git jogl-demos ).. i navigated to its make directory to find build.xml and did an "ant".. but i got this error:

[javac] Compiling 172 source files to C:\jogl2-src\jogl-demos\build\classes
[javac] Since fork is false, ignoring memoryMaximumSize setting.
[javac] C:\jogl2-src\jogl-demos\src\demos\applets\GearsJOALApplet.java:11: package com.jogamp.openal.util does
[javac] import com.jogamp.openal.util.ALut;
[javac]                              ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:40: package com.jogamp.openal does not
[javac] import com.jogamp.openal.*;
[javac] ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:41: package com.jogamp.openal.util does
[javac] import com.jogamp.openal.util.*;
[javac] ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:164: cannot find symbol
[javac] symbol  : class AL
[javac] location: class demos.joal.SingleStaticSource
[javac]   private AL al;
[javac]           ^
[javac] C:\jogl2-src\jogl-demos\src\demos\applets\GearsJOALApplet.java:47: cannot find symbol
[javac] symbol: variable ALut
[javac]             ALut.alutExit();
[javac]             ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:195: cannot find symbol
[javac] symbol  : variable ALut
[javac] location: class demos.joal.SingleStaticSource
[javac]       ALut.alutInit();
[javac]       ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:196: cannot find symbol
[javac] symbol  : variable ALFactory
[javac] location: class demos.joal.SingleStaticSource
[javac]       al = ALFactory.getAL();
[javac]            ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:198: cannot find symbol
[javac] symbol  : class ALException
[javac] location: class demos.joal.SingleStaticSource
[javac]     } catch (ALException e) {
[javac]              ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:204: cannot find symbol
[javac] symbol  : variable AL
[javac] location: class demos.joal.SingleStaticSource
[javac]       if (loadALData() == AL.AL_FALSE)
[javac]                           ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:206: cannot find symbol
[javac] symbol  : class ALException
[javac] location: class demos.joal.SingleStaticSource
[javac]     } catch (ALException e) {
[javac]              ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:229: cannot find symbol
[javac] symbol  : variable AL
[javac] location: class demos.joal.SingleStaticSource
[javac]     if (al.alGetError() != AL.AL_NO_ERROR) {
[javac]                            ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:230: cannot find symbol
[javac] symbol  : class ALException
[javac] location: class demos.joal.SingleStaticSource
[javac]       throw new ALException("Error generating OpenAL buffers");
[javac]                 ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:239: cannot find symbol
[javac] symbol  : variable ALut
[javac] location: class demos.joal.SingleStaticSource
[javac]     ALut.alutLoadWAVFile(
[javac]     ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:256: cannot find symbol
[javac] symbol  : variable AL
[javac] location: class demos.joal.SingleStaticSource
[javac]     if (al.alGetError() != AL.AL_NO_ERROR)
[javac]                            ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:257: cannot find symbol
[javac] symbol  : class ALException
[javac] location: class demos.joal.SingleStaticSource
[javac]       throw new ALException("Error generating OpenAL source");
[javac]                 ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:259: cannot find symbol
[javac] symbol  : variable AL
[javac] location: class demos.joal.SingleStaticSource
[javac]     al.alSourcei(source[0], AL.AL_BUFFER, buffer[0]);
[javac]                             ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:260: cannot find symbol
[javac] symbol  : variable AL
[javac] location: class demos.joal.SingleStaticSource
[javac]     al.alSourcef(source[0], AL.AL_PITCH, 1.0f);
[javac]                             ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:261: cannot find symbol
[javac] symbol  : variable AL
[javac] location: class demos.joal.SingleStaticSource
[javac]     al.alSourcef(source[0], AL.AL_GAIN, 1.0f);
[javac]                             ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:262: cannot find symbol
[javac] symbol  : variable AL
[javac] location: class demos.joal.SingleStaticSource
[javac]     al.alSourcei(source[0], AL.AL_LOOPING, loop[0]);
[javac]                             ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:265: cannot find symbol
[javac] symbol  : variable AL
[javac] location: class demos.joal.SingleStaticSource
[javac]     if (al.alGetError() != AL.AL_NO_ERROR)
[javac]                            ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:266: cannot find symbol
[javac] symbol  : class ALException
[javac] location: class demos.joal.SingleStaticSource
[javac]       throw new ALException("Error setting up OpenAL source");
[javac]                 ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:272: cannot find symbol
[javac] symbol  : variable AL
[javac] location: class demos.joal.SingleStaticSource
[javac]     al.alSourcefv(source[0], AL.AL_POSITION, sourcePos, 0);
[javac]                              ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:273: cannot find symbol
[javac] symbol  : variable AL
[javac] location: class demos.joal.SingleStaticSource
[javac]     al.alSourcefv(source[0], AL.AL_VELOCITY, sourceVel, 0);
[javac]                              ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:275: cannot find symbol
[javac] symbol  : variable AL
[javac] location: class demos.joal.SingleStaticSource
[javac]     return AL.AL_TRUE;
[javac]            ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:279: cannot find symbol
[javac] symbol  : variable AL
[javac] location: class demos.joal.SingleStaticSource
[javac]     al.alListenerfv(AL.AL_POSITION, listenerPos, 0);
[javac]                     ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:280: cannot find symbol
[javac] symbol  : variable AL
[javac] location: class demos.joal.SingleStaticSource
[javac]     al.alListenerfv(AL.AL_VELOCITY, listenerVel, 0);
[javac]                     ^
[javac] C:\jogl2-src\jogl-demos\src\demos\joal\SingleStaticSource.java:281: cannot find symbol
[javac] symbol  : variable AL
[javac] location: class demos.joal.SingleStaticSource
[javac]     al.alListenerfv(AL.AL_ORIENTATION, listenerOri, 0);

The other route i tried to take was just to see the source code for one of the examples for cg that i had cloned from your git repository. When i tried to do a CgGL.cgCreateProgram() or CgGL.cgCreateProgramFromStream(), i always get a null for the CgProgram. I presume that this is due to not setting up my jars properly in eclipse?

Currently i have a user library created called jogl-cg-2.0 that contains :
jogl.cg.jar
jogl_cg-natives-windows-amd64.jar

for both these jars, i have my native library located pointed to %NVIDIA_CG_LIB_PATH%.. is this correct? or should i point it to a directory containing jogl_cg.dll... Either way, i tried both these locations and i still get a null when i create a CgProgram..

Any help would be great..

sorry for the long post..

thanks