BrowserUk has asked for the wisdom of the Perl Monks concerning the following question:
Update: My bad. I was including an alpha value in the color array. Being used to perl sub just ignoring extra args whilst I worked out how to use aplha values in OpenGL. But XS subs aren't like perl subs, and the extra value causes the sub to print it's usage message and fail. :(
I finally got OpenGL built and installed and I'm just starting to play with it and I encountered a Perl problem that I haven't experienced before. I'm trying to call glColor3f() within a subroutine into which I'm passing an array ref containing the rgb values.
But that (and all other failures) bellyaches Usage: OpenGL::glColor3f(red, green, blue) at...
Quick peruse of the xs source shows:
void glColor3f(red, green, blue) GLfloat red GLfloat green GLfloat blue
Which doesn't clarify what's going on. Can you?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XS prototype (or not) problem?
by salva (Canon) on Jul 24, 2008 at 08:47 UTC | |
|
Re: XS prototype (or not) problem?
by syphilis (Archbishop) on Jul 24, 2008 at 08:13 UTC | |
by BrowserUk (Patriarch) on Jul 24, 2008 at 08:30 UTC | |
by syphilis (Archbishop) on Jul 24, 2008 at 09:21 UTC | |
|
Re: XS prototype (or not) problem?
by cdarke (Prior) on Jul 24, 2008 at 07:59 UTC | |
by Anonymous Monk on Jul 24, 2008 at 08:08 UTC | |
by BrowserUk (Patriarch) on Jul 24, 2008 at 08:08 UTC |