Fix some compiler warnings

This commit is contained in:
rdb 2009-09-12 10:45:49 +00:00
parent 9542e67c7b
commit 5f4fe3bc32
3 changed files with 6 additions and 8 deletions

View File

@ -122,15 +122,11 @@ CPT(Shader::ShaderFile) default_shader_name = new Shader::ShaderFile("default-sh
CPT(Shader::ShaderFile) default_shader_body = new Shader::ShaderFile("\
uniform mediump mat4 p3d_ModelViewProjectionMatrix;\
attribute highp vec4 p3d_Vertex;\
void main(void) {\
gl_Position = p3d_ModelViewProjectionMatrix * p3d_Vertex;\
}\n",
"void main(void) {\
gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\
}\n");
#endif

View File

@ -354,6 +354,9 @@ release_resources(GSG *gsg) {
if (_cg_context) {
cgDestroyContext(_cg_context);
_cg_context = 0;
if (_cg_vprogram != 0) cgDestroyProgram(_cg_vprogram);
if (_cg_fprogram != 0) cgDestroyProgram(_cg_fprogram);
if (_cg_gprogram != 0) cgDestroyProgram(_cg_gprogram);
_cg_vprogram = 0;
_cg_fprogram = 0;
_cg_gprogram = 0;
@ -492,6 +495,8 @@ issue_parameters(GSG *gsg, int altered) {
return;
}
//FIXME: this could be much faster if we used deferred parameter setting.
for (int i=0; i<(int)_shader->_mat_spec.size(); i++) {
if (altered & (_shader->_mat_spec[i]._dep[0] | _shader->_mat_spec[i]._dep[1])) {
const LMatrix4f *val = gsg->fetch_specified_value(_shader->_mat_spec[i], altered);
@ -840,7 +845,7 @@ update_shader_texture_bindings(CLP(ShaderContext) *prev, GSG *gsg) {
////////////////////////////////////////////////////////////////////
#ifdef HAVE_CG
void CLP(ShaderContext)::
cg_report_errors() {
cg_report_errors() {
CGerror err = cgGetError();
if (err != CG_NO_ERROR) {
GLCAT.error() << cgGetErrorString(err) << "\n";

View File

@ -55,10 +55,7 @@ private:
CGcontext _cg_context;
CGprogram _cg_vprogram;
CGprogram _cg_fprogram;
// BEGIN CG2 CHANGE
CGprogram _cg_gprogram;
// END CG2 CHANGE
pvector <CGparameter> _cg_parameter_map;
void cg_report_errors();