Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualhaegarr

Posted 30 December 2012 - 04:22 AM

glGetAttribLocation uses a result of -1 to denote a problem. Cited from one of the links in the OP:

... If the named attribute variable is not an active attribute in the specified program object or if name starts with the reserved prefix "gl_", a value of -1 is returned.
-1 is noticeably different from the "valid" values, and it doesn't make sense to pass such an index into glEnableVertexAttribArray. Doing this requires a signed return type for glGetAttribLocation, but for the glEnableVertexAttribArray index an unsigned parameter type is still appropriate. (Whether this is a solution one is happy with is another question.)

#2haegarr

Posted 30 December 2012 - 04:21 AM

glGetAttribLocation uses a result of -1 to denote a problem. Cited from one of the links in the OP:

... If the named attribute variable is not an active attribute in the specified program object or if name starts with the reserved prefix "gl_", a value of -1 is returned.
-1 is noticeably different from the "valid" values, and it doesn't make sense to pass such an index into glEnableVertexAttribArray. Doing this requires a signed return type for glGetAttribLocation, but for the glEnableVertexAttribArray index an unsigned index is still appropriate.

#1haegarr

Posted 30 December 2012 - 04:20 AM

glGetAttribLocation uses a result of -1 to denote a problem. Cited from one of the links in the OP:

 

 

... If the named attribute variable is not an active attribute in the specified program object or if name starts with the reserved prefix "gl_", a value of -1 is returned.

 

-1 is noticeably different from the "valid" values, and it doesn't make sense to pass such an index into glEnableVertexAttribArray. Doing this requires a signed return type for glGetAttribLocation, but for the glEnableVertexAttribArray index an unsigned index is still appropriate.


PARTNERS