Disabling Pixel Smoothing in GL Drawmodes?

BlitzMax Forums/OpenGL Module/Disabling Pixel Smoothing in GL Drawmodes?

zoqfotpik(Posted 2013) [#1]
I'm drawing in GL and I need raw pixels instead of gl smoothed pixels (this is for a sprite packer, had to draw in GL in order to preserve alpha transparency.)

Here's my graphics statement:
Graphics 1152,600,0,0,GRAPHICS_BACKBUFFER | GRAPHICS_DEPTHBUFFER | GRAPHICS_ALPHABUFFER

How do I disable the GL blur?

[Actually scratch that, I used cls without the alpha function posted a long while back and it worked.]

Function ClsWithAlpha(r:Float = 0.0, g:Float = 0.0, b:Float = 0.0, a:Float = 1.0)
	glClearColor r, g, b, a
	glClear GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT
End Function


This is from here:
http://www.blitzbasic.com/Community/posts.php?topic=85368

I am still constantly blown away with the level of knowledge some people have about these products.


jkrankie(Posted 2013) [#2]
It's:

glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);

add that after you've bound your texture.

Cheers
Charlie