I think I finally got SOIL installed with Visual Studio 2008. The only problem is that after using the code on their website, all I get is a single flat color. I get a different color depending on the texture, which I believe means that something is working… I hope, please let me know if you have any suggestions
Below is snippets of my relevant code for texturing in two functions. BTW, cout does not print an error:
(init func)
/* load an image file directly as a new OpenGL texture */
tex_2d = SOIL_load_OGL_texture
(
“img_test.bmp”,
SOIL_LOAD_AUTO,
SOIL_CREATE_NEW_ID,
SOIL_FLAG_MIPMAPS | SOIL_FLAG_INVERT_Y | SOIL_FLAG_NTSC_SAFE_RGB | SOIL_FLAG_COMPRESS_TO_DXT
);
/* check for an error during the load process */
if( 0 == tex_2d )
{
std::cout << "SOIL loading error: '%s'
", SOIL_last_result() ;
}
(display func)
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, tex_2d);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_LINEAR);
drawSnowMan();
glDisable(GL_TEXTURE_2D);