vaiorabbit / ruby-opengl

Yet another OpenGL wrapper for Ruby (and wrapper code generator).
Other
88 stars 12 forks source link

glLightfv fails #28

Closed bookface closed 3 years ago

bookface commented 6 years ago

glLightfv(GL_LIGHT0, GL_DIFFUSE, [1.0, 1.0, 1.0, 1.0]) fails with "can't convert Array into Integer (TypeError)"

larskanis commented 6 years ago

You must use

glLightfv(GL_LIGHT0, GL_DIFFUSE, [1.0, 1.0, 1.0, 1.0].pack("f*"))

This gem doesn't provide Ruby style automatisms for parameter handling. Value arrays must be passed as strings therefore.