Thread: GLTypes vs. Native Types

  1. #1
    Amazingly beautiful user.
    Join Date
    Jul 2005
    Location
    If you knew I'd have to kill you
    Posts
    254

    GLTypes vs. Native Types

    Is there any reason to use say, a "GLfloat" vs. just a normal "float"? So far I've just been using standard C/C++ types, but realized that there is probably a reason for OpenGL types. Which is best, when, and why?
    Programming Your Mom. http://www.dandongs.com/

  2. #2
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    OpenGL types are guarenteed to be a certain size, native types arn't.

    ex: a GLuint will be 4 bytes on every platform, but the size of an unsigned int could vary.

  3. #3
    Amazingly beautiful user.
    Join Date
    Jul 2005
    Location
    If you knew I'd have to kill you
    Posts
    254
    Thanks for the clarification.
    Programming Your Mom. http://www.dandongs.com/

  4. #4
    ---
    Join Date
    May 2004
    Posts
    1,379
    Because OpenGL is cross-platform, they try to keep it that way by doing what Perspective said.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C++ and m/c/realloc with Native Types
    By StapleGun in forum C++ Programming
    Replies: 17
    Last Post: 11-04-2008, 01:58 PM
  2. Replies: 6
    Last Post: 08-23-2008, 01:16 PM
  3. Trouble with Windows/DirectX programming
    By bobbelPoP in forum Windows Programming
    Replies: 16
    Last Post: 07-08-2008, 02:27 AM
  4. The Interactive Animation - my first released C program
    By ulillillia in forum A Brief History of Cprogramming.com
    Replies: 48
    Last Post: 05-10-2007, 02:25 AM
  5. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM