   Need help using GL_INTENSITY for textures(SOLVED)
  The scenario is this:I have pointer: unsigned char * data;pointing to (width * height * 3) bytes of RGB data.What I need to do is make an GL_INTENSITY texture from it to save space. All the colors are in grayscale, if it helps/hurts. I've tried it myself and researched it, but it comes out blank unless I make it an RGB texture.My line of code:    gluBuild2DMipmaps( GL_TEXTURE_2D, GL_INTENSITY, width, height,   GL_RGB, GL_UNSIGNED_BYTE, data );Can anyone point me in the right direction?[Edited by - Ectara on June 2, 2009 2:23:02 PM]
http://www.opengl.org/wiki/Common_Mistakes#gluBuild2DMipmapsand alsohttp://www.opengl.org/wiki/Common_Mistakes#Creating_a_Texture;  Useful, but does not answer my question. Thank you anyway.   ;  It does answer your question. You have problem with gluBuild2DMipmaps, and it's so old that the mechanism that deprecated it has been deprecated itself already. Use one of the modern, and build in, mechanisms to generate mipmaps.   ;  Just tried again; no use.Current font file is a v2 .eoi format 0 image containing 256x256 pixels of RGB data in the file.Loads into font.data for use in my font class, where font is the identifier of the EOI class within my Efont class, containing functions for drawing the texmapped quads. Making a texture of the same kind that is in the file works fine.//CODE:class Efont{public:Efont();void loadFont(const si8 * filename);void clearFont();void makeTexture(bool wrap);si32 println(const si8 * string, sf32 x, sf32 y, sf32 z, sf32 max, sf32 point);si32 printch(ui8 ch, sf32 x, sf32 y, sf32 z, sf32 point);private:ui32 texture;EOI font;}; //load Ectarica Online Image formatui8 * EOI::loadEOI( const si8 * filename){    Ectaraio io;    if (!io.open( filename, "rb" ))return 0;-snip-if(format==1){data = (ui8*)malloc( width * height * 4 );if(Eerror::getAllocError(data,TEST_CHAR))return 0;io.read((si8*)data, 1, width * height * 4);}else if(format==0){data = (ui8*)malloc( width * height * 3 );if(Eerror::getAllocError(data,TEST_CHAR))return 0;io.read((si8*)data, 1, width * height * 3);}else{fprintf(stderr,"Read error for %s : Format check failed (%u)\n",filename,format);return 0;}    io.close();printf("Read successful for %s\n",filename);    return data;}void Efont::makeTexture(bool wrap){void * texData = font.getData();//returns address of font.data    glGenTextures( 1, &texture );    glBindTexture( GL_TEXTURE_2D, texture );    glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL );    glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST );    glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );    glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrap ? GL_REPEAT : GL_CLAMP );    glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrap ? GL_REPEAT : GL_CLAMP );    glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);if(font.format==0)  glTexImage2D(GL_TEXTURE_2D, 0, GL_INTENSITY, font.width, font.height, 0, GL_RGB, GL_UNSIGNED_BYTE, texData);else if(font.format==1)  glTexImage2D(GL_TEXTURE_2D, 0, GL_INTENSITY, font.width, font.height, 0, GL_RGBA, GL_UNSIGNED_BYTE, texData);else glDeleteTextures(1, &texture);return;}-------------------Still gives me blank quads when I draw. Any ideas?   ;  Anyone have any ideas?   ;  Try GLIntercepthttp://www.opengl.org/wiki/Debugging_Toolsto view the texture.   ;  Not sure if it will help (plus, I'm running Debian).  glTexImage2D(GL_TEXTURE_2D, 0, GL_INTENSITY, font.width, font.height, 0, GL_RGB, GL_UNSIGNED_BYTE, texData);Is this an illegal line? Because a lot of suggestions say to convert GL_LUMINANCE to GL_INTENSITY, but all I have is RGB.   ;  Solved. Didn't occur to me to set GL_DECAL to GL_MODULATE in the font class. Thanks to all.   