Author Topic: OpenGl Question  (Read 2978 times)

0 Members and 2 Guests are viewing this topic.

Peter

  • Guest
OpenGl Question
« on: February 05, 2011, 05:56:51 AM »
 Deleted..
« Last Edit: May 05, 2015, 12:12:58 PM by Peter »

Charles Pegge

  • Guest
Re: OpenGl Question
« Reply #1 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
« Last Edit: February 05, 2011, 07:29:25 AM by Charles Pegge »

kryton9

  • Guest
Re: OpenGl Question
« Reply #2 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;



kryton9

  • Guest
Be careful with opengl color types, problem when coding in c++
« Reply #3 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.

« Last Edit: December 07, 2011, 10:45:38 PM by kryton9 »

Petr Schreiber

  • Guest
Re: OpenGl Question
« Reply #4 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

kryton9

  • Guest
Re: OpenGl Question
« Reply #5 on: December 08, 2011, 05:30:23 PM »
Thanks Petr, didn't know about possible 'double' problems anywhere else.