Hello
I’m working with CgFX wih JOGL. I modified a ltttle the SimpleJOGL Demo that comes with Netabeans/OpenGL Pack for use the com.sun.opengl.cg package and I just simply added this lines:
//Viene lo de CgFX
contextoCg = CgGL.cgCreateContext();
CgGL.cgGLRegisterStates(contextoCg);
efecto = CgGL.cgCreateEffectFromFile(contextoCg, "CelShading.cgfx", null);
tecnica = CgGL.cgGetFirstTechnique(efecto);
parametro = CgGL.cgGetFirstEffectParameter(efecto);
if(efecto != null){
System.out.println("Se cargo el efecto");
}else {
System.out.println("No se encontro el efecto, se continua con la aplicación");
}
int j=0;
String parameterName;
int parameterClassType;
String parameterTypeName;
while( parametro!=null){
parameterClassType = CgGL.CG_PARAMETERCLASS_UNKNOWN;
parameterTypeName = "Unknown";
j++;
parameterName = CgGL.cgGetParameterName( parametro);
System.out.println("Parametro nº "+j+" conocido como: "+parameterName );
parameterClassType = CgGL.cgGetParameterClass(parametro);
switch( parameterClassType){
case CgGL.CG_PARAMETERCLASS_SCALAR : parameterTypeName = "Escalar"; break;
case CgGL.CG_PARAMETERCLASS_VECTOR: parameterTypeName = "Vector"; break;
case CgGL.CG_PARAMETERCLASS_MATRIX : parameterTypeName = "Matriz"; break;
case CgGL.CG_PARAMETERCLASS_STRUCT : parameterTypeName = "Estructura"; break;
case CgGL.CG_PARAMETERCLASS_ARRAY : parameterTypeName = "Arreglo"; break;
case CgGL.CG_PARAMETERCLASS_SAMPLER : parameterTypeName = "Sampler"; break;
case CgGL.CG_PARAMETERCLASS_OBJECT : parameterTypeName = "Objeto"; break;
case CgGL.CG_PARAMETERCLASS_UNKNOWN : parameterTypeName = "Desconocido"; break;
default: parameterTypeName = "WEAR!";
}
System.out.println("El parametro es de clase: "+parameterTypeName);
parametro = CgGL.cgGetNextParameter(parametro);
}
int tecnicas =0;
int pases = 0;
String techniqueName, passName;
while(tecnica != null){
tecnicas++;
techniqueName = CgGL.cgGetTechniqueName(tecnica);
System.out.println("Tecnica nº "+tecnicas+" conocida como: "+techniqueName );
pase = CgGL.cgGetFirstPass(tecnica);
while(pase!=null){
pases++;
passName = CgGL.cgGetPassName(pase);
System.out.println("Pase nº "+pases+" en técnica " +techniqueName+ " se llama: " +passName );
pase = CgGL.cgGetNextPass(pase);
}
tecnica = CgGL.cgGetNextTechnique(tecnica);
}
The application, works, the file is loaded, then the windows is drawed, but… after a few seconds, suddenly, the application exits with “Segmentation fault” signal. I’m using the current release of JOGL, My OS is Ubuntu Linux 7.10.