Hi
First of all, I wasn't sure if this thread belonged in the Alternative Game Libraries (since I load textures with glfw) or here, hope it's right :>
So, I'm loading a texture with some smooth gradients but when i put it on a quad it doesn't look very smooth (see picture). My guesses is that it somehows loads in a 16bpp format. The strange part in this is that it looks perfectly fine on a friends computer.
As you can see in the image, the colored triangle right next to the quad looks smooth as it should but the texture doesn't.
Here's the code that I use to load a texture:
Note that no filtering is used.
bool LoadTexture( const char * path )
{
glGenTextures( 1, &global_textures[ texture_count ] );
glBindTexture( GL_TEXTURE_2D, global_textures[ texture_count ] );
texture_count++;
if( !glfwLoadTexture2D( path, 0 ) ) { return false; }
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
return true;
}
(global_textures and texturecount is defined( and it's global just when i go through nehe's tutorials :) )
The app is initialized like this:
glfwInit();
if( !glfwOpenWindow( w, h, 0,0,0,0, 0,0, mode ) )
{
glfwTerminate();
return false;
}
glfwSetWindowSizeCallback( ResizeCallback );
glfwEnable( GLFW_STICKY_KEYS );
glfwSwapInterval( 0 ); //No vsync yet
glClearColor( 0.0f, 0.0f, 0.0f, 0.0f ); // 0.3f, 0.3f, 0.6f, 0.0f
glEnable( GL_TEXTURE_2D );
glShadeModel( GL_SMOOTH );
if( !LoadTexture( "fire256.tga" ) )
{
return false;
}
So, you guys have any ideas on what it could be?
[EDIT] I've tested with linear filtering too, and it looks the same.