Closed nnooney closed 10 years ago
Actually you can also do the following:
NoBuffer().Bind(BufferTarget::Array)
Previously the 'binding object zero' (i.e. unbinding or binding default object) wrappers were quite inconsistent both with the GL and among themselves. Now all objects that can be 'bound' to a binding point (including the special objects with GL name zero - representing a 'no-object' or the 'default-object') have a function called Bind, that is used to bind the specified object to the specified target.
B.T.W. if you are worried about the performance then this:
NoBuffer().Bind(BufferTarget::Array);
basically translates to the following:
GLuint __name = 0;
glBindBuffer(GL_ARRAY_BUFFER, __name);
which any compiler with a decent optimizer can transform to:
glBindBuffer(GL_ARRAY_BUFFER, 0);
so there should not be any overhead.
That is a much more consistent way to handle things. And it won't require keeping track of a NoBuffer
.
Hi,
When I try to unbind a buffer in multiple ways I get the following errors:
Method 1:
Method 2:
Method 3:
The following method works:
Why must I keep track of a
NoBuffer
object to be able to unbind the buffers? Is there another way to unbind buffers?