banthar/gl — pull request #60 by shogg (2012-03-14 20:09:48+00:00)
Title: Hi, I dropped GetGLenumType and made the param 'type GLenum' explicitly required again in function calls

GetGLenumType isn't working in many cases and made things more harder to use than easier as intended. We should stop relying on slow runtime reflection. It's so simple to provide the correct type!

I added tests in 'gl_test.go' to show that all functions still work as expected and to demonstrate how the api now can be used in more ways (offsets in VBOs and nil pointers are now supported). To run the tests change into the gl directory and type 'go test'.

Here is the complete commit message:
-----------

!! This is a compatibility breaking change !!

GetGLenumType is gone. There where too many cases where GetGLenumType
couldn't determine an element type. Functions now have the 'type GLenum'
param that you find in the OpenGl specs (it's called 'typ GLenum'
though because of the keyword name clash).

The interface{} param in functions now accepts slices, pointers, uintptr
and nil values. Uintptr is used to specify the offset into a VBO. Some
functions allow a nil value for reserving memory without uploading data.
Arrays aren't supported anymore. They never worked.

Special functions ending in VBO and Typed got removed. They aren't
needed anymore.

I added tests for the functions with a interface{} param. The functions
get called with all supported types (slices, pointers, uintptr) and
with the nil value if applicable. Run with 'go test'.