vendredi 20 février 2015

glColor3f does not change the color


I'm working on a Win32 app in C/C++ with SDL.

I have a weird problem with glColor3f command.

I want to print some text on my screen, it is working but the color of the text stay white.

The only way I have found so far to change the color is that : glColor3f(255,0,0);


I have tried this but the text still white :



// 1 try :
GLfloat Red = static_cast<GLfloat>(Objet.GetCouleurMenuRed()); // 255
GLfloat Green = static_cast<GLfloat>(Objet.GetCouleurMenuGreen()); // 0
GLfloat Blue = static_cast<GLfloat>(Objet.GetCouleurMenuBlue()); // 0
// 2 try :
float Red = static_cast<float>(Objet.GetCouleurMenuRed()); // 255
float Green = static_cast<float>(Objet.GetCouleurMenuGreen()); // 0
float Blue = static_cast<float>(Objet.GetCouleurMenuBlue()); // 0
// 3 try :
int Red = Objet.GetCouleurMenuRed(); // 255
int Green = Objet.GetCouleurMenuGreen(); // 0
int Blue = Objet.GetCouleurMenuBlue(); // 0

glColor3i(Red, Green, Blue); // --> Nothing on the screen
glColor3f(Red, Green, Blue); // --> Text OK but still white


I watch with a debug point the value in Red, Green, Blue : It is good.

So what is wrong with this please ? Thanks.




Aucun commentaire:

Enregistrer un commentaire