In OpenGL some functions take pointers and these are easily handled via

v = Pointer.new('f', 20)
glVertexPointer(3, GL_FLOAT, 3,  v)

(the C prototype is 
void glVertexPointer(GLint  size, GLenum  type, GLsizei  stride, const GLvoid * 
 pointer);


however in some cases this function has been overloaded so you pass in an 
integer as the last parameter.  In C this is easy
glVertexPointer(3, GL_FLOAT, 3, (void *) 12)

but how do I do this with MacRuby Pointer objects?  (the source code and 
googling hasn't helped).  I can (and have) written this as an objective-C 
method and called this method from ruby so I have a workaround.  I can 
understand if this is not possible or desirable from ruby as it is a horrible 
bit of API design in OpenGL in any case.

Dave.

_______________________________________________
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

Reply via email to