The Rotation/Scaling Parameter-Attributes are internally shadowed to avoid screen tearing and should be transmitted to hardware during Vertical Blank.
Please see "demos/ObjRotation" for an example program.
#define HEL_SUBSYSTEM_OBJROTSCALE_REQUIREDMEMORY |
Required memory for the Object Rotation/Scaling System.
This define represents the amount of memory, specified in bytes, the Object Rotation/Scaling System from HEL requires to manage its internal states. When you initialize the Object Rotation/Scaling System, you must pass a buffer which equals the size of HEL_SUBSYSTEM_OBJROTSCALE_REQUIREDMEMORY.
THandle hel_ObjRotScaleClone | ( | THandle | Handle | ) |
Clone a Rotation/Scaling Set.
The hel_ObjRotScaleClone function clones an existing Rotation/Scaling Set.
[in] | Handle | Handle of Rotation/Scaling Set you want to clone |
THandle hel_ObjRotScaleCreate | ( | u32 | Angle, | |
s32 | ScaleX, | |||
s32 | ScaleY | |||
) |
Create a new Rotation/Scaling Set.
The hel_ObjRotScaleCreate creates a new Rotation/Scaling Set and returns a Handle to it.
[in] | Angle | Rotation-angle in degree (0..359) |
[in] | ScaleX | Horizontal scaling |
[in] | ScaleY | Vertical scaling |
void hel_ObjRotScaleDelete | ( | THandle | Handle | ) |
Delete a Rotation/Scaling Set.
The hel_ObjRotScaleDelete deletes the Rotation/Scaling Set specified by Handle
when it's not referenced anymore.
[in] | Handle | Handle of Rotation/Scaling Set you want to delete |
HEL_INLINE u32 hel_ObjRotScaleGetFreeSlots | ( | void | ) |
Get amount of free Rotation/Scaling Sets.
The hel_ObjRotScaleGetFreeSlots returns the amount of unused/free Rotation/Scaling Sets. This value is between 0..31.
void hel_ObjRotScaleInit | ( | void * | pBuffer | ) |
Initialize Object Rotation/Scaling SubSystem.
Call hel_ObjRotScaleInit to initialize the Rotation/Scaling Parameter Sub-System. This function must be called before using any other Object Rotation/Scaling function.
[in] | pBuffer | Must point to a buffer of at least HEL_SUBSYSTEM_OBJROTSCALE_REQUIREDMEMORY allocated bytes. The buffer must be word-aligned and should be located in EWRAM. It must not be changed after initialization as long as the Object Rotation/Scaling System is running! |
// Allocate memory for Object Rotation/Scaling-System u8 ATTR_EWRAM ATTR_ALIGNED(4) g_ObjRotScaleBuffer[HEL_SUBSYSTEM_OBJROTSCALE_REQUIREDMEMORY]; int main(void) { // Initialize Object Rotation/Scaling Sub-System hel_ObjRotScaleInit((void*)g_ObjRotScaleBuffer); // ... }
void hel_ObjRotScaleQuit | ( | void | ) |
Uninitialize Object Rotation/Scaling SubSystem.
Call hel_ObjRotScaleQuit to uninitialize the Rotation/Scaling Parameter SubSystem.
void hel_ObjRotScaleTransmit | ( | void | ) |
Transmit Rotation/Scaling Parameters to hardware.
The hel_ObjRotScaleTransmit copies the shadowed Object Rotation/Scaling attributes to hardware (Vram).
This function should be called during Vertical Blank.
void hel_ObjRotScaleUpdate | ( | THandle | Handle, | |
u32 | Angle, | |||
s32 | ScaleX, | |||
s32 | ScaleY | |||
) |
Update Rotation/Scaling Parameters.
hel_ObjRotScaleUpdate can be used to update the parameters of an existing Rotation/Scaling Set. This includes the rotation-angle and scale.
[in] | Handle | Handle of Rotation/Scaling Set |
[in] | Angle | Rotation-angle in degree |
[in] | ScaleX | Horizontal scale |
[in] | ScaleY | Vertical scale |