orca/src/util/typedefs.h

101 lines
1.2 KiB
C
Raw Normal View History

2022-08-14 16:19:40 +00:00
//*****************************************************************
//
// $file: typedefs.h $
// $author: Martin Fouilleul $
// $date: 23/36/2015 $
// $revision: $
// $note: (C) 2015 by Martin Fouilleul - all rights reserved $
//
//*****************************************************************
#ifndef __TYPEDEFS_H_
#define __TYPEDEFS_H_
#include<stddef.h>
#include<stdint.h>
2022-08-14 16:19:40 +00:00
#include<float.h> //FLT_MAX/MIN etc...
#ifndef __cplusplus
#include<stdbool.h>
#endif //__cplusplus
typedef uint8_t byte;
typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;
typedef int8_t i8;
typedef int16_t i16;
typedef int32_t i32;
typedef int64_t i64;
typedef float f32;
typedef double f64;
typedef union
{
struct
{
f32 x;
f32 y;
};
f32 c[2];
} oc_vec2;
typedef union
{
struct
{
f32 x;
f32 y;
f32 z;
};
f32 c[3];
} oc_vec3;
2022-08-14 16:19:40 +00:00
typedef union
{
struct
{
i32 x;
i32 y;
};
i32 c[2];
} oc_vec2i;
2022-08-14 16:19:40 +00:00
typedef union
{
struct
{
f32 x;
f32 y;
f32 z;
f32 w;
};
f32 c[4];
} oc_vec4;
2022-08-14 16:19:40 +00:00
typedef struct oc_mat2x3
{
f32 m[6];
} oc_mat2x3;
2022-08-14 16:19:40 +00:00
typedef union
{
struct
{
f32 x;
f32 y;
f32 w;
f32 h;
};
struct
{
oc_vec2 xy;
oc_vec2 wh;
};
2022-08-14 16:19:40 +00:00
f32 c[4];
} oc_rect;
2022-08-14 16:19:40 +00:00
#endif //__TYPEDEFS_H_