Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Type aliases

  1. #1
    Junior Member Regular Contributor Kopelrativ's Avatar
    Join Date
    Apr 2011
    Posts
    212

    Type aliases

    I had some code that used sizeof(GL_UNSIGNED_INT). But then I changed it to sizeof(GL_UNSIGNED_SHORT), but I couldn't get it to work. It took me a couple of hours to identify the reason.

    I am not asking for help, just writing to get rid of my frustration. Hopefully someone will enjoy it.

  2. #2
    Junior Member Regular Contributor
    Join Date
    Nov 2010
    Location
    Brazil, Rio de Janeiro
    Posts
    147

    Re: Type aliases

    Are you sure this was the only reason?

    GL_UNSIGNED_INT is defined as 0x1405 and GL_UNSIGNED_SHORT as 0x1403, both are integers, so sizeof will return 4 for both cases.

  3. #3
    Member Regular Contributor
    Join Date
    Apr 2007
    Posts
    271

    Re: Type aliases

    McLeary is right.

    You are looking for sizeof(GLuint) and sizeof(GLushort).

    Just read through GL/gl.h. It's that simple.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •