
[GL] Remove DawElements overload with Integer last parameter
Posted Friday, 11 February, 2011 - 23:53 by kvark| Project: | The Open Toolkit library |
| Version: | 1.x-dev |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed |
Jump to:
Description
The GL.DrawElements method has an overload with the last parameter of type Integer. It is very confusing, because you expect it to be the number of elements to skip, but instead you get a byte offset.


Comments
#1
The last parameter of DrawElements is indeed overloaded to mean either "array of elements" or "byte offset" depending on use (Vertex Arrays vs Vertex Buffer Objects). This is the official OpenGL design, not something specific to OpenTK.
The
intoverload was added during the Tao framework era when the last parameter was eitherobjectorIntPtr(no generics then). Many people would pass integers when they meant IntPtr, which would invoke the object overload and promptly crash the application.It's too late to remove the int overload now (backwards compatibility) but this could be revisited in a future, API-breaking release.
#2
Ok, thanks for the clarification!