-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use VertexAttribPointer #93
Comments
Please see the documentation of the function: http://gopkg.in/qml.v1/gl/2.0#GL.VertexAttribPointer The short version is that providing a buffer to VertexAttrbPointer is deprecated. The modern way to do this is via GenBuffer+BindBuffer+BufferData. The painting-es2 example uses it: https://github.com/go-qml/qml/blob/v1/examples/painting-es2/painting.go Regarding point 2, I disagree. Using []byte is idiomatic and prevents a copy. |
It's ok it's deprecated in you api, but if I still want to use it, is
|
I meant that my understanding is that the use of the pointer attribute to provide an array is obsoleted in OpenGL in general. That said, I'd like to support your use of it, if you really want to, and there's no good way to do that while the parameter is an int, because it may not necessarily be sized after the machine word size (although it generally is, right now). To fix that problem, I'll convert the offset type into a "uintptr", so that the proper way to do what you want would be:
That said, I'd still encourage you to provide the array as buffer data instead. |
There are some issues with OpenGL wrapper.
(I'm not sure int(uintptr(...)) is correct)
2. I think GetProgramInfoLog and GetShaderInfoLog should return string and not []byte.
Thank you
Ignazio
The text was updated successfully, but these errors were encountered: