PDA

View Full Version : Isn't GLsizei supposed to be size_t?



xahir
05-15-2013, 01:12 PM
According to the specification GLsizei is "Non-negative binary integer size", what I understand is the type should be unsigned. But in my linux and windows development environments "gl.h" defines it as "typedef int GLsizei;". Moreover, glcorearb.h (http://www.opengl.org/registry/api/glcorearb.h) at the registry defines it as "int" as well. Do I understand the spec wrong? What am I missing?

Groovounet
05-15-2013, 04:18 PM
According to the specification GLsizei is "Non-negative binary integer size", what I understand is the type should be unsigned. But in my linux and windows development environments "gl.h" defines it as "typedef int GLsizei;". Moreover, glcorearb.h (http://www.opengl.org/registry/api/glcorearb.h) at the registry defines it as "int" as well. Do I understand the spec wrong? What am I missing?

What the specification says is that the type is signed but the values assign to that type can't be negative... Yes GLsizei is a int which I agree is a strange idea.