Here is some DX stuff hacked together a while back.
Local gw:Float = 800.0
Local gh:Float = 600.0
Local depth:Float = 2.0
Local scale :Float = 1.0
Local angle:Float=0.0
Graphics gw , gh
AutoMidHandle True
Local image1:timage=LoadImage("max.png")
Local image2:timage=LoadImage("flare.png")
'SetViewport -400,-300,1200,1000
setmatrix(gw,gh,depth,scale,angle)
While Not KeyHit(KEY_escape)
Cls
SetBlend solidblend
TileImage image1 , 0,0
SetBlend lightblend
DrawImage image2 , MouseX() , MouseY()
If MouseDown(1) scale:+ 1.0
If MouseDown(2) scale:- 1.0
If KeyHit(KEY_SPACE)
scale = 1.0
ANGLE = 0.0
End If
If KeyDown(KEY_RIGHT) ANGLE:+ 5
If KeyDown(KEY_LEFT) ANGLE:-5
setmatrix(gw , gh , depth , scale, angle)
Flip
Wend
Function setmatrix(gw:Float , gh:Float , depth:Float , scale:Float , angle:Float)
Local radangle:Float=angle'*(Pi/180)
cosangle:Float = Cos(radangle)
sinangle:Float = Sin(radangle)
minus_sinangle:Float = - Sin(radangle)
' Rem
Local matrix:Float[] =..
[2.0/gw, 0.0, 0.0, 0.0,..
0.0, (-2.0/gh), 0.0, 0.0,..
0.0, 0.0, 2.0/depth, 0.0,..
- 1.0 - (1.0 / gw) , 1.0 + (1.0 / gh) , 1.0 , scale]
Rem
Local matrix:Float[] =..
[(2.0/gw)*1.0, 0.0, 0.0, 0.0,..
0.0, cosangle*(-2.0/gh), sinagle*0.0, 0.0,..
0.0, minus_sinagle* 0.0, cosangle*(2.0/depth), 0.0,..
- 1.0 - (1.0 / gw) , 1.0 + (1.0 / gh) , 1.0 , scale]
Local matrix:Float[] =..
[cosangle*(2.0/gw), 0.0, minus_sinagle*0.0, 0.0,..
0.0, -2.0/gh, 0.0, 0.0,..
sinagle*0.0, 0.0, cosangle*(2.0/depth), 0.0,..
-1.0-(1.0/gw), 1.0+(1.0/gh), 1.0, scale]
End Rem
D3D7GraphicsDriver().Direct3DDevice7().SetTransform(D3DTS_PROJECTION , matrix)
End Function
I do have some DX/OGL code from Indiepath but I remember it being provided by email request only. His code also adjust the mouse pos
<edit> In fact that last bits a lie. Tim's code doesn't scale. There's quite a few hits on gamedev.net though.