Hi Stephan, Thanks for testing and provide a proposed fix. I've reviewed this fix and found it not quite appropriate, but highly revealing - it's points out a bug due to be mixing texture unit GLenum target with the actual unit number, it's not the same, as it should be offset from GL_TEXTURE0, i.e. GLenum target = GL_TEXTURE0 + texture_unit. Code calling GLBeginEndAdapter was actually doing the correct target usage, but GLBeginEnd was then using the target as a the texture_unit which it isn't... it's actually texture_unit = target-GL_TEXTURE0;
So the fix for GLBeginEndAdapter::MultiTextCoord*() as to change the first parameter to enum as you suggested, and then change the internal mapping of the target to the internal array by converting the target to the actual texture_unit. In this instance we are quite lucky that the OSX build broke as it may well have taken quite a bit longer to spot this mistake ;-) The change you made to the GLBegnEndAdapter::VertexAttrib*() changing the first parameter to GLenum was also inappropriate, as the glVertexAttrub*() has GLuint as it's first parameter, so for consistency with GL I've changed this to GLuint. Which leads me on to the question, GLuint 64bit under OSX? I've now checked these changes into svn/trunk, could you please check them out and see if they compile and run fine under OSX? Thanks, Robert. On Thu, Oct 22, 2009 at 8:52 AM, Stephan Maximilian Huber <[email protected]> wrote: > Hi Robert, > > the new class GLBeginEndAdapter makes problems under OS X. I get compile > errors when compiling ArrayDispatchers: > > /Users/stephan/Documents/Projekte/cefix/3rdParty/osg.current/Xcode/OpenSceneGraph/../../src/osg/ArrayDispatchers.cpp: > In member function ‘void > osg::ArrayDispatchers::assignTexCoordDispatchers(unsigned int)’: > /Users/stephan/Documents/Projekte/cefix/3rdParty/osg.current/Xcode/OpenSceneGraph/../../src/osg/ArrayDispatchers.cpp:507: > error: no matching function for call to > ‘osg::AttributeDispatchMap::targetGLBeginEndAssign(GLenum, > osg::Array::Type, void (osg::GLBeginEndAdapter::*)(unsigned int, const > GLfloat*), int)’ > /Users/stephan/Documents/Projekte/cefix/3rdParty/osg.current/Xcode/OpenSceneGraph/../../src/osg/ArrayDispatchers.cpp:508: > error: no matching function for call to > ‘osg::AttributeDispatchMap::targetGLBeginEndAssign(GLenum, > osg::Array::Type, void (osg::GLBeginEndAdapter::*)(unsigned int, const > GLfloat*), int)’ > /Users/stephan/Documents/Projekte/cefix/3rdParty/osg.current/Xcode/OpenSceneGraph/../../src/osg/ArrayDispatchers.cpp:509: > error: no matching function for call to > ‘osg::AttributeDispatchMap::targetGLBeginEndAssign(GLenum, > osg::Array::Type, void (osg::GLBeginEndAdapter::*)(unsigned int, const > GLfloat*), int)’ > /Users/stephan/Documents/Projekte/cefix/3rdParty/osg.current/Xcode/OpenSceneGraph/../../src/osg/ArrayDispatchers.cpp:510: > error: no matching function for call to > ‘osg::AttributeDispatchMap::targetGLBeginEndAssign(GLenum, > osg::Array::Type, void (osg::GLBeginEndAdapter::*)(unsigned int, const > GLfloat*), int)’ > > This is because GLenum may be defined as unsigned long when compiled as > 64bit, but in GLBeginEndAdapter the units are declared as unsigned int, > so the compile fails for OS X. > > Attached you'll find a modified GLBeginAdapter + .cpp which fixes this > problem for OS X. My changes should work also on other platforms. > > cheers, > Stephan > > _______________________________________________ > osg-submissions mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org > > _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
