   Text is brown ><
  I had it grey before, but now I''m making a diff program, and it''s brown all the time, regardless of glColor3f or alpha blending turned off. It used to be brown when I had alpha blending on it, but I fixed that by turning it off before the text was written.here''s my code;   int InitGL(GLvoid)// OpenGL Setup{if (!LoadGLTextures())// Jump To Texture Loading Routine ( NEW ){return FALSE;// If Texture Didn''t Load Return FALSE ( NEW )}glEnable(GL_TEXTURE_2D);// Enable Texture Mapping ( NEW )glShadeModel(GL_SMOOTH);// Enables Smooth ShadingglClearColor(0.0f, 0.0f, 0.0f, 0.5f);// Sets background to BlackglClearDepth(1.0f);// Sets up Depth BufferglEnable(GL_DEPTH_TEST);// Enables Depth TestingglDepthFunc(GL_LEQUAL);// Sets type of Depth TestingglHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);// Sets Perspective calculations to NiceBuildFont();glLightfv(GL_LIGHT1, GL_AMBIENT, LightAmbient);// Setup The Ambient LightglLightfv(GL_LIGHT1, GL_DIFFUSE, LightDiffuse);// Setup The Diffuse LightglLightfv(GL_LIGHT1, GL_POSITION,LightPosition);// Position The LightglEnable(GL_LIGHT1);// Enable Light OneglColor4f(1.0f,1.0f,1.0f,0.5f);// Full Brightness, 50% Alpha ( NEW )glBlendFunc(GL_SRC_ALPHA,GL_ONE);// Blending Function For Translucency Based On Source Alpha Value ( NEW return TRUE;// Initialization Went OK}/**** turns on alpha blending ****/void AlphaOn(){glDisable(GL_DEPTH_TEST);glEnable(GL_BLEND);}/**** turns off alpha blending ****/void AlphaOff(){glEnable(GL_DEPTH_TEST);glDisable(GL_BLEND);}int DrawGLScene(GLvoid){glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);// Clear Screen and Depth BufferglLoadIdentity();// Reset the current Modelview MatrixglTranslatef(x,0.0f,z);glRasterPos2f(-2.6f,1.8f);FrameRate();glPrint("%2.0f", FPSCounter);glPrint(" FPS");glRotatef(xrot,1.0f,0.0f,0.0f);// Rotate On The X AxisglRotatef(yrot,0.0f,1.0f,0.0f);// Rotate On The Y AxisglBegin(GL_QUADS);// Draws squares/quadsglBindTexture(GL_TEXTURE_2D, texture[0]);// Select A Texture Based On filter// Front FaceglNormal3f( 0.0f, 0.0f, 1.0f);// Normal Pointing Towards ViewerglTexCoord2f(0.0f, 0.0f); glVertex3f(ax, ay, az);// Bottom Left Of The Texture and QuadglTexCoord2f(1.0f, 0.0f); glVertex3f(bx, by, bz);// Bottom Right Of The Texture and QuadglTexCoord2f(1.0f, 1.0f); glVertex3f(cx, cy, cz);// Top Right Of The Texture and QuadglTexCoord2f(0.0f, 1.0f); glVertex3f(dx, dy, dz);// Top Left Of The Texture and QuadglEnd();xrot+=xspeed;// Add xspeed To xrotyrot+=yspeed;// Add yspeed To yrotreturn TRUE;// Returns True if drawing succesful}any ideas? 
  ok I''ve changed the loaded texture to a green-based one and now the text is green..but I''m binding the texture AFTER the glPrint is done, and setting glColor3f(1,1,1) doesn''t work either..;quote:Original post by Squalion  ok I''ve changed the loaded texture to a green-based one and now the text is green..but I''m binding the texture AFTER the glPrint is done, and setting glColor3f(1,1,1) doesn''t work either..Do a glDisable(GL_TEXTURE_2D);before you render the text and re-enable it after.You might have to disable lighting too, I can''t remember.    - CheeseMonger ;  glBindTexture() sets the texture to use until the next call to glBindTexture(). My guess is, that somewhere you set the texture using glBindTexture() and never reset it, so everything will be drawn with that texture. To disable the texture you can either use 0 as the texture id: glBindTexture(GL_TEXTURE_2D, 0) or disable textures and re-enable them later: glDisable(GL_TEXTURE_2D).   [edited by - leroy on July 31, 2003 12:59:39 PM];  Thanks a lot..I was thinking along those lines to disable it, but didn''t think you could.I didn''t think you had to because in my other prog, it was grey, but I realise my last texture from that was grey too. Doh ;  "glPrint("%2.0f", FPSCounter);"What will happen if the user has 200 frames per second? He would see 00!! Use:glPrint("%.0f", FPSCounter);   "C lets you shoot yourself in the foot rather easily. C++ allows you to reuse the bullet!"  ;  It doesn''t count for digits on the left side of the point :O(well, not in that context) ;quote:Original post by Squalion  It doesn''t count for digits on the left side of the point :O(well, not in that context)   He is correct... but if it was less than 10, it would prepend a 0 .  So, you''d see 09 fps instead of just 9.  But, it would still display 100 properly .  I like to display a few decimal places, so I normally use %0.2f because it would do ANY padding in the front, but will always display 2 numbers after the decimal point . ;  While we''re on the topic of how text is affected by texturing and lighting, I can figure out how to disable the texture while I print the text, but is there a way to disable the lighting for it in a scene where there is (and has to) light? 