Results 1 to 4 of 4

Thread: Should you use double or GLdouble?

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2000
    Posts
    14

    Should you use double or GLdouble?

    when coding opengl programs using mfc should u use GL'type' or int float bool or double etc?does it make a difference?

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: Should you use double or GLdouble?

    Usually it doesn't make much difference. A GLfloat is identical to a float on most platforms. GLfloat is just for portability. GLfloat is guarateed to give you a 32-bit floatingpoint representation, even though a standard float is something else, for example 64-bit. Same goes for all other types. On some 64-bit platforms an int, for example, is 64-bit long. But a GLint is guarateed to always be 32-bit.

  3. #3
    Member Newbie
    Join Date
    Dec 2000
    Location
    Donetsk, Ukraine
    Posts
    48

    Re: Should you use double or GLdouble?

    Actually, I dont understand, why they do such things. I dont think that it will be time when GLdouble will not be double. Sometimes, it seems me even stupid. Same as, for example
    #define ULTRAFASTCALL __fastcall

    What are platforms where float is 64 bit??

    [This message has been edited by Randolph (edited 03-18-2001).]

  4. #4
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: Should you use double or GLdouble?

    Some high-end computers (you know, $10k an up ) uses 64-bit architecture. Not that I know if they use 64-bit floats, but I won't be surprised if they do.

    The reason is called compatability. Consider you have a file containing an object. Each vertex of the object is 3 32-bit floats. If you try to load that object on a platform where float is 64-bit, you are doomed. If you instead read them as GLfloat, you will read them as 32-bit float. Is that stupid?

Similar Threads

  1. GLdouble
    By dukey in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 01-08-2013, 04:31 PM
  2. Debugging OpenGL: Converting GLDouble to char...
    By gooowe in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 02-05-2011, 04:15 PM
  3. double precision (glDouble) useful at all or not?
    By felpy in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 12-23-2009, 09:46 AM
  4. about GLdouble
    By Barbary in forum OpenGL: Advanced Coding
    Replies: 7
    Last Post: 03-31-2005, 12:42 AM
  5. GLdouble & float compatibility
    By hoshi55 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 03-25-2002, 06:05 AM

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