Description
I wanted to wrap the OpenGL API to create a safer interface. Like many other APIs the OpenGL API gives away integer tokens representing created objects. For example, the call glCreateProgram creates a GLuint token representing a shader program object. These tokens in the OpenGL API (and other similar APIs) are basically the same idea as pointer types. Because these tokens behave similarly to pointers I would like to wrap them in a type which has similar behaviours. For example, the glGetAttribLocation call gets a token representing an attribute, or buffer to fill with data of a shader program. I would like to wrap the token returned by glGetAttribLocation in a structure which has the same lifetime as the program token returned by glCreateProgram, but to do this I have to use an unneeded amount of pointers (to get proper lifetime guarantees.) Basically, I would like my wrapped glGetAttribLocation call to be like:
impl GLContext {
fn get_attrib_location <'r> (
&self,
program: Program <'r>,
name: ~str
) -> Option <AttributeLocation <'r>> { /* Definition Omitted */ }
Instead of:
impl GLContext {
fn get_attrib_location <'r> (
&self,
program: &'r Program,
name: ~str
) -> Option <AttributeLocation <'r>> { /* Definition Omitted */ }
Activity
catamorphism commentedon May 24, 2013
far-future
emberian commentedon Aug 5, 2013
Visiting for traige; nothing to add.
thestinger commentedon Sep 7, 2013
Closing as duplicate of #5922
thestinger commentedon Sep 7, 2013
It seems we have at least of few reports of this, going to clean it up a bit.
Auto merge of rust-lang#5771 - montrivo:bugfix/single-match-else, r=m…