X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=helpers%2Fglsize.hpp;h=c4fe9bf9c866b5aa19c0b4283a9acf3998c39102;hb=ddf6d2c5e347f8ca25dad4d9be4a1494d8929d30;hp=b4ec2512e8fca0b5d72cde652055b61d422bf104;hpb=cab5ff17fedfb682734103495d70c531c02590ab;p=apitrace diff --git a/helpers/glsize.hpp b/helpers/glsize.hpp index b4ec251..c4fe9bf 100644 --- a/helpers/glsize.hpp +++ b/helpers/glsize.hpp @@ -329,11 +329,19 @@ _glArrayPointer_size(GLint size, GLenum type, GLsizei stride, GLsizei count) #define _glVertexAttribPointerARB_size(size, type, normalized, stride, count) _glArrayPointer_size(size, type, stride, count) #define _glVertexAttribPointerNV_size(size, type, stride, count) _glArrayPointer_size(size, type, stride, count) +/** + * Same as glGetIntegerv, but passing the result in the return value. + */ +static inline GLint +_glGetInteger(GLenum pname) { + GLint param = 0; + _glGetIntegerv(pname, ¶m); + return param; +} + static inline GLint _element_array_buffer_binding(void) { - GLint element_array_buffer = 0; - _glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, &element_array_buffer); - return element_array_buffer; + return _glGetInteger(GL_ELEMENT_ARRAY_BUFFER_BINDING); } static inline GLuint