Drawing an image flipped left-right?

BlitzMax Forums/OpenGL Module/Drawing an image flipped left-right?

Diordna(Posted 2005) [#1]
I want to be able to draw an image flipped over left-right. Setscale(-1,1) doesn't do anything.

EDIT: Wait, yes it does. My code was screwy. Never mind :)


N(Posted 2005) [#2]
I don't know that this'll solve the problem, but try
glDisable( GL_CULL_FACE )



fredborg(Posted 2005) [#3]
SetScale works fine...doesn't this work for you?
Graphics 640,480,0,0

DrawText "Hello",100,100

img:TImage = CreateImage(50,15)
GrabImage(img,100,100)

xspeed = 2
yspeed = 2

Repeat

	Cls

	x :+ xspeed
	y :+ yspeed

	If x>GraphicsWidth()-ImageWidth(img) Or x<0
		xspeed = -xspeed
	EndIf
	
	If y>GraphicsHeight()-ImageHeight(img) Or y<0
		yspeed = -yspeed
	EndIf

	SetScale -1,1
	DrawImage img,x,y

	Flip

Until KeyHit(KEY_ESCAPE)



bradford6(Posted 2005) [#4]
slight mod to fredborgs code:

Graphics 640,480,0,0

DrawText "BlitzMAX",100,100

img:TImage = CreateImage(50,15)
GrabImage(img,100,100)

xspeed = 2
yspeed = 2

Repeat

	Cls

	x :+ xspeed
	y :+ yspeed

	If x>GraphicsWidth()-ImageWidth(img) Or x<0
		xspeed = -xspeed
	EndIf
	
	If y>GraphicsHeight()-ImageHeight(img) Or y<0
		yspeed = -yspeed
	EndIf
	
	SetColor spam,spam,255
	spam = spam + 1
	If spam > 360 Then spam = 0
	
	SetScale Sin(spam)*6,Cos(spam)*6
	DrawImage img,x,y

	Flip

Until KeyHit(KEY_ESCAPE)



ImaginaryHuman(Posted 2005) [#5]
He said he got it working


Booticus(Posted 2005) [#6]
Woot! I forgot about that till now! Right on! Thanks for the refresher!