Non-mipmapped textures don't work?

BlitzMax Forums/BlitzMax Programming/Non-mipmapped textures don't work?

Hi

I'm loading in an image as a pixmap and converting it to a texture using bglTexFromPixmap. By default, mipmapping is set to on and I can display it OK on an OpenGL quad. If I turn mipmapping off for that texture it just displays as a white square.

Is this happening for anyone else?

Hi,

You probably need to set the min and mag filters, eg:

glBindTexture GL_TEXTURE_2D,my_tex
glTexParameteri GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST
glTexParameteri GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST

Even if mipmapping is off?

That's how you turn mipmapping off!

The bglTexFromPixmap flags just determines whether mipmaps are built - not enabled.

Yeah that was it - I had the glTexParameteri lines before the glBindTexture. :/

GL_NEAREST for 2D quads looks rubbish on my machine. It distorts the textures ever so slightly in a way that is very noticable on a TFT. I thought it was the mipmapping, but using GL_LINEAR is a big improvement. I guess DrawImage uses GL_LINEAR?