Hi to all!
i have an problem…
some time ago i use one time, simple Cg vertex shader, with position,color and texcoords, and all works propertly…
but now, i cant initialize my vertex shader
next i will write problems in comments
cgProfile = CgGL.cgGLGetLatestProfile(CgGL.CG_GL_VERTEX);
if (cgProfile == CgGL.CG_PROFILE_UNKNOWN
|| cgProfile == CgGL.CG_INVALID_ENUMERANT_ERROR) {
cgSupport = false;
} else {
//profile will equals int 7001 or CG_PROFILE_VP4
/*
* i have an GeForce 8600 GT and latest nVidia drivers with supporting OpenGL 3
* and CgToolkit 2.1, cg.dll and cgGL.dll i have copy to jre/lib/ext
*/
cgSupport = true;
cgContex = CgGL.cgCreateContext();
cgVertexShader = CgGL.cgCreateProgramFromFile
(cgContex, CgGL.CG_SOURCE, "CgBasics.cg", cgProfile, "main", null);
// context creates normally
// but:
try {
cgVertexShader = CgGL.cgCreateProgramFromStream(cgContex,
CgGL.CG_SOURCE,new FileInputStream("CgBasics.cg"),cgProfile,"main",null);
} catch (IOException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
// cgVertexShader will not create even if i use CgGL.CreateProgramFromFile(...)
// result will be equals "null"
CgGL.cgGLLoadProgram(cgVertexShader);
// and after that step cgVertexProgram will equals null
cgModelViewProj = CgGL.cgGetNamedParameter(cgVertexShader, "modelViewProj");
}
please help :-\