opengl attributes

Adds get/set for opengl attribute functions. The opengl functions return 0 on success, so I added another inline function for getting the error messages.

Aside; error handling could be improved, I think most functions should return something like `Either` and/or `Maybe` to indicate failure instead of using `error` so much.