Page 1 of 1

[fixed]compiling 1.7; Invalid conv. from 'void*' to 'GLuint'

Posted: Thu Feb 04, 2010 5:34 pm
by DavidJE13
Refraining from posting this in bug reports because it's probably something I missed, but when I compile 1.7 on OSX I get several errors about this.

The line complained about is this one in COpenGLExtensionHandler.h, line 1796;

Code: Select all

glProgramParameteriEXT(program, pname, value);
2 errors:
Invalid conversion from 'void*' to 'GLuint'
Initializing argument 1 of 'void glProgramParameteriEXT(GLuint, GLenum, GLint)'

Did I miss a compile option?

Posted: Fri Feb 05, 2010 12:45 am
by hybrid
Hmm, thougt I tested the 1.7 branch under OSX. Will check this out in the next days.

Posted: Fri Feb 05, 2010 8:33 am
by booltox
I was able to move forward by changeing the line to

Code: Select all

glProgramParameteriEXT(GLuint)program, pname, value);

Posted: Fri Feb 05, 2010 9:37 am
by hybrid
Yeah, you're right. The first parameter is GLuint. I need to figure out how to create the shader program properly, now. Because right now it's created as handle, which means a void*. Will be fixed soon :)

Posted: Fri Feb 05, 2010 10:16 pm
by hybrid
This seems to be a little more problematic, because I need to adapt the new OpenGL 2.x shader creation scheme. I'll try to avoid the compilation problems (need to test under OSX), and will fix all things for Irrlicht 1.8 then.

Posted: Tue Feb 16, 2010 1:17 am
by fabietto
There's one missing bracket in the code above, which should look like:

Code: Select all

glProgramParameteriEXT((GLuint)program, pname, value);
By the way, I incurred in the same compiling error on Snow Leopard. And thanks to this post I've been able to fix it quickly. Nice one! :)

Posted: Tue Feb 16, 2010 10:35 am
by hybrid
Just try the latest SVN (or wait for 1.7.1) where it should also be fixed else. BTW: SVN/trunk has an enhanced version which should work even better, at least more reliable for versions of OpenGL 2.x and up.

Posted: Tue Feb 16, 2010 11:52 am
by alexionne
I've just updated to trunk, but there are still problems with void* to GLuint conversion inc COpenGLSLMaterialRenderer.cpp on lines: 330, 340, 343, 354, 365, 367 and 387. Adding (GLuint) indeed makes Irrlicht compile.

Posted: Tue Feb 16, 2010 2:32 pm
by hybrid
Yeah, but it wouldn't work then anymore. This was a typo. It's fixed now. Thanks for mentioning.

Posted: Tue Feb 16, 2010 5:01 pm
by alexionne
It works now! Thanks for the quick fix :-)

Posted: Tue Feb 16, 2010 9:18 pm
by hybrid
Actually, it took some more tweaks to really get it working :? I tested it on a machine which I supposed to have OpenGL2, but in fact didn't have... That's why it's so much worth to have your known machines!

Posted: Wed Feb 17, 2010 9:59 am
by alexionne
Unfortunately, it's not my personal Mac, so I don't have access to it all the time, but only during development, so I cannot guarantee I'll have it when next beta comes out to test it...

Posted: Wed Feb 17, 2010 12:15 pm
by hybrid
Well, I just had to switch to a different machine with OpenGL 2 on it, where I could see at least some of the compiler warnings and also the non-functionality of the resulting code :)