DX and repeating textures

BlitzMax Forums/BlitzMax Programming/DX and repeating textures

Hi folks,

I have a little problem with my "render both worlds"-engine (2D engine supporting both DX and GL). I had no problem with repeating textures under OpenGL, but how to do this with DX7?

So I have a quad covering 512x512 pixels on screen and a texture of 256x256. Under OpenGL I can set u1/v1 to 2.0 and the texture got mapped twice in this quad (assumming GL-texture settings are correct, which they are).

But how the hell I can achieve this under DX7 ?

Thanks in advance

Jake

PS: All answers allowed except that I have to fake this with additional quads ;) I really hate to do this...

Does this help?
Strict
Graphics 800,600
Cls
Function tg_setuv(image:TImage,u0#,v0#,u1#,v1#,frame:Int=0)
  TD3D7ImageFrame(image.frame(frame)).SetUV(u0#,v0#,u1#,v1#)
End Function
Function tg_resetuv(image:TImage,frame:Int=0)
    TD3D7ImageFrame(image.frame(frame)).SetUV(0.0,0.0,1.0,1.0)
End Function
Local base:Timage = LoadImage("max.png")
Local u0#			= 0
Local v0#			= 0
Local u1#			= 0.5
Local v1#			= 1
Local frame:Byte	 = 0
Local wrap_u0# = 0.0
Local wrap_v0#			= 0.0
Local wrap_u1#			= 2.0
Local wrap_v1#			= 2.0
While Not KeyHit(KEY_ESCAPE)
	Cls
	tg_SetUV(base,u0#,v0#,u1#,v1#)
	DrawImage(base,0,0)
	setwrap()
	tg_SETUV(base,wrap_u0#,wrap_v0#,wrap_u1#,wrap_v1#)
	DrawImage base , 400 , 0
	tg_resetuv(base)
	setnowrap()
	DrawImage base , 0 , 200
	Flip
Wend
Function setwrap()
	PrimaryDevice.device.SetTextureStageState( 0, D3DTSS_ADDRESS,	D3DTADDRESS_WRAP);
End Function
Function setnowrap()
	PrimaryDevice.device.SetTextureStageState( 0 , D3DTSS_ADDRESS , 	D3DTADDRESS_CLAMP) ; 
End Function


Couldn't you use setviewport and tileimage though?

Thanks tonyg! I can't check this now (at work), but seems like setwrap/setnowrap is the part I'm looking for. I'll try this later this day.