[ pyopengl-Bugs-2939786 ] glColor wrapper doesn't handle tuple of floats properly

"SourceForge.net" <[email protected]> Mon, 25 Jan 2010 22:47:53 +0000
Newsgroups gmane.comp.python.opengl.devel
Message-ID <[email protected]>
Bugs item #2939786, was opened at 2010-01-25 22:47
Message generated for change (Tracker Item Submitted) made by nobody
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105988&aid=2939786&group_id=5988

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: GL
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Mike C. Fletcher (mcfletch)
Summary: glColor wrapper doesn't handle tuple of floats properly

Initial Comment:
In the following fragment of exceptional.py 

Either  GLdoubleArray should be used or colorDispatch should refer to glColorXfv not glColorXdv. In simpler words types should match or there is no effect to glColor call

colorDispatch = {
    3: annotations.glColor3dv,
    4: annotations.glColor4dv,
}

def glColor( *args ):
    """glColor*f* -- convenience function to dispatch on argument type
       dispatches to glColor3f, glColor2f, glColor4f, glColor3f, glColor2f, glColor4f
       depending on the arguments passed...
    """
    arglen = len(args)
    if arglen == 1:
        arg = arrays.GLfloatArray.asArray( args[0] )
        function = glColorDispatch[arrays.GLfloatArray.arraySize( arg )]
        return function( arg )
    elif arglen == 2:
            return simple.glColor2d( *args )
    elif arglen == 3:
        return simple.glColor3d( *args )
    elif arglen == 4:
            return simple.glColor4d( *args )
    else:
        raise ValueError( """Don't know how to handle arguments: %s"""%(args,))

Tested on Gentoo linux, 
PyOpengl 3.0.1_beta1 and beta2 
Python 2.6.4

email: [email protected]

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105988&aid=2939786&group_id=5988

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net