glOrtho

Hi,

I’m trying to use the function glOrtho to set up a window. I know (through reading the manual) that the arguments of this function are supposed to be ‘GLdouble’ values, but I can’t find out what this actually means in terms of coding. I need to input floating point numbers into the function, and I was wondering if there might be a way of converting them across into GLdoubles.

At the moment I’m just putting floating point numbers inside the brackets, and while this works for floating point numbers that are integers, as it were (that is to say 10.0000, 34.0000 etc), it doesn’t seem to work when I use un-rounded numbers.

I was wondering if anybody might be able to help me with this.

GLdouble is simply a floating point value of certain precision. On most systems it’s typedef’ed to the double C type.

Conversion to and from GLdouble happens, as with any other numerical type, through (implicit) casts or balancing.

In the presence of a correct functio prototype for glOrtho, the conversion of the function arguments to GLdouble type happens automatically. glOrtho(1,2,3,4,5,6) and glOrtho(1.0,2.0,3.0,4.0,5.0,6.0) both work and have the same result.

Using arguments with non-zero fractional parts is perfectly valid and should definately work, so there’s probably something else wrong.