texturing a quad

BlitzMax Forums/BlitzMax OpenGL Programming/texturing a quad

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Hi Chris,

I got it working in windowed and fullscreen modes (Win32Beta) but the image looks terrible.
Any ideas on how to display pixel-perfect quads?

Graphics 800,600,0

Global w,h
Global tex=LoadTexture("testimage.bmp")

glTexParameteri GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR
glTexParameteri GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR
glLoadIdentity
glEnable GL_TEXTURE_2D

While Not KeyHit(KEY_ESCAPE)
	mx=MouseX() ; my=MouseY()
	Cls
	glLoadIdentity
	glBindTexture GL_TEXTURE_2D,tex
	' quad
	glBegin GL_QUADS
	 glTexCoord2f 0.0, 0.0 ; glVertex2f mx , my
	 glTexCoord2f 1.0, 0.0 ; glVertex2f mx+w , my
	 glTexCoord2f 1.0, 1.0 ; glVertex2f mx+w , my+h
	 glTexCoord2f 0.0, 1.0 ; glVertex2f mx , my+h
	glEnd
	FlushMem
	Flip
	Delay 10
Wend

End

Function LoadTexture(f$)
	Local pm:TPixmap=LoadPixmap(f$)
	w=pm.width ; h=pm.height
	Local texname=bglTexFromPixmap(pm)
	Return texname
End Function