Results 1 to 2 of 2

Thread: Benefit of GLfloat, etc?

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2000

    Benefit of GLfloat, etc?

    Pretty quick question, just wondering what the reason for using (or not using) the gl* types.

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Feb 2000

    Re: Benefit of GLfloat, etc?

    Pro: portability. In theory, the GLfloat for a platform might actually be a double, though I've never heard of anyone actually doing this.

    Con: extra dependency. You have to #include gl.h where you wouldn't otherwise need to. Physics code, file format loaders etc probably want to use the same basic type as your OpenGL rendering code, but there's no reason for them to include the GL header.

    Compromise: set up your own typedef for your basic scalar type, and use that everywhere. If GLfloat does change, you'll only have to change the one decl to match.

Similar Threads

  1. Early depth pass benefit when target is FBO?
    By Swoop in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 12-27-2008, 08:31 PM
  2. Why should i use GLfloat instead of float ?
    By greg2 in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 08-22-2007, 08:21 PM
  3. printf (GLfloat) ??
    By vofka in forum OpenGL: Advanced Coding
    Replies: 7
    Last Post: 04-20-2002, 02:50 PM
  4. float vs. GLfloat
    By Glossifah in forum OpenGL: Advanced Coding
    Replies: 6
    Last Post: 03-09-2001, 02:35 PM
  5. Glfloat etc...
    By zzapatista in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 02-21-2001, 10:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean