Optional Width and Height parameter for DisplaySprite
Posted: Thu Sep 03, 2009 8:43 am
I doubt adding optional Width and Height parameter for DisplaySprite() is a big problem in any of the subsystems (I'm not sure for SDL but at least in OpenGL, DX7 and DX9 it should be possible) even though it would help alot for many cases of 2D graphic programming.
Until now I helped me out with this when using DX7:
Until now I helped me out with this when using DX7:
Code: Select all
Procedure DisplaySpriteEx(Sprite, x, y, width, height)
Protected *Sprite.PB_Sprite = IsSprite(Sprite)
If *Sprite
Protected *BackBuffer.IDirectDrawSurface7
!extrn _PB_DirectX_BackBuffer
!MOV Eax, [_PB_DirectX_BackBuffer]
!MOV [p.p_BackBuffer], Eax
Protected rect.RECT
rect\left = x
rect\right = x + width
rect\top = y
rect\bottom = y + height
*BackBuffer\Blt(rect, *Sprite\Sprite, 0, 0, 0)
EndIf
EndProcedure