Original Post
I use eclipse with c++ plugin under linux. Been trying to load a TGA texture. Used the TGA loader at GPWiki(http://gpwiki.org/index.php/LoadTGACpp). My code terminates when gluBuild2DMipmaps is called. gluErrorString(gluBuild2DMipmaps( wasn't giving me anything in eclipse for some strange reason. so i transferred the code to VC++ under windows and get "gl_out_of_memory". I rewrite a more simple TGA loader from a book, and get the same error. googled the problem, didn't come up with much. Any help would be appreciated. I think the TGA Loaders are fine, so i'll post where glubuild is called and and rendering is done at the moment. Though its pretty simple.
void Room::LoadTextures()
{
if(TGALoader.Load("Wall.tga")){
glGenTextures(1, &w_Texture);
glBindTexture(GL_TEXTURE_2D, w_Texture);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
gluBuild2DMipmaps(GL_TEXTURE_2D, 3, TGALoader.GetWidth(), TGALoader.GetHeight(), GL_RGB, GL_UNSIGNED_BYTE, TGALoader.GetImage());
}
}
void Room::Render(){
glBindTexture(GL_TEXTURE_2D, w_Texture);
glBegin(GL_QUADS);
glTexCoord2f (0.0f, 0.0f); glVertex3f(0.0f, 0.0f, 0.0f);
glTexCoord2f (0.0f, 1.0f); glVertex3f(0.0f, 5.0f, 0.0f);
glTexCoord2f (1.0f, 1.0f); glVertex3f(5.0f, 5.0f, 0.0f);
glTexCoord2f (1.0f, 0.0f); glVertex3f(5.0f, 0.0f, 0.0f);
glDisable(GL_TEXTURE_2D);
glEnd();
}