kvark's picture

[GL] Remove DawElements overload with Integer last parameter

Project:The Open Toolkit library
Version:1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:postponed
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

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

#1

Status:open» postponed

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 int overload was added during the Tao framework era when the last parameter was either object or IntPtr (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.

kvark's picture

#2

Ok, thanks for the clarification!