Nearest neighbor texture resizing

What’s the OpenGL option to have my textures resized as nearest neighbor rather than antialiased/smooth? I tried messing around with all the initial setup values I’ve got and none seem to make a difference.

If I’m not explaining myself well enough, basically I want something to look “pixelated” when it’s stretched, not smooth.

Easy, use glTexParameter with the filter modes set to GL_NEAREST.

for reference.
http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/texparameter.html

Hmm, I did this:


GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);

And I see no difference. I never mess with the parameters in OpenGL, so I might be doing something very wrong.

[EDIT] Nevermind, I tried just to do this in the initialization, but it turns out I needed to do it after binding my texture. It works if I put it there. Thanks for the help! [/EDIT]