enum AnimationLoopMode
One of
AnimationLoopMode_Default,
AnimationLoopMode_Once,
AnimationLoopMode_Loop,
AnimationLoopMode_Clamp
struct AnimationClip
A 32 bit handle.
struct AnimationTransform
Float3 local_position
Quaternion local_rotation
Float3 position
Quaternion rotation
struct AnimationTransformBuffer
AnimationTransform transforms[128]
AnimationClip_Create( void ) : AnimationClip
AnimationClip_Clone( AnimationClip animation_clip ) : AnimationClip
AnimationClip_Destroy( AnimationClip animation_clip ) : void
AnimationClip_Exists( AnimationClip animation_clip ) : bool
AnimationClip_Length( AnimationClip animation_clip ) : float
AnimationClip_FrameRate( AnimationClip animation_clip ) : float
AnimationClip_FrameCount( AnimationClip animation_clip ) : uint32_t
AnimationClip_LoopMode( AnimationClip animation_clip ) : AnimationLoopMode
AnimationClip_Load( AnimationClip animation_clip, char* file ): bool
AnimationClip_Unload( AnimationClip animation_clip ): bool
AnimationClip_SetLoopMode( AnimationClip animation_clip, AnimationLoopMode loop_mode ) : void
AnimationClip_Sample( AnimationClip animation_clip, float time, float weight, AnimationTransformBuffer* buffer ) : void
AnimationClip_SampleAdditive( AnimationClip animation_clip, float time, float weight, AnimationTransformBuffer* buffer ) : void
There can be a maximum of 16 animation layers.
struct AnimationController
A 32 bit handle.
enum AnimationLayerBlendMode
One of
AnimationLayerBlendMode_Default,
AnimationLayerBlendMode_Additive,
AnimationController_Create( void ) : AnimationController
AnimationController_Clone( AnimationController controller ) : AnimationController
AnimationController_Destroy( AnimationController controller ) : void
AnimationController_Exists( AnimationController controller ) : bool
AnimationController_GetState( AnimationController controller, Ico_Name namekey ) : AnimationState
AnimationController_CreateState( AnimationController controller, Ico_Name namekey, AnimationClip clip, uint32_t layer ) : AnimationState
AnimationController_GetState( AnimationController controller, uint32_t layer, AnimationLayerBlendMode blend_mode ) :void
AnimationController_Update( AnimationController controller, float delta_time, AnimationTransformBuffer* result ) :void
struct AnimationMask
A 32 bit handle.
AnimationMask_Create( void ) : AnimationMask
AnimationMask_Exists(AnimationMask) : void
AnimationMask_SetValue(AnimationMask, int index, float value ) : void
AnimationMask_SetAllValues( float value ) : void
typedef struct AnimationState {
AnimationController controller;
uint32_t state_id;
} AnimationState;
AnimationState_Controller( AnimationState state ) : AnimationController
AnimationState_Clip( AnimationState state ) : AnimationClip
AnimationState_Layer( AnimationState state ) : uint32_t
AnimationState_LoopMode( AnimationState state ) : AnimationLoopMode
AnimationState_Enabled( AnimationState state ) : bool
AnimationState_Weight( AnimationState state ) : float
AnimationState_TargetWeight( AnimationState state ) : float
AnimationState_Speed( AnimationState state ) : float
AnimationState_Time( AnimationState state ) : float
AnimationState_SetClip( AnimationState state, AnimationClip clip ) : void
AnimationState_SetLoopMode( AnimationState state, AnimationLoopMode loop_mode ) : void
AnimationState_SetEnabled( AnimationState state, bool enabled ) : void
AnimationState_Play( AnimationState state) : void
AnimationState_Pause( AnimationState state) : void
AnimationState_Stop( AnimationState state) : void
AnimationState_SetWeight( AnimationState state, float weight ) : void
AnimationState_SetTargetWeight( AnimationState state, float target_weight ) : void
AnimationState_SetSpeed( AnimationState state, float speed ) : void
AnimationState_SetTime( AnimationState state, float time ) : void
‘DEFINE_ARRAYLIST(TYPE)’ Define a new Arraylist.
struct ArrayList
A typed, dynamically sized array, where ##TYPE is replaced by the typename, such as ‘ArrayList_float’.
ArrayList_Create( const uint32_t initial_capacity) : ArrayList
Create an array with an initial capacity. This will use the default allocator.
ArrayList_Create( const uint32_t initial_capacity, void* (* const allocate)(const uint32_t size, uint32_t* allocation_size_bytes), void (* const deallocate)(void* memory, const uint32_t size) ) : ArrayList
Create an array with an initial capacity. Using a custom allocator.
ArrayList_Exists(ArrayList array) : bool
ArrayList_Copy( const TYPE* data, uint32_t length, void* (* const allocate)(const uint32_t size, uint32_t* allocation_size_bytes), void (* const deallocate)(void* memory, const uint32_t size) ) : ArrayList
Create an array from a copy of the data.
ArrayList_Clone( const ArrayList array, void* (* const allocate)(const uint32_t size, uint32_t* allocation_size_bytes), void (* const deallocate)(void* memory, const uint32_t size) ) : ArrayList
Clone the array.
ArrayList_Count(ArrayList array) : uint32_t
ArrayList_Capacity(ArrayList array) : uint32_t
ArrayList_Clear(ArrayList array) : void
ArrayList_Destroy(ArrayList array) : void
ArrayList_ShrinkToFit(ArrayList array) : void
ArrayList_Reserve(ArrayList array, uint32_t capacity) : void
ArrayList_Get(ArrayList array, uint32_t index, TYPE* result) : bool
On success, returns true and populates the value in result.
ArrayList_Set(ArrayList array, uint32_t index, TYPE value) : bool
On success, returns true and sets the value in the array.
ArrayList_Pop(ArrayList array, TYPE* result) : bool
On success, returns true and populates the value in result.
ArrayList_Push(ArrayList array, TYPE value) : void
ArrayList_Append(ArrayList array, TYPE* values, uint32_t length) : void
ArrayList_InsertAt(ArrayList array, uint32_t index, TYPE value) : bool
On success, returns true and sets the value in the array.
ArrayList_RemoveAt(ArrayList array, uint32_t index) : bool
ArrayList_ExtractAt(ArrayList array, uint32_t index, TYPE* result) : bool
ArrayList_RawBuffer(ArrayList array, uint32_t* result_size) : const TYPE*
ArrayList_GetRef(ArrayList array, uint32_t index) : const TYPE*
ArrayList_GetMutRef(ArrayList array, uint32_t index) : TYPE*
struct Bool2
A SIMD vector of 2 booleans, stored in a bitmask (true is 0xFFFFFFFF, false is 0). On Intel, this is an m128i, on Arm this is a int32x2_t.
Bool2_And( Bool2 a, Bool2 b ) : Bool2
Bool2_Or( Bool2 a, Bool2 b ) : Bool2
Bool2_Xor( Bool2 a, Bool2 b ) : Bool2
Bool2_AndNot( Bool2 a, Bool2 b ) : Bool2
struct Bool3
A SIMD vector of 3 booleans, stored in a bitmask (true is 0xFFFFFFFF, false is 0). On Intel, this is an m128i, on Arm this is a int32x4_t.
Bool3_And( Bool3 a, Bool3 b ) : Bool3
Bool3_Or( Bool3 a, Bool3 b ) : Bool3
Bool3_Xor( Bool3 a, Bool3 b ) : Bool3
Bool3_AndNot( Bool3 a, Bool3 b ) : Bool3
struct Bool4
A SIMD vector of 4 booleans, stored in a bitmask (true is 0xFFFFFFFF, false is 0). On Intel, this is an m128i, on Arm this is a int32x4_t.
Bool4_And( Bool4 a, Bool4 b ) : Bool4
Bool4_Or( Bool4 a, Bool4 b ) : Bool4
Bool4_Xor( Bool4 a, Bool4 b ) : Bool4
Bool4_AndNot( Bool4 a, Bool4 b ) : Bool4
struct Camera
A 32 bit handle.
enum RendererClearMode
Clear flags for the camera.
typedef enum RendererClearMode{
RendererClearMode_DontClear = 0,
RendererClearMode_ClearColorOnly = 1,
RendererClearMode_ClearDepthOnly = 2,
RendererClearMode_ClearColorAndDepth = 3,
}RendererClearMode;
Camera_Add( GameObject object ) : Camera
Attaches a camera to the game object.
Camera_Destroy( Camera camera ) : void
Destroys the camera.
Camera_Get( GameObject object ) : Camera
Returns the first camera attached to the game object.
Camera_GameObject( Camera camera ) : GameObject
Return the game object this camera is attached to.
Camera_VerticalFOV( Camera camera ) : float
Returns the vertical fov of the camera in degrees. Returns NaN if the camera is null.
Camera_NearClip( Camera camera ) : float
Returns the near clip distance of the camera. Returns NaN if the camera is null.
Camera_FarClip( Camera camera ) : float
Returns the far clip distance of the camera. Returns NaN if the camera is null.
Camera_LayerMask( Camera camera ) : uint32_t
Returns the layer mask of the camera. Returns 0 if the camera is null.
Camera_RenderOrder( Camera camera ) : uint32_t
Returns the render order of the camera. Returns 0 if the camera is null.
Camera_ClearColor( Camera camera ) : Float4
Returns the clear color of the camera. Returns NaN if the camera is null.
Camera_ClearDepth( Camera camera ) : float
Returns the clear depth of the camera. Returns NaN if the camera is null.
Camera_ClearMode( Camera camera ) : RendererClearMode
Returns the clear mode of the camera. Returns 0 if the camera is null.
Camera_RenderTexture( Camera camera ) : RenderTexture
Returns the render texture attached to this camera, if one exists.
Camera_ReplacementShader( Camera camera ) : Shader
Returns the shader attached to this camera, if one exists.
Camera_WorldToScreenPoint( Camera camera, Float3 world ) : Float3
Transforms the world space point to camera-screen space. Returns NaN if the camera is null.
Camera_ScreenToWorldPoint( Camera camera, Float3 screen ) : Float3
Transforms the screen space point to world space. Returns NaN if the camera is null.
Camera_WorldToViewportPoint( Camera camera, Float3 world ) : Float3
Transforms the world space point to camera-viewport space. Returns NaN if the camera is null.
Camera_ViewportToWorldPoint( Camera camera, Float3 viewport ) : Float3
Transforms the viewport space point to world space. Returns NaN if the camera is null.
Camera_ScreenToWorldPoint( Camera camera, Float3 screen ) : Float3
Transforms the screen space point to a world space ray. Returns NaN if the camera is null.
Camera_ViewportPointToRay( Camera camera, Float3 viewport ) : Float3
Transforms the viewport space point to a world space ray. Returns NaN if the camera is null.
Camera_SetVerticalFOV( Camera camera, float vertical_fov_degrees ) : void
Sets the vertical fov of the camera in degrees.
Camera_SetNearClip( Camera camera, float near_clip ) : void
Sets the near clip distance of the camera.
Camera_SetFarClip( Camera camera, float far_clip ) : void
Sets the far clip distance of the camera.
Camera_SetLayerMask( Camera camera, uint32_t bitmask ) : void
Sets the layermask of the camera.
Camera_SetRenderOrder( Camera camera, uint32_t order ) : void
Sets the render order of the camera.
Camera_SetClearColor( Camera camera, Float4 color ) : void
Sets the clear color of the camera.
Camera_SetClearDepth( Camera camera, float clear_depth ) : void
Sets the clear depth of the camera, values from 0 to 1.
Camera_SetClearMode( Camera camera, RendererClearMode clear_mode ) : void
Sets the clear mode of the camera.
Camera_SetRenderTexture( Camera camera, RenderTexture render_texture ) : void
Sets the render target on the camera. Passing null will set the camera to render to the screen buffer.
Camera_SetReplacementShader( Camera camera, Shader shader ) : void
Sets a replacement shader this camera will use for all draws. Setting to null clears the shader.
struct Float2
A SIMD vector of 2 floats. On Intel, this is an m128, on Arm this is a float32x2_t.
Float2_Init( float v ) : Float2
Float2_FromFloat3( Float3 v ) : Float2
Float2_FromFloat4( Float4 v ) : Float2
Float2_New( float x, float y ) : Float2
Float2_ToInt( Float2 v ) : Int2
Float2_SetX( Float2 a, float v ) : Float2
Float2_SetY( Float2 a, float v ) : Float2
Float2_Add( Float2 a, Float2 b ) : Float2
Float2_MulAdd( Float2 a, Float2 b, Float2 c ) : Float2
Float2_NegMulAdd( Float2 a, Float2 b, Float2 c ) : Float2
Float2_Sub( Float2 a, Float2 b ) : Float2
Float2_Mul( Float2 a, Float2 b ) : Float2
Float2_Scale( Float2 a, Float2 b ) : Float2
Float2_Div( Float2 a, Float2 b ) : Float2
Float2_Abs( Float2 a ) : Float2
Float2_And( Float2 a, Float2 b ) : Float2
Float2_Or( Float2 a, Float2 b ) : Float2
Float2_Xor( Float2 a, Float2 b ) : Float2
Float2_AndNot( Float2 a, Float2 b ) : Float2
Float2_CopySign( Float2 a, Float2 b ) : Float2
Float2_Min( Float2 a, Float2 b ) : Float2
Float2_Max( Float2 a, Float2 b ) : Float2
Float2_Sqrt( Float2 a, Float2 b ) : Float2
Float2_Equal( Float2 a, Float2 b ) : Bool2
Float2_NotEqual( Float2 a, Float2 b ) : Bool2
Float2_Greater( Float2 a, Float2 b ) : Bool2
Float2_GreaterEqual( Float2 a, Float2 b ) : Bool2
Float2_Less( Float2 a, Float2 b ) : Bool2
Float2_LessEqual( Float2 a, Float2 b ) : Bool2
Float2_ApproxEqual( Float2 a, Float2 b ) : Bool2
Float2_Lerp( Float2 a, Float2 b, float t) : Float2
Float2_Dot( Float2 a, Float2 b ) : Float2
Float2_Negate( Float2 v ) : Float2
Float2_SqrMagnitude( Float2 v ) : float
Float2_Magnitude( Float2 v ) : float
Float2_SqrDistance( Float2 v ) : float
Float2_Distance( Float2 v ) : float
Float2_Normalized( Float2 v ) : Float2
Float2_NormalizedAndLength( Float2 v, float* prior_length ) : Float2
Float2_Select( Float2 a, Float2 b, Bool2 mask ) : Float2
Float2_Truncate( Float2 v ) : Float2
Float2_Floor( Float2 v ) : Float2
Float2_Ceil( Float2 v ) : Float2
Float2_Round( Float2 v ) : Float2
Float2_PingPong( Float2 v ) : Float2
Float2_Rotate( Float2 v, float radians ) : Float2
Float2_XX( Float2 a ) : Float2
Float2_YY( Float2 a ) : Float2
Float2_XY( Float2 a ) : Float2
Float2_YX( Float2 a ) : Float2
struct Float3
A SIMD vector of 3 floats. On Intel, this is an m128, on Arm this is a float32x4_t.
Float3_Init( float v ) : Float3
Float3_New( float x, float y, float z ) : Float3
Float3_FromFloat2( Float2 v ) : Float3
Float3_FromFloat4( Float4 v ) : Float3
Float3_ToInt( Float3 v ) : Int3
Float3_SetX( Float3 a, float v ) : Float3
Float3_SetY( Float3 a, float v ) : Float3
Float3_SetZ( Float3 a, float v ) : Float3
Float3_Add( Float3 a, Float3 b ) : Float3
Float3_MulAdd( Float3 a, Float3 b, Float3 c ) : Float3
Float3_NegMulAdd( Float3 a, Float3 b, Float3 c ) : Float3
Float3_Sub( Float3 a, Float3 b ) : Float3
Float3_Mul( Float3 a, Float3 b ) : Float3
Float3_Scale( Float3 a, float b ) : Float3
Float3_Div( Float3 a, Float3 b ) : Float3
Float3_Abs( Float3 a ) : Float3
Float3_And( Float3 a, Float3 b ) : Float3
Float3_Or( Float3 a, Float3 b ) : Float3
Float3_Xor( Float3 a, Float3 b ) : Float3
Float3_AndNot( Float3 a, Float3 b ) : Float3
Float3_CopySign( Float3 a, Float3 b ) : Float3
Float3_Min( Float3 a, Float3 b ) : Float3
Float3_Max( Float3 a, Float3 b ) : Float3
Float3_Sqrt( Float3 a, Float3 b ) : Float3
Float3_Equal( Float3 a, Float3 b ) : Bool3
Float3_NotEqual( Float3 a, Float3 b ) : Bool3
Float3_Greater( Float3 a, Float3 b ) : Bool3
Float3_GreaterEqual( Float3 a, Float3 b ) : Bool3
Float3_Less( Float3 a, Float3 b ) : Bool3
Float3_LessEqual( Float3 a, Float3 b ) : Bool3
Float3_ApproxEqual( Float3 a, Float3 b ) : Bool3
Float3_Lerp( Float3 a, Float3 b, float t) : Float3
Float3_Dot( Float3 a, Float3 b ) : Float3
Float3_Negate( Float3 v ) : Float3
Float3_SqrMagnitude( Float3 v ) : float
Float3_Magnitude( Float3 v ) : float
Float3_SqrDistance( Float3 v ) : float
Float3_Distance( Float3 v ) : float
Float3_Normalized( Float3 v ) : Float4
Float3_NormalizedAndLength( Float3 v, float* prior_length ) : Float3
Float3_Cross( Float3 lhs, Float3 rhs ) : Float3
Float3_Select( Float3 a, Float3 b, Bool3 mask ) : Float3
Float3_Truncate( Float3 v ) : Float3
Float3_Floor( Float3 v ) : Float3
Float3_Ceil( Float3 v ) : Float3
Float3_Round( Float3 v ) : Float3
Float3_PingPong( Float3 v ) : Float3
Float3_Cos( Float3 v ) : Float3
Float3_CosDeg( Float3 v ) : Float3
Float3_Sin( Float3 v ) : Float3
Float3_SinDeg( Float3 v ) : Float3
Float3_Tan( Float3 v ) : Float3
Float3_TanDeg( Float3 v ) : Float3
Float3_ACos( Float3 v ) : Float3
Float3_ASin( Float3 v ) : Float3
Float3_Atan2( Float3 y, Float3 x ) : Float3
Float3_XXX( Float3 a ) : Float3
Float3_YYY( Float3 a ) : Float3
Float3_ZZZ( Float3 a ) : Float3
Float3_XYZ( Float3 a ) : Float3
Float3_XZY( Float3 a ) : Float3
Float3_YXZ( Float3 a ) : Float3
Float3_YZX( Float3 a ) : Float3
Float3_ZXY( Float3 a ) : Float3
Float3_ZYX( Float3 a ) : Float3
struct Float4
A SIMD vector of 4 floats. On Intel, this is an m128, on Arm this is a float32x4_t.
Float4_Init( float v ) : Float4
Float4_FromFloat2( Float2 v ) : Float4
Float4_FromFloat3( Float3 v ) : Float4
Float4_New( float x, float y, float z, float w ) : Float4
Float4_Store( Float4 v, float* mem_addr ) : void
Float4_ToInt( Float4 v ) : Int4
Float4_SetX( Float4 a, float v ) : Float4
Float4_SetY( Float4 a, float v ) : Float4
Float4_SetZ( Float4 a, float v ) : Float4
Float4_SetW( Float4 a, float v ) : Float4
Float4_Add( Float4 a, Float4 b ) : Float4
Float4_MulAdd( Float4 a, Float4 b, Float4 c ) : Float4
Float4_NegMulAdd( Float4 a, Float4 b, Float4 c ) : Float4
Float4_Sub( Float4 a, Float4 b ) : Float4
Float4_Mul( Float4 a, Float4 b ) : Float4
Float4_Scale( Float4 a, float b ) : Float4
Float4_Div( Float4 a, Float4 b ) : Float4
Float4_Abs( Float4 a ) : Float4
Float4_And( Float4 a, Float4 b ) : Float4
Float4_Or( Float4 a, Float4 b ) : Float4
Float4_Xor( Float4 a, Float4 b ) : Float4
Float4_AndNot( Float4 a, Float4 b ) : Float4
Float4_CopySign( Float4 a, Float4 b ) : Float4
Float4_Min( Float4 a, Float4 b ) : Float4
Float4_Max( Float4 a, Float4 b ) : Float4
Float4_Sqrt( Float4 a, Float4 b ) : Float4
Float4_Equal( Float4 a, Float4 b ) : Bool4
Float4_NotEqual( Float4 a, Float4 b ) : Bool4
Float4_Greater( Float4 a, Float4 b ) : Bool4
Float4_GreaterEqual( Float4 a, Float4 b ) : Bool4
Float4_Less( Float4 a, Float4 b ) : Bool4
Float4_LessEqual( Float4 a, Float4 b ) : Bool4
Float4_ApproxEqual( Float4 a, Float4 b ) : Bool4
Float4_Lerp( Float4 a, Float4 b, float t) : Float4
Float4_Dot( Float4 a, Float4 b ) : Float4
Float4_Negate( Float4 v ) : Float4
Float4_SqrMagnitude( Float4 v ) : float
Float4_Magnitude( Float4 v ) : float
Float4_SqrDistance( Float4 v ) : float
Float4_Distance( Float4 v ) : float
Float4_Normalized( Float4 v ) : Float4
Float4_NormalizedAndLength( Float4 v, float* prior_length ) : Float4
Float4_Select( Float4 a, Float4 b, Bool4 mask ) : Float4
Float4_Truncate( Float4 v ) : Float4
Float4_Floor( Float4 v ) : Float4
Float4_Ceil( Float4 v ) : Float4
Float4_Round( Float4 v ) : Float4
Float4_PingPong( Float4 v ) : Float4
Float4_Cos( Float4 v ) : Float4
Float4_CosDeg( Float4 v ) : Float4
Float4_Sin( Float4 v ) : Float4
Float4_SinDeg( Float4 v ) : Float4
Float4_Tan( Float4 v ) : Float4
Float4_TanDeg( Float4 v ) : Float4
Float4_ACos( Float4 v ) : Float4
Float4_ASin( Float4 v ) : Float4
Float4_Atan2( Float4 y, Float4 x ) : Float4
Float4_XXXX( Float4 a ) : Float4
Float4_YYYY( Float4 a ) : Float4
Float4_ZZZZ( Float4 a ) : Float4
Float4_WWWW( Float4 a ) : Float4
Float4_XYZW( Float4 a ) : Float4
Float4_XYWZ( Float4 a ) : Float4
Float4_XZYW( Float4 a ) : Float4
Float4_XZWY( Float4 a ) : Float4
Float4_XWYZ( Float4 a ) : Float4
Float4_XWZY( Float4 a ) : Float4
Float4_YXZW( Float4 a ) : Float4
Float4_YXWZ( Float4 a ) : Float4
Float4_YZXW( Float4 a ) : Float4
Float4_YZWX( Float4 a ) : Float4
Float4_YWXZ( Float4 a ) : Float4
Float4_YWZX( Float4 a ) : Float4
Float4_ZXYW( Float4 a ) : Float4
Float4_ZXWY( Float4 a ) : Float4
Float4_ZYXW( Float4 a ) : Float4
Float4_ZYWX( Float4 a ) : Float4
Float4_ZWXY( Float4 a ) : Float4
Float4_ZWYX( Float4 a ) : Float4
Float4_WXYZ( Float4 a ) : Float4
Float4_WXZY( Float4 a ) : Float4
Float4_WYXZ( Float4 a ) : Float4
Float4_WYZX( Float4 a ) : Float4
Float4_WZXY( Float4 a ) : Float4
Float4_WZYX( Float4 a ) : Float4
Column Floats.
struct Float4x4
64-byte matrix composed of 4 16-byte Floats.
Float4x4_Zero( void ) : Float4x4
Float4x4_Init( float v ) : Float4x4
Float4x4_New( float m00, float m01, float m02, float m03,
float m10, float m11, float m12, float m13,
float m20, float m21, float m22, float m23,
float m30, float m31, float m32, float m33 ) : Float4x4
Float4x4_InitColumns( struct Float4 c0, struct Float4 c1,
struct Float4 c2, struct Float4 c3 ) : Float4x4
Float4x4_InitRows( Float4 r0, Float4 r1,
Float4 r2, Float4 r3 ) : Float4x4
Float4x4_GetProjection( float half_angle, float aspect, float near_clip, float far_clip ) : Float4x4
Float4x4_GetRotation( Quaternion rotation ) : Float4x4
Float4x4_GetTranslationRotation( Float3 translation, Quaternion rotation, float uniformScale ) : Float4x4
Float4x4_Store( Float4x4 matrix, float* mem_addr ) : void
Float4x4_Transpose( Float4x4 matrix ) : Float4x4
Float4x4_Add( Float4x4 a, Float4x4 b ) : Float4x4
Float4x4_Sub( Float4x4 a, Float4x4 b ) : Float4x4
Float4x4_Sub( Float4x4 matrix, float scale ) : Float4x4
Float4x4_Mul( Float4x4 a, Float4x4 b ) : Float4x4
Float4x4_MulVec( Float4x4 matrix, Float4 Float ) : Float4
Float4x4_TransformPoint( Float4x4 matrix, Float3 Float ) : Float3
Float4x4_TransformFloat( Float4x4 matrix, Float3 Float ) : Float3
Currently there is a maximum of 65536 GameObjects at any given time. These are statically allocated at startup.
struct GameObject
A 32 bit handle.
enum GameObjectState
One of
GameObjectStateNull,
GameObjectStateEnabled,
GameObjectStateDisabled,
GameObjectStateDestroyed
GameObject_Create(void) : GameObject
Create a new GameObject.
GameObject_CreateInactive(void) : GameObject
Create a new GameObject that is disabled.
GameObject_Instantiate( GameObject source ) : GameObject
Clone the GameObject at source recursively.
GameObject_Destroy( GameObject object ) : void
Destroy the GameObject, if it exists.
GameObject_Exists( GameObject object ) : bool
Returns true if the GameObject is non-null.
GameObject_Status( GameObject object ) : GameObjectState
Returns the state of this GameObject.
GameObject_ActiveSelf( GameObject object ) : bool
Returns the active status of the object independent of the hierarchy. Returns false if the GameObject is null.
GameObject_ActiveInHierarchy( GameObject object ) : bool
Returns the active status of the object taking the hierarchy into account. Returns false if the GameObject is null.
GameObject_Parent( GameObject object ) : GameObject
Returns the object’s parent. If the object is null, a warning is logged and a null object is returned.
GameObject_FirstChild( GameObject object ) : GameObject
Returns the object’s first child. If the object is null, a warning is logged and a null object is returned.
GameObject_NextSibling( GameObject object ) : GameObject
Returns the object’s next sibling. If the object is null, a warning is logged and a null object is returned.
GameObject_PreviousSibling( GameObject object ) : GameObject
Returns the object’s previous sibling. If the object is null, a warning is logged and a null object is returned.
GameObject_LocalPosition( GameObject object ) : Float3
Returns the local position of this object. If the object is null, a warning is logged and NaN is returned.
GameObject_WorldPosition( GameObject object ) : Float3
Returns the world position of this object. If the object is null, a warning is logged and NaN is returned.
GameObject_LocalRotation( GameObject object ) : Quaternion
Returns the local rotation of this object. If the object is null, a warning is logged and NaN is returned.
GameObject_WorldRotation( GameObject object ) : Quaternion
Returns the world position of this object. If the object is null, a warning is logged and NaN is returned.
GameObject_LocalScale( GameObject object ) : float
Returns the local scale of this object. If the object is null, a warning is logged and NaN is returned.
GameObject_WorldScale( GameObject object ) : float
Returns the world scale of this object. If the object is null, a warning is logged and NaN is returned.
GameObject_TransformPoint( GameObject object, Float3 point ) : Float3
Transform the point from game-object-local to world space, using scale, rotation, and position. If the object is null, a warning is logged and NaN is returned.
GameObject_TransformFloat( GameObject object, Float3 Float ) : Float3
Transform the Float from game-object-local to world space, using scale and rotation. If the object is null, a warning is logged and NaN is returned.
GameObject_TransformDirection( GameObject object, Float3 direction ) : Float3
Transform the direction from game-object-local to world space, using rotation. If the object is null, a warning is logged and NaN is returned.
GameObject_InverseTransformPoint( GameObject object, Float3 point ) : Float3
Transform the point from world to game-object-local space, using scale, rotation, and position. If the object is null, a warning is logged and NaN is returned.
GameObject_InverseTransformFloat( GameObject object, Float3 Float ) : Float3
Transform the Float from world to game-object-local space, using scale and rotation. If the object is null, a warning is logged and NaN is returned.
GameObject_InverseTransformDirection( GameObject object, Float3 direction ) : Float3
Transform the direction from world to game-object-local space, using rotation. If the object is null, a warning is logged and NaN is returned.
GameObject_TransformMatrix( GameObject object, float asset_scale ) : Float4x4
Returns the matrix transforming points from local to world space, scaled by asset_scale. If the object is null, a warning is logged and NaN is returned.
GameObject_InverseTransformMatrix( GameObject object, float asset_scale ) : Float4x4
Returns the matrix transforming points from world to local space, scaled by asset_scale. If the object is null, a warning is logged and NaN is returned.
GameObject_LastModifiedFrame( GameObject object) : uint64_t
Returns the last frame this object was modified. If the object is null, a warning is logged and 0 is returned.
GameObject_Activate( GameObject object ) : GameObjectState
Activates the object if possible and returns the state of the object. This will recursively update children.
GameObject_Deactivate( GameObject object ) : GameObjectState
Deactivates the object if possible and returns the state of the object. This will recursively update children.
GameObject_SetParent( GameObject object, GameObject parent ) : bool
Set the object’s parent. Returns true if the operation succeeds. Returns false if either object is null or destroyed, or the operation would create a cycle.
GameObject_MakeRoot( GameObject object ) : bool
Set the object to be a root. This will unparent the object from its parent, if it has one. Returns true if the operation succeeds. Returns false if the object is null or destroyed.
GameObject_SetLocalPosition( GameObject object, Float3 position ) : bool
Set the object’s local position and update the hierarchy. Returns false if the object is null.
GameObject_SetWorldPosition( GameObject object, Float3 position ) : bool
Set the object’s world position and update the hierarchy. Returns false if the object is null.
GameObject_SetLocalRotation( GameObject object, Quaternion rotation ) : bool
Set the object’s local rotation and update the hierarchy. Returns false if the object is null.
GameObject_SetWorldRotation( GameObject object, Quaternion rotation ) : bool
Set the object’s world rotation and update the hierarchy. Returns false if the object is null.
GameObject_LookAt( GameObject object, Float3 point ) : bool
Set the object’s rotation to face point and update the hierarchy. Returns false if the object is null.
GameObject_SetLocalScale( GameObject object, float scale ) : bool
Set the object’s local scale and update the hierarchy. Returns false if the object is null.
GameObject_SetWorldScale( GameObject object, float scale ) : bool
Set the object’s world scale and update the hierarchy. Returns false if the object is null.
The output of the input methods is guaranteed to remain the same for the entire frame. Currently supports up to 32 mouse buttons, and 256 keyboard buttons.
enum KeyCode
An enum for the USB HID codes
typedef enum KeyCode{
KeyCode_A = 0x00,
KeyCode_S = 0x01,
KeyCode_D = 0x02,
KeyCode_F = 0x03,
KeyCode_H = 0x04,
KeyCode_G = 0x05,
KeyCode_Z = 0x06,
KeyCode_X = 0x07,
KeyCode_C = 0x08,
KeyCode_V = 0x09,
KeyCode_B = 0x0B,
KeyCode_Q = 0x0C,
KeyCode_W = 0x0D,
KeyCode_E = 0x0E,
KeyCode_R = 0x0F,
KeyCode_Y = 0x10,
KeyCode_T = 0x11,
KeyCode_Alpha1 = 0x12,
KeyCode_Alpha2 = 0x13,
KeyCode_Alpha3 = 0x14,
KeyCode_Alpha4 = 0x15,
KeyCode_Alpha6 = 0x16,
KeyCode_Alpha5 = 0x17,
KeyCode_Equal = 0x18,
KeyCode_Alpha9 = 0x19,
KeyCode_Alpha7 = 0x1A,
KeyCode_Minus = 0x1B,
KeyCode_Alpha8 = 0x1C,
KeyCode_Alpha0 = 0x1D,
KeyCode_RightBracket = 0x1E,
KeyCode_O = 0x1F,
KeyCode_U = 0x20,
KeyCode_LeftBracket = 0x21,
KeyCode_I = 0x22,
KeyCode_P = 0x23,
KeyCode_L = 0x25,
KeyCode_J = 0x26,
KeyCode_Quote = 0x27,
KeyCode_K = 0x28,
KeyCode_Semicolon = 0x29,
KeyCode_Backslash = 0x2A,
KeyCode_Comma = 0x2B,
KeyCode_Slash = 0x2C,
KeyCode_N = 0x2D,
KeyCode_M = 0x2E,
KeyCode_Period = 0x2F,
KeyCode_Grave = 0x32,
KeyCode_KeypadDecimal = 0x41,
KeyCode_KeypadMultiply = 0x43,
KeyCode_KeypadPlus = 0x45,
KeyCode_KeypadClear = 0x47,
KeyCode_KeypadDivide = 0x4B,
KeyCode_KeypadEnter = 0x4C,
KeyCode_KeypadMinus = 0x4E,
KeyCode_KeypadEquals = 0x51,
KeyCode_Keypad0 = 0x52,
KeyCode_Keypad1 = 0x53,
KeyCode_Keypad2 = 0x54,
KeyCode_Keypad3 = 0x55,
KeyCode_Keypad4 = 0x56,
KeyCode_Keypad5 = 0x57,
KeyCode_Keypad6 = 0x58,
KeyCode_Keypad7 = 0x59,
KeyCode_Keypad8 = 0x5B,
KeyCode_Keypad9 = 0x5C,
/* Independent Keycodes */
KeyCode_Return = 0x24,
KeyCode_Tab = 0x30,
KeyCode_Space = 0x31,
KeyCode_Delete = 0x33,
KeyCode_Escape = 0x35,
KeyCode_RightCommand = 0x36,
KeyCode_LeftCommand = 0x37,//55
KeyCode_LeftShift = 0x38,//56
KeyCode_CapsLock = 0x39,//57
KeyCode_LeftOption = 0x3A,//58
KeyCode_LeftControl = 0x3B,//59
KeyCode_RightShift = 0x3C,//60
KeyCode_RightOption = 0x3D,
KeyCode_RightControl = 0x3E,
KeyCode_Function = 0x3F,
KeyCode_F17 = 0x40,
KeyCode_VolumeUp = 0x48,
KeyCode_VolumeDown = 0x49,
KeyCode_Mute = 0x4A,
KeyCode_F18 = 0x4F,
KeyCode_F19 = 0x50,
KeyCode_F20 = 0x5A,
KeyCode_F5 = 0x60,
KeyCode_F6 = 0x61,
KeyCode_F7 = 0x62,
KeyCode_F3 = 0x63,
KeyCode_F8 = 0x64,
KeyCode_F9 = 0x65,
KeyCode_F11 = 0x67,
KeyCode_F13 = 0x69,
KeyCode_F16 = 0x6A,
KeyCode_F14 = 0x6B,
KeyCode_F10 = 0x6D,
KeyCode_F12 = 0x6F,
KeyCode_F15 = 0x71,
KeyCode_Help = 0x72,
KeyCode_Home = 0x73,
KeyCode_PageUp = 0x74,
KeyCode_ForwardDelete = 0x75,
KeyCode_F4 = 0x76,
KeyCode_End = 0x77,
KeyCode_F2 = 0x78,
KeyCode_PageDown = 0x79,
KeyCode_F1 = 0x7A,
KeyCode_LeftArrow = 0x7B,
KeyCode_RightArrow = 0x7C,
KeyCode_DownArrow = 0x7D,
KeyCode_UpArrow = 0x7E,
KeyCode_ISO_Section = 0x0A,
KeyCode_JYen = 0x5D,
KeyCode_JUnderscore = 0x5E,
KeyCode_JKeypadComma = 0x5F,
KeyCode_JEisu = 0x66,
KeyCode_JKana = 0x68
} KeyCode;
Input_GetMousePosition( void ) : Float2
Returns the mouse position at the start of the frame.
Input_GetMouseDelta( void ) : Float2
Returns the mouse delta postion from the start of last frame to the start of the current frame.
Input_GetMouseButton( uint32_t button_id ) : bool
Returns the state of the mouse button at the start of the frame, e.g true if pressed, false if not pressed. Default is false. If a button does not exist, this returns false.
Input_GetMouseButtonDown( uint32_t button_id ) : bool
Returns true if a down event occured for the specified button last frame. NOTE: it is possible for both a down and up event to occur in the same frame, in which case both will return true.
Input_GetMouseButtonUp( uint32_t button_id ) : bool
Returns true if an up event occured for the specified button last frame. NOTE: it is possible for both a down and up event to occur in the same frame, in which case both will return true.
Input_GetMouseScrollX( void ) : float
Returns the total amount of mouse scrollwheel x motion from last frame.
Input_GetMouseScrollY( void ) : float
Returns the total amount of mouse scrollwheel y motion from last frame.
Input_GetKey( KeyCode key ) : bool
Returns the state of the keyboard button at the start of the frame, e.g true if pressed, false if not pressed. Default is false. If a button does not exist, this returns false.
Input_GetKeyDown( KeyCode key ) : bool
Returns true if a down event occured for the specified button last frame. NOTE: it is possible for both a down and up event to occur in the same frame, in which case both will return true.
Input_GetKeyUp( KeyCode key ) : bool
Returns true if an up event occured for the specified button last frame. NOTE: it is possible for both a down and up event to occur in the same frame, in which case both will return true.
struct Int2
A SIMD vector of 2 ints. On Intel, this is an m128i, on Arm this is a int32x2_t.
Int2_Init( int32_t value ) : Int2
Int2_New( int32_t x, int32_t y ) : Int2
Int2_ToFloat( Int2 v ) : Vector2
Int2_SetX( Int2 a, int32_t value ) : Int2
Int2_SetY( Int2 a, int32_t value ) : Int2
Int2_Add( Int2 a, Int2 b ) : Int2
Int2_Sub( Int2 a, Int2 b ) : Int2
Int2_Mul( Int2 a, Int2 b ) : Int2
Int2_Min( Int2 a, Int2 b ) : Int2
Int2_Max( Int2 a, Int2 b ) : Int2
Int2_And( Int2 a, Int2 b ) : Int2
Int2_Or( Int2 a, Int2 b ) : Int2
Int2_Xor( Int2 a, Int2 b ) : Int2
Int2_AndNot( Int2 a, Int2 b ) : Int2
Int2_Select( Int2 a, Int2 b, Int2 mask ) : Int2
Int2_Equal( Int2 a, Int2 b ) : Bool2
Int2_Less( Int2 a, Int2 b ) : Bool2
Int2_Greater( Int2 a, Int2 b ) : Bool2
Int2_NotEqual( Int2 a, Int2 b ) : Bool2
Int2_GreaterEqual( Int2 a, Int2 b ) : Bool2
Int2_LessEqual( Int2 a, Int2 b ) : Bool2
Int2_XX( Int2 a ) : Int2
Int2_YY( Int2 a ) : Int2
Int2_XY( Int2 a ) : Int2
Int2_YX( Int2 a ) : Int2
struct Int3
A SIMD vector of 3 ints. On Intel, this is an m128i, on Arm this is a int32x4_t.
Int3_Init( int32_t value ) : Int3
Int3_New( int32_t x, int32_t y, int32_t z ) : Int3
Int3_ToFloat( Int3 v ) : Vector3
Int3_SetX( Int3 a, int32_t value ) : Int3
Int3_SetY( Int3 a, int32_t value ) : Int3
Int3_SetZ( Int3 a, int32_t value ) : Int3
Int3_Add( Int3 a, Int3 b ) : Int3
Int3_Sub( Int3 a, Int3 b ) : Int3
Int3_Mul( Int3 a, Int3 b ) : Int3
Int3_Min( Int3 a, Int3 b ) : Int3
Int3_Max( Int3 a, Int3 b ) : Int3
Int3_And( Int3 a, Int3 b ) : Int3
Int3_Or( Int3 a, Int3 b ) : Int3
Int3_Xor( Int3 a, Int3 b ) : Int3
Int3_AndNot( Int3 a, Int3 b ) : Int3
Int3_Select( Int3 a, Int3 b, Bool3 mask ) : Int3
Int3_Equal( Int3 a, Int3 b ) : Bool3
Int3_Less( Int3 a, Int3 b ) : Bool3
Int3_Greater( Int3 a, Int3 b ) : Bool3
Int3_NotEqual( Int3 a, Int3 b ) : Bool3
Int3_GreaterEqual( Int3 a, Int3 b ) : Bool3
Int3_LessEqual( Int3 a, Int3 b ) : Bool3
Int3_XXX( Int3 a ) : Int3
Int3_YYY( Int3 a ) : Int3
Int3_ZZZ( Int3 a ) : Int3
Int3_XYZ( Int3 a ) : Int4
Int3_XZY( Int3 a ) : Int4
Int3_YXZ( Int3 a ) : Int4
Int3_YZX( Int3 a ) : Int4
Int3_ZXY( Int3 a ) : Int4
Int3_ZYX( Int3 a ) : Int4
struct Int4
A SIMD vector of 4 ints. On Intel, this is an m128i, on Arm this is a int32x4_t.
Int4_Init( int32_t value ) : Int4
Int4_New( int3t x, int32_t y, int32_t z, int32_t w ) : Int4
Int4_ToFloat( Int4 v ) : Vector4
Int4_Add( Int4 a, Int4 b ) : Int4
Int4_Sub( Int4 a, Int4 b ) : Int4
Int4_Mul( Int4 a, Int4 b ) : Int4
Int4_Min( Int4 a, Int4 b ) : Int4
Int4_Max( Int4 a, Int4 b ) : Int4
Int4_And( Int4 a, Int4 b ) : Int4
Int4_Or( Int4 a, Int4 b ) : Int4
Int4_Xor( Int4 a, Int4 b ) : Int4
Int4_AndNot( Int4 a, Int4 b ) : Int4
Int4_Select( Int4 a, Int4 b, Bool4 mask ) : Int4
Int4_Equal( Int4 a, Int4 b ) : Bool4
Int4_Less( Int4 a, Int4 b ) : Bool4
Int4_Greater( Int4 a, Int4 b ) : Bool4
Int4_NotEqual( Int4 a, Int4 b ) : Bool4
Int4_GreaterEqual( Int4 a, Int4 b ) : Bool4
Int4_LessEqual( Int4 a, Int4 b ) : Bool4
Int4_SetX( Int4 a, int32_t value ) : Int4
Int4_SetY( Int4 a, int32_t value ) : Int4
Int4_SetZ( Int4 a, int32_t value ) : Int4
Int4_SetW( Int4 a, int32_t value ) : Int4
Int4_XXXX( Int4 a ) : Int4
Int4_YYYY( Int4 a ) : Int4
Int4_ZZZZ( Int4 a ) : Int4
Int4_WWWW( Int4 a ) : Int4
Int4_XYZW( Int4 a ) : Int4
Int4_XYWZ( Int4 a ) : Int4
Int4_XZYW( Int4 a ) : Int4
Int4_XZWY( Int4 a ) : Int4
Int4_XWYZ( Int4 a ) : Int4
Int4_XWZY( Int4 a ) : Int4
Int4_YXZW( Int4 a ) : Int4
Int4_YXWZ( Int4 a ) : Int4
Int4_YZXW( Int4 a ) : Int4
Int4_YZWX( Int4 a ) : Int4
Int4_YWXZ( Int4 a ) : Int4
Int4_YWZX( Int4 a ) : Int4
Int4_ZXYW( Int4 a ) : Int4
Int4_ZXWY( Int4 a ) : Int4
Int4_ZYXW( Int4 a ) : Int4
Int4_ZYWX( Int4 a ) : Int4
Int4_ZWXY( Int4 a ) : Int4
Int4_ZWYX( Int4 a ) : Int4
Int4_WXYZ( Int4 a ) : Int4
Int4_WXZY( Int4 a ) : Int4
Int4_WYXZ( Int4 a ) : Int4
Int4_WYZX( Int4 a ) : Int4
Int4_WZXY( Int4 a ) : Int4
Int4_WZYX( Int4 a ) : Int4
struct Material
A 32 bit handle.
Material_Create( Shader shader) : Material
Creates a new material using the provided shader.
Material_Clone( Material material ) : Material
Creates a copy of the material.
Material_Destroy( Material material ) : Material
Destroys the material.
Material_Exists( Material material ) : bool
Returns true if the material exists.
Material_Color( Material material, uint32_t index ) : Float4
Returns the color at index, or NaN if the material is null or the index is out of range.
Material_Texture( Material material, uint32_t index ) : Texture
Returns the texture at index, or null if the material is null or the index is out of range.
Material_UVScaleOffset( Material material, uint32_t index ) : Float4
Returns the scale in xy and offset in zw at index, or NaN if the material is null or the index is out of range.
Material_Shader( Material material ) : Shader
Returns the shader, or null if the material is null.
Material_RenderQueue( Material material ) : uint16_t
Returns the render queue, or 65535 if the material is null.
Material_LastModifiedFrame( Material material ) : uint64_t
Returns the last frame this object was modified, or 0 if the material is null.
Material_SetColor( Material material, uint32_t index, Float4 color ) : void
Set the color at index. This marks the object as modified.
Material_SetTexture( Material material, uint32_t index, Texture texture ) : void
Set the texture at index. This marks the object as modified. NOTE - texture pointer, size, and sampler states are cached on assignment. Modification of texture settings at runtime is not well supported.
Material_SetUVScaleOffset( Material material, uint32_t index, Float4 uv_scale_offset ) : void
Set the uv scale in xy, and offset in zw at index. This marks the object as modified.
Material_SetShader( Material material, Shader shader ) : void
Set the shader. This does not mark the object as modified.
Material_SetRenderQueue( Material material, uint16_t render_queue ) : void
Set the render queue for ordering. This does not mark the object as modified.
struct Mesh
A 32 bit handle.
struct VertexData
A packed 32-byte per vertex format.
typedef struct VertexData{
float position[3];
uint8_t color[4];
uint16_t uv[2];
uint8_t normal[4];
uint8_t skin_index[4];
uint8_t skin_weight[4];
}VertexData;
Mesh_Create( void ) : Mesh
Creates a new empty mesh.
Mesh_Init(
const VertexData* vertices,
uint32_t vertex_count,
const uint16_t* indices,
uint32_t index_count ) : Mesh
Creates a new mesh from the vertices and indices specified.
Mesh_Destroy( Mesh mesh ) : void
Destroys the mesh and associated vertex buffers. The buffer memory may not be available for up to 3 frames.
Mesh_Exists( Mesh mesh ) : bool
Returns true if the Mesh is non-null.
Mesh_VertexCount( Mesh mesh ) : uint32_t
Returns the number of vertices in this mesh. Returns 0 if the mesh is null or there is no data.
Mesh_IndexCount( Mesh mesh ) : uint32_t
Returns the number of indices in this mesh. Returns 0 if the mesh is null or there is no data.
Mesh_Filescale( Mesh mesh ) : float
Returns the filescale of this mesh. Returns 1.0 if the mesh is null.
Mesh_SetFilescale( Mesh mesh, float val ) : void
Set the filescale of this mesh.
struct MeshRenderer
A 32 bit handle.
MeshRenderer_Add( GameObject object ) : MeshRenderer
Attaches a mesh renderer to the game object.
MeshRenderer_Destroy( MeshRenderer mesh_renderer ) : void
Destroys the mesh renderer.
MeshRenderer_Get( GameObject object ) : MeshRenderer
Returns the first mesh renderer attached to the game object.
MeshRenderer_GameObject( MeshRenderer mesh_renderer ) : GameObject
Return the game object this mesh renderer is attached to.
MeshRenderer_LayerMask( MeshRenderer mesh_renderer ) : uint32_t
Returns the layer mask of this mesh renderer.
MeshRenderer_Mesh( MeshRenderer mesh_renderer ) : Mesh
Returns the mesh attached to this mesh renderer.
MeshRenderer_SharedMaterial( MeshRenderer mesh_renderer ) : Material
Returns the shared material attached to this mesh renderer.
MeshRenderer_SetLayerMask( MeshRenderer mesh_renderer, uint32_t mask ) : void
Sets the layer mask.
MeshRenderer_SetMesh( MeshRenderer mesh_renderer, Mesh mesh ) : void
Sets a new mesh.
MeshRenderer_SetMaterial( MeshRenderer mesh_renderer, Material material ) : void
Sets a new material. This will destroy any previous material instance.
MeshRenderer_MaterialInstance( MeshRenderer mesh_renderer) : Material
Returns the material instance. Creates one if none exists.
enum RotationOrder
One of
XYZ,
XZY,
YXZ,
YZX,
ZXY,
ZYX
Quaternion_Identity( void ) : Quaternion
Returns a Quaternion with values (0.0, 0.0, 0.0, 1.0).
Quaternion_Mul( Quaternion lhs, Quaternion rhs ) : Quaternion
Quaternion_MulVec( Quaternion lhs, Float3 vec ) : Float3
Quaternion_Dot( Quaternion a, Quaternion b ) : Quaternion
Quaternion_Inverse( Quaternion q ) : Quaternion
Quaternion_Reverse( Quaternion q ) : Quaternion
Quaternion_Lerp( Quaternion from, Quaternion to, float blend ) : Quaternion
Quaternion_AngleAxis( float radians, Float3 axis ) : Quaternion
Quaternion_Angle( Quaternion a, Quaternion b ) : float
Quaternion_LookAt( Float3 source, Float3 point ) : Quaternion
Quaternion_ToAngleAxis( Quaternion q, float* angle, Float3* axis ) : bool
struct RenderTexture
A 32 bit handle.
typedef enum MSAA{
MSAA_1x=1,
MSAA_4x=4,
} MSAA;
typedef enum RenderTextureFormat{
RenderTextureFormat_BGRA8Unorm = 80,
RenderTextureFormat_RGBA16Float = 115,
} RenderTextureFormat;
typedef enum DepthTextureFormat{
DepthTextureFormat_None=0,
DepthTextureFormat_Depth32Float = 252,
} DepthTextureFormat;
RenderTexture_Create( void ) : RenderTexture
Creates a new render texture.
RenderTexture_Create( RenderTexture render_texture ) : void
RenderTexture_Exists( RenderTexture render_texture ) : bool
RenderTexture_Width( RenderTexture render_texture ) : uint32_t
RenderTexture_Height( RenderTexture render_texture ) : uint32_t
RenderTexture_MSAA( RenderTexture render_texture ) : MSAA
RenderTexture_Format( RenderTexture render_texture ) : RenderTextureFormat
RenderTexture_DepthFormat( RenderTexture render_texture ) : DepthTextureFormat
RenderTexture_AspectRatio( RenderTexture render_texture ) : float
RenderTexture_InvAspectRatio( RenderTexture render_texture ) : float
RenderTexture_ResolveColor( RenderTexture render_texture ) : bool
RenderTexture_ResolveDepth( RenderTexture render_texture ) : bool
RenderTexture_Color( RenderTexture render_texture ) : Texture
RenderTexture_Depth( RenderTexture render_texture ) : Texture
RenderTexture_Init(
RenderTexture render_texture,
uint32_t width,
uint32_t height,
MSAA msaa,
RenderTextureFormat color_format,
bool resolve_color,
DepthTextureFormat depth_format,
bool resolve_depth) : void
Screen_ViewportSize( void ) : Float2
Returns the size of the application viewport in points as (width, height).
Screen_ViewportWidth( void ) : float
Returns the width of the application viewport in points.
Screen_ViewportHeight( void ) : float
Returns the height of the application viewport in points.
Screen_ViewportSize( void ) : Float2
Returns the size of the application viewport buffer in pixels as (width, height).
Screen_ViewportWidth( void ) : float
Returns the width of the application viewport buffer in pixels.
Screen_ViewportHeight( void ) : float
Returns the height of the application viewport buffer in pixels.
Screen_ViewportScale( void ) : float
Returns the pixel density of the viewport.
Screen_ViewportRenderParams( void ) : Float4
Returns the rendering params of the application viewport in pixels as (1.0/width, 1.0/height, width, height).
Screen_ViewportAspectRatio( void ) : float
Returns the aspect ratio of the viewport (width / height).
Screen_ViewportAspectRatio( void ) : float
Returns the inverse aspect ratio of the viewport (height / width).
Screen_ViewportPointToUIPoint( Float2 point) : Float2
Converts the viewport coordinate to ui coordinates. Viewport coordinates range from (0,0) in the upper left, to (width,height) in the lower right. UI coordinates range from (-width/2, -height/2) in the upper left to (width/2, height/2) in the lower right.
Screen_IsFullscreen( void ) : bool
Returns if the viewport is currently in fullscreen mode. NOTE: always true until windowing support is added.
struct Shader
A 32 bit handle.
enum ShaderComparison
Comparison functions used for depth and stencil tests.
typedef enum ShaderComparison{
ShaderComparison_Never = 0,
ShaderComparison_Less = 1,
ShaderComparison_Equal = 2,
ShaderComparison_LEqual = 3 ,
ShaderComparison_Greater = 4,
ShaderComparison_NotEqual = 5,
ShaderComparison_GEqual = 6,
ShaderComparison_Always = 7
}ShaderComparison;
enum ShaderBlendOp
Functions available for compositing.
typedef enum ShaderBlendOp{
ShaderBlendOp_Add =0,
ShaderBlendOp_Sub =1,
ShaderBlendOp_RevSub=2,
ShaderBlendOp_Min=3,
ShaderBlendOp_Max=4
}ShaderBlendOp;
enum ShaderCullMode
Triangle culling mode. ShaderCullMode_Back culls backfaces.
typedef enum ShaderCullMode{
ShaderCullMode_None =0,
ShaderCullMode_Front =1,
ShaderCullMode_Back=2
}ShaderCullMode;
enum ShaderColorMask
Mask for only rendering specific channels. ShaderColorMask_RGBA renders all channels.
typedef enum ShaderColorMask{
ShaderColorMask_None = 0,
ShaderColorMask_A = 1,
ShaderColorMask_B = 2,
ShaderColorMask_BA = 3,
ShaderColorMask_G = 4,
ShaderColorMask_GA = 5,
ShaderColorMask_GB = 6,
ShaderColorMask_GBA = 7,
ShaderColorMask_R = 8,
ShaderColorMask_RA = 9,
ShaderColorMask_RB = 10,
ShaderColorMask_RBA =11,
ShaderColorMask_RG =12,
ShaderColorMask_RGA =13,
ShaderColorMask_RGB =14,
ShaderColorMask_RGBA=15
}ShaderColorMask;
enum ShaderBlendFactor
Fixed Blending weights.
typedef enum ShaderBlendFactor{
ShaderBlendFactor_Zero = 0,
ShaderBlendFactor_One = 1,
ShaderBlendFactor_SrcColor = 2,
ShaderBlendFactor_OneMinusSrcColor = 3,
ShaderBlendFactor_SrcAlpha = 4,
ShaderBlendFactor_OneMinusSrcAlpha = 5,
ShaderBlendFactor_DstColor = 6,
ShaderBlendFactor_OneMinusDstColor = 7,
ShaderBlendFactor_DstAlpha = 8,
ShaderBlendFactor_OneMinusDstAlpha = 9
}ShaderBlendFactor;
Shader_Create (
const char* vertex_program,
const char* fragment_program,
uint32_t render_queue,
uint32_t texture_count,
bool transparent,
bool write_depth,
bool alpha_to_coverage,
ShaderComparison depth_function,
ShaderCullMode cull_mode,
ShaderColorMask color_mask,
ShaderBlendOp color_blend_op,
ShaderBlendOp alpha_blend_op,
ShaderBlendFactor src_color_factor,
ShaderBlendFactor src_alpha_factor,
ShaderBlendFactor dst_color_factor,
ShaderBlendFactor dst_alpha_factor ) : Shader
Creates a new shader.
Shader_Exists( Shader shader ) : bool
Shader_RenderQueue( Shader shader ) : uint32_t
Shader_TextureCount( Shader shader ) : uint32_t
Shader_Transparent( Shader shader ) : bool
Shader_WriteDepth( Shader shader ) : bool
Shader_AlphaToCoverage( Shader shader ) : bool
Shader_DepthComparison( Shader shader ) : ShaderComparison
Shader_CullMode( Shader shader ) : ShaderCullMode
Shader_ColorMask( Shader shader ) : ShaderColorMask
Shader_ColorBlendOp( Shader shader ) : ShaderBlendOp
Shader_AlphaBlendOp( Shader shader ) : ShaderBlendOp
Shader_SrcColor( Shader shader ) : ShaderBlendFactor
Shader_SrcAlpha( Shader shader ) : ShaderBlendFactor
Shader_DstColor( Shader shader ) : ShaderBlendFactor
Shader_DstAlpha( Shader shader ) : ShaderBlendFactor
Maintains the state of the current active socket connection. There can only currently be one connection.
struct NetworkEndpoint
A network destination.
struct SocketConnection
A virtual connection over UDP.
NetworkEndpoint_CreateIPV4( uint8_t first, uint8_t second ,uint8_t third, uint8_t forth, uint32_t port) : NetworkEndpoint
Socket_GetActive( void ) : SocketConnection
Returns the active socket connection if one exists. Currently there can only be a single active connection.
Socket_Open( NetworkEndpoint address ) : SocketConnection
Socket_Close( SocketConnection connection ) : bool
Socket_Send( SocketConnection connection, uint8_t* data, uint32_t data_size ) : bool
Socket_Receive( SocketConnection connection, uint8_t* buffer, uint32_t buffer_size ) : uint32_t
Returns the number of bytes written to the buffer.
struct Texture
A 32 bit handle.
typedef enum TextureFormat{
TextureFormatInvalid = 0,
/* Normal 8 bit formats */
TextureFormatA8Unorm = 1,
TextureFormatR8Unorm = 10,
TextureFormatR8Unorm_sRGB = 11,
TextureFormatR8Snorm = 12,
TextureFormatR8Uint = 13,
TextureFormatR8Sint = 14,
/* Normal 16 bit formats */
TextureFormatR16Unorm = 20,
TextureFormatR16Snorm = 22,
TextureFormatR16Uint = 23,
TextureFormatR16Sint = 24,
TextureFormatR16Float = 25,
TextureFormatRG8Unorm = 30,
TextureFormatRG8Unorm_sRGB = 31,
TextureFormatRG8Snorm = 32,
TextureFormatRG8Uint = 33,
TextureFormatRG8Sint = 34,
/* Packed 16 bit formats */
TextureFormatB5G6R5Unorm = 40,
TextureFormatA1BGR5Unorm = 41,
TextureFormatABGR4Unorm = 42,
TextureFormatBGR5A1Unorm = 43,
/* Normal 32 bit formats */
TextureFormatR32Uint = 53,
TextureFormatR32Sint = 54,
TextureFormatR32Float = 55,
TextureFormatRG16Unorm = 60,
TextureFormatRG16Snorm = 62,
TextureFormatRG16Uint = 63,
TextureFormatRG16Sint = 64,
TextureFormatRG16Float = 65,
TextureFormatRGBA8Unorm = 70,
TextureFormatRGBA8Unorm_sRGB = 71,
TextureFormatRGBA8Snorm = 72,
TextureFormatRGBA8Uint = 73,
TextureFormatRGBA8Sint = 74,
TextureFormatBGRA8Unorm = 80,
TextureFormatBGRA8Unorm_sRGB = 81,
/* Packed 32 bit formats */
TextureFormatRGB10A2Unorm = 90,
TextureFormatRGB10A2Uint = 91,
TextureFormatRG11B10Float = 92,
TextureFormatRGB9E5Float = 93,
TextureFormatBGR10A2Unorm = 94,
TextureFormatBGR10_XR = 554,
TextureFormatBGR10_XR_sRGB = 555,
/* Normal 64 bit formats */
TextureFormatRG32Uint = 103,
TextureFormatRG32Sint = 104,
TextureFormatRG32Float = 105,
TextureFormatRGBA16Unorm = 110,
TextureFormatRGBA16Snorm = 112,
TextureFormatRGBA16Uint = 113,
TextureFormatRGBA16Sint = 114,
TextureFormatRGBA16Float = 115,
TextureFormatBGRA10_XR = 552,
TextureFormatBGRA10_XR_sRGB = 553,
/* Normal 128 bit formats */
TextureFormatRGBA32Uint = 123,
TextureFormatRGBA32Sint = 124,
TextureFormatRGBA32Float = 125,
/* Compressed formats. */
/* S3TC/DXT */
TextureFormatBC1_RGBA = 130,
TextureFormatBC1_RGBA_sRGB = 131,
TextureFormatBC2_RGBA = 132,
TextureFormatBC2_RGBA_sRGB = 133,
TextureFormatBC3_RGBA = 134,
TextureFormatBC3_RGBA_sRGB = 135,
/* RGTC */
TextureFormatBC4_RUnorm = 140,
TextureFormatBC4_RSnorm = 141,
TextureFormatBC5_RGUnorm = 142,
TextureFormatBC5_RGSnorm = 143,
/* BPTC */
TextureFormatBC6H_RGBFloat = 150,
TextureFormatBC6H_RGBUfloat = 151,
TextureFormatBC7_RGBAUnorm = 152,
TextureFormatBC7_RGBAUnorm_sRGB = 153,
/* ASTC */
TextureFormatASTC_4x4_sRGB = 186,
TextureFormatASTC_5x4_sRGB = 187,
TextureFormatASTC_5x5_sRGB = 188,
TextureFormatASTC_6x5_sRGB = 189,
TextureFormatASTC_6x6_sRGB = 190,
TextureFormatASTC_8x5_sRGB = 192,
TextureFormatASTC_8x6_sRGB = 193,
TextureFormatASTC_8x8_sRGB = 194,
TextureFormatASTC_10x5_sRGB = 195,
TextureFormatASTC_10x6_sRGB = 196,
TextureFormatASTC_10x8_sRGB = 197,
TextureFormatASTC_10x10_sRGB = 198,
TextureFormatASTC_12x10_sRGB = 199,
TextureFormatASTC_12x12_sRGB = 200,
TextureFormatASTC_4x4_LDR = 204,
TextureFormatASTC_5x4_LDR = 205,
TextureFormatASTC_5x5_LDR = 206,
TextureFormatASTC_6x5_LDR = 207,
TextureFormatASTC_6x6_LDR = 208,
TextureFormatASTC_8x5_LDR = 210,
TextureFormatASTC_8x6_LDR = 211,
TextureFormatASTC_8x8_LDR = 212,
TextureFormatASTC_10x5_LDR = 213,
TextureFormatASTC_10x6_LDR = 214,
TextureFormatASTC_10x8_LDR = 215,
TextureFormatASTC_10x10_LDR = 216,
TextureFormatASTC_12x10_LDR = 217,
TextureFormatASTC_12x12_LDR = 218,
// ASTC HDR (High Dynamic Range) Formats
TextureFormatASTC_4x4_HDR = 222,
TextureFormatASTC_5x4_HDR = 223,
TextureFormatASTC_5x5_HDR = 224,
TextureFormatASTC_6x5_HDR = 225,
TextureFormatASTC_6x6_HDR = 226,
TextureFormatASTC_8x5_HDR = 228,
TextureFormatASTC_8x6_HDR = 229,
TextureFormatASTC_8x8_HDR = 230,
TextureFormatASTC_10x5_HDR = 231,
TextureFormatASTC_10x6_HDR = 232,
TextureFormatASTC_10x8_HDR = 233,
TextureFormatASTC_10x10_HDR = 234,
TextureFormatASTC_12x10_HDR = 235,
TextureFormatASTC_12x12_HDR = 236,
TextureFormatDepth16Unorm = 250,
TextureFormatDepth32Float = 252,
/* Stencil */
TextureFormatStencil8 = 253,
TextureFormatDepth32Float_Stencil8 = 260,
TextureFormatX32_Stencil8 = 261,
}TextureFormat;
typedef enum TextureWrap{
TextureWrap_Clamp = 0,
TextureWrap_WrapX = 1,
TextureWrap_WrapY = 2,
TextureWrap_WrapBoth = 3
} TextureWrap;
typedef enum TextureFilter{
TextureFilter_Nearest = 0,
TextureFilter_Bilinear = 1,
TextureFilter_LinearMip = 2,
TextureFilter_Trilinear = 3
} TextureFilter;
typedef enum TextureAniso {
AnisoOff = 1,
Aniso2 = 2,
Aniso3 = 3,
Aniso4 = 4,
Aniso5 = 5,
Aniso6 = 6,
Aniso7 = 7,
Aniso8 = 8,
Aniso9 = 9,
Aniso10 = 10,
Aniso11 = 11,
Aniso12 = 12,
Aniso13= 13,
Aniso14 = 14,
Aniso15 = 15,
Aniso16 = 16,
}TextureAniso;
Texture_Create( void ) : Texture
Creates a new empty texture.
Texture_Destroy( Texture texture ) : void
Destroys the texture and associated buffers. The buffer memory may not be available for up to 3 frames.
Texture_Exists( Texture texture ) : bool
Returns true if the Texture is non-null.
Texture_Width( Texture texture ) : uint32_t
Texture_Height( Texture texture ) : uint32_t
Texture_TexelSize( Texture texture ) : Float4
Texture_AspectRatio( Texture texture ) : float
Texture_InvAspectRatio( Texture texture ) : float
Texture_MipMapCount( Texture texture ) : uint32_t
Texture_WrapMode( Texture texture ) : TextureWrap
Texture_FilterMode( Texture texture ) : TextureFilter
Texture_Anisotropy( Texture texture ) : TextureAniso
Texture_SetWrapMode( Texture texture, TextureWrap wrap_mode ) : void
Texture_SetFilterMode( Texture texture, TextureFilter filter_mode ) : void
Texture_SetAnisotropy( Texture texture, TextureAniso aniso ) : void
Time_Time( void ) : double
Returns seconds since application start.
Time_DeltaTime( void ) : float
Returns last frame duration in seconds.
Time_FrameCount( void ) : uint64_t
Returns total number of frames since application start.
Time_RenderBufferId( void ) : uint32_t
Returns the current buffer available to the CPU. In a triple-buffered configuration, this is Time_FrameCount() % 3.
Currently there is a maximum of 65536 UIObjects at any given time. These are statically allocated at startup.
struct UIObject
A 32 bit handle.
typedef enum UIInteractionMode{
UIInteractionMode_None,
UIInteractionMode_Button,
UIInteractionMode_Drag
}UIInteractionMode;
typedef enum UIObjectState{
UIObjectStateNull,
UIObjectStateEnabled,
UIObjectStateDisabled,
UIObjectStateDestroyed
}UIObjectState;
typedef enum UIAnchor{
UIAnchor_UpperLeft,
UIAnchor_UpperCenter,
UIAnchor_UpperRight,
UIAnchor_MiddleLeft,
UIAnchor_MiddleCenter,
UIAnchor_MiddleRight,
UIAnchor_LowerLeft,
UIAnchor_LowerCenter,
UIAnchor_LowerRight
}UIAnchor;
UIObject_Create(void) : UIObject
Create a new UIObject.
UIObject_CreateInactive(void) : UIObject
Create a new UIObject that is disabled.
UIObject_Instantiate( UIObject source ) : UIObject
Clone the UIObject at source recursively.
UIObject_Destroy( UIObject object ) : void
Destroy the UIObject, if it exists.
UIObject_Exists( UIObject object ) : bool
Returns true if the UIObject is non-null.
UIObject_Status( UIObject object ) : UIObjectState
Returns the state of this UIObject.
UIObject_ActiveSelf( UIObject object ) : bool
Returns the active status of the object independent of the hierarchy. Returns false if the UIObject is null.
UIObject_ActiveInHierarchy( UIObject object ) : bool
Returns the active status of the object taking the hierarchy into account. Returns false if the UIObject is null.
UIObject_Parent( UIObject object ) : UIObject
Returns the object’s parent. If the object is null, a warning is logged and a null object is returned.
UIObject_FirstChild( UIObject object ) : UIObject
Returns the object’s first child. If the object is null, a warning is logged and a null object is returned.
UIObject_NextSibling( UIObject object ) : UIObject
Returns the object’s next sibling. If the object is null, a warning is logged and a null object is returned.
UIObject_PreviousSibling( UIObject object ) : UIObject
Returns the object’s previous sibling. If the object is null, a warning is logged and a null object is returned.
UIObject_InteractiveMode( UIObject object ) : UIInteractionMode
Returns the interaction mode of the object.
UIObject_PixelPosition( UIObject object ) : Float2
Returns the pixel position of this object. If the object is null, a warning is logged and NaN is returned.
UIObject_RelativePosition( UIObject object ) : Float2
Returns the parent relative position of this object. If the object is null, a warning is logged and NaN is returned.
UIObject_WorldPosition( UIObject object ) : Float2
Returns the screen space position of this object, taking pixel and relative positioning into account (sum). If the object is null, a warning is logged and NaN is returned.
UIObject_Anchor( UIObject object ) : UIAnchor
UIObject_PixelSize( UIObject object ) : Float2
Returns the pixel size of this object. If the object is null, a warning is logged and NaN is returned.
UIObject_RelativeSize( UIObject object ) : Float2
Returns the parent relative size of this object. If the object is null, a warning is logged and NaN is returned.
UIObject_WorldSize( UIObject object ) : Float2
Returns the screen space size of this object. If the object is null, a warning is logged and NaN is returned.
UIObject_LocalScale( UIObject object ) : float
Returns the local scale of this object. If the object is null, a warning is logged and NaN is returned.
UIObject_WorldScale( UIObject object ) : float
Returns the total scale of this object. If the object is null, a warning is logged and NaN is returned.
UIObject_LocalDepth( UIObject object ) : int
Returns the local depth of this object. If the object is null, a warning is logged and 0 is returned.
UIObject_WorldDepth( UIObject object ) : int
Returns the total depth of this object. If the object is null, a warning is logged and 0 is returned.
UIObject_LocalOpacity( UIObject object ) : float
Returns the local opacity of this object. If the object is null, a warning is logged and NaN is returned.
UIObject_WorldOpacity( UIObject object ) : float
Returns the total opacity of this object. If the object is null, a warning is logged and NaN is returned.
UIObject_LocalRotation( UIObject object ) : float
Returns the local rotation of this object. If the object is null, a warning is logged and NaN is returned.
UIObject_WorldRotation( UIObject object ) : float
Returns the world rotation of this object. If the object is null, a warning is logged and NaN is returned.
UIObject_HitTest( UIObject object, Float2 point ) : bool
UIObject_LastModifiedFrame( UIObject object ) : uint64_t
UIObject_TransformMatrix( UIObject object) : Float4x4
Returns the matrix transforming points from local to world space. If the object is null, a warning is logged and NaN is returned.
UIObject_Activate( UIObject object ) : UIObjectState
Activates the object if possible and returns the state of the object. This will recursively update children.
UIObject_Deactivate( UIObject object ) : UIObjectState
Deactivates the object if possible and returns the state of the object. This will recursively update children.
UIObject_SetParent( UIObject object, UIObject parent ) : bool
Set the object’s parent. Returns true if the operation succeeds. Returns false if either object is null or destroyed, or the operation would create a cycle.
UIObject_MakeRoot( UIObject object ) : bool
Set the object to be a root. This will unparent the object from its parent, if it has one. Returns true if the operation succeeds. Returns false if the object is null or destroyed.
UIObject_SetInteractiveMode( UIObject object, UIInteractionMode interaction_mode ) : bool
Set the object’s interactivity mode. Returns false if the object is null or destroyed.
UIObject_SetPixelPosition( UIObject object, Float2 position ) : bool
Set the object’s local position and update the hierarchy. Returns false if the object is null.
UIObject_SetRelativePosition( UIObject object, Float2 position ) : bool
Set the object’s relative position and update the hierarchy. Returns false if the object is null.
UIObject_SetAnchor( UIObject object, UIAnchor anchor ) : bool
UIObject_SetPixelSize( UIObject object, Float2 size ) : bool
Set the object’s local size and update the hierarchy. Returns false if the object is null.
UIObject_SetRelativeSize( UIObject object, Float2 size ) : bool
Set the object’s relative size and update the hierarchy. Returns false if the object is null.
UIObject_SetLocalScale( UIObject object, float scale ) : bool
Set the object’s local scale and update the hierarchy. Returns false if the object is null.
UIObject_SetLocalDepth( UIObject object, int value ) : bool
Set the object’s local depth and update the hierarchy. Returns false if the object is null.
UIObject_SetLocalOpacity( UIObject object, float value ) : bool
Set the object’s local opacity and update the hierarchy. Returns false if the object is null.
UIObject_SetLocalRotation( UIObject object, float rotation ) : bool
Set the object’s local opacity and update the hierarchy. Returns false if the object is null.
struct UITexture
A 32 bit handle.
UITexture_Add( UIObject object ) : UITexture
Attaches a uitexture to the object.
UITexture_Destroy( UITexture mesh_renderer ) : void
Destroys the uitexture.
UITexture_Get( UIObject object ) : UITexture
Returns the first uitexture attached to the object.
UITexture_UIObject( UITexture mesh_renderer ) : UIObject
Return the game object this uitexture is attached to.
UITexture_LayerMask( UITexture mesh_renderer ) : uint32_t
Returns the layer mask of this uitexture.
UITexture_SharedMaterial( UITexture mesh_renderer ) : Material
Returns the shared material attached to this uitexture.
UITexture_SetLayerMask( UITexture mesh_renderer, uint32_t mask ) : void
Sets the layer mask.
UITexture_SetMaterial( UITexture mesh_renderer, Material material ) : void
Sets a new material. This will destroy any previous material instance.
UITexture_MaterialInstance( UITexture mesh_renderer) : Material
Returns the material instance. Creates one if none exists.