Have raylib do the same kind of math structure checks that raymath does so they are not order dependent.
This commit is contained in:
parent
5fad835ff1
commit
f2ba735a40
66
src/raylib.h
66
src/raylib.h
|
|
@ -163,11 +163,6 @@
|
||||||
// this defines are useful for internal check and avoid type (re)definitions
|
// this defines are useful for internal check and avoid type (re)definitions
|
||||||
#define RL_COLOR_TYPE
|
#define RL_COLOR_TYPE
|
||||||
#define RL_RECTANGLE_TYPE
|
#define RL_RECTANGLE_TYPE
|
||||||
#define RL_VECTOR2_TYPE
|
|
||||||
#define RL_VECTOR3_TYPE
|
|
||||||
#define RL_VECTOR4_TYPE
|
|
||||||
#define RL_QUATERNION_TYPE
|
|
||||||
#define RL_MATRIX_TYPE
|
|
||||||
|
|
||||||
// Some Basic Colors
|
// Some Basic Colors
|
||||||
// NOTE: Custom raylib color palette for amazing visuals on WHITE background
|
// NOTE: Custom raylib color palette for amazing visuals on WHITE background
|
||||||
|
|
@ -210,37 +205,52 @@
|
||||||
#define RL_BOOL_TYPE
|
#define RL_BOOL_TYPE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Vector2, 2 components
|
#if !defined(RL_VECTOR2_TYPE)
|
||||||
typedef struct Vector2 {
|
// Vector2 type
|
||||||
float x; // Vector x component
|
typedef struct Vector2 {
|
||||||
float y; // Vector y component
|
float x;
|
||||||
} Vector2;
|
float y;
|
||||||
|
} Vector2;
|
||||||
|
#define RL_VECTOR2_TYPE
|
||||||
|
#endif
|
||||||
|
|
||||||
// Vector3, 3 components
|
#if !defined(RL_VECTOR3_TYPE)
|
||||||
typedef struct Vector3 {
|
// Vector3 type
|
||||||
float x; // Vector x component
|
typedef struct Vector3 {
|
||||||
float y; // Vector y component
|
float x;
|
||||||
float z; // Vector z component
|
float y;
|
||||||
} Vector3;
|
float z;
|
||||||
|
} Vector3;
|
||||||
|
#define RL_VECTOR3_TYPE
|
||||||
|
#endif
|
||||||
|
|
||||||
// Vector4, 4 components
|
#if !defined(RL_VECTOR4_TYPE)
|
||||||
typedef struct Vector4 {
|
// Vector4 type
|
||||||
float x; // Vector x component
|
typedef struct Vector4 {
|
||||||
float y; // Vector y component
|
float x;
|
||||||
float z; // Vector z component
|
float y;
|
||||||
float w; // Vector w component
|
float z;
|
||||||
} Vector4;
|
float w;
|
||||||
|
} Vector4;
|
||||||
|
#define RL_VECTOR4_TYPE
|
||||||
|
#endif
|
||||||
|
|
||||||
// Quaternion, 4 components (Vector4 alias)
|
#if !defined(RL_QUATERNION_TYPE)
|
||||||
typedef Vector4 Quaternion;
|
// Quaternion type
|
||||||
|
typedef Vector4 Quaternion;
|
||||||
|
#define RL_QUATERNION_TYPE
|
||||||
|
#endif
|
||||||
|
|
||||||
// Matrix, 4x4 components, column major, OpenGL style, right-handed
|
#if !defined(RL_MATRIX_TYPE)
|
||||||
typedef struct Matrix {
|
// Matrix type (OpenGL style 4x4 - right handed, column major)
|
||||||
|
typedef struct Matrix {
|
||||||
float m0, m4, m8, m12; // Matrix first row (4 components)
|
float m0, m4, m8, m12; // Matrix first row (4 components)
|
||||||
float m1, m5, m9, m13; // Matrix second row (4 components)
|
float m1, m5, m9, m13; // Matrix second row (4 components)
|
||||||
float m2, m6, m10, m14; // Matrix third row (4 components)
|
float m2, m6, m10, m14; // Matrix third row (4 components)
|
||||||
float m3, m7, m11, m15; // Matrix fourth row (4 components)
|
float m3, m7, m11, m15; // Matrix fourth row (4 components)
|
||||||
} Matrix;
|
} Matrix;
|
||||||
|
#define RL_MATRIX_TYPE
|
||||||
|
#endif
|
||||||
|
|
||||||
// Color, 4 components, R8G8B8A8 (32bit)
|
// Color, 4 components, R8G8B8A8 (32bit)
|
||||||
typedef struct Color {
|
typedef struct Color {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user