Oxygen Basic

Programming => Problems & Solutions => Topic started by: Peter on February 05, 2011, 05:56:51 AM

Title: OpenGl Question
Post by: Peter on February 05, 2011, 05:56:51 AM
 Deleted..
Title: Re: OpenGl Question
Post by: Charles Pegge on February 05, 2011, 07:17:52 AM
Hi Peter,

glFloat is Single.

If you want to use the c headers included in inc/glo2/gl then glfloat is already defined for you.

If your width and height are long then Oxygen will automatically convert them when making a gl call but I recommend using single for most of the graphical variables.

Even color values (0..1.0)

glcolor4f .5, .5, .7, .5
etc

Charles
Title: Re: OpenGl Question
Post by: kryton9 on February 09, 2011, 09:49:06 PM
(glFloat)width is a way that in C they make sure a variable is cast to what they want, that is the (glFloat) part. It does not define a variable as does glfloat width;


Title: Be careful with opengl color types, problem when coding in c++
Post by: kryton9 on December 07, 2011, 10:43:35 PM
The problem occurred in my c++ project. So this is not an oxygen bug.
I have been using glColor3d for a few weeks in setting my opengl colors, no problems. Tonight I ran into a strange thing when clearing the background to grey and setting a polygon to another color grey, the second grey would come out white. The solution was to use glColor3ub or glColor3f instead.  I thought I would post this to save others wasteful hours trying to figure it out.

Title: Re: OpenGl Question
Post by: Petr Schreiber on December 08, 2011, 01:43:05 AM
Thanks Kent for the hint,

I would strongly recommend to avoid all OpenGL functions ending on D, which operate with double precision. The behavior will not be consistent, the double precision calculations are not present on the most of GPUs available today, so it often gets converted to singles and so on.


Petr
Title: Re: OpenGl Question
Post by: kryton9 on December 08, 2011, 05:30:23 PM
Thanks Petr, didn't know about possible 'double' problems anywhere else.