make vec4 and matrix types internal
This commit is contained in:
parent
951d9c76c8
commit
83e2dc5468
@ -22,16 +22,6 @@ typedef struct Vec3 {
|
|||||||
} Vec3;
|
} Vec3;
|
||||||
|
|
||||||
|
|
||||||
/* a point in some three dimension space (floating point) */
|
|
||||||
/* y goes up, x goes to the right */
|
|
||||||
typedef struct Vec4 {
|
|
||||||
float x;
|
|
||||||
float y;
|
|
||||||
float z;
|
|
||||||
float w;
|
|
||||||
} Vec4;
|
|
||||||
|
|
||||||
|
|
||||||
/* 32-bit color data */
|
/* 32-bit color data */
|
||||||
typedef struct Color {
|
typedef struct Color {
|
||||||
uint8_t r;
|
uint8_t r;
|
||||||
@ -49,10 +39,5 @@ typedef struct Rect {
|
|||||||
float h;
|
float h;
|
||||||
} Rect;
|
} Rect;
|
||||||
|
|
||||||
/* TODO: remove from here? */
|
|
||||||
typedef struct Matrix4 {
|
|
||||||
Vec4 row[4];
|
|
||||||
} Matrix4;
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -239,16 +239,6 @@
|
|||||||
"c_type": "Vec3"
|
"c_type": "Vec3"
|
||||||
},
|
},
|
||||||
|
|
||||||
"Vec4": {
|
|
||||||
"fields": [
|
|
||||||
{ "name": "x", "type": "float" },
|
|
||||||
{ "name": "y", "type": "float" },
|
|
||||||
{ "name": "z", "type": "float" },
|
|
||||||
{ "name": "w", "type": "float" }
|
|
||||||
],
|
|
||||||
"c_type": "Vec4"
|
|
||||||
},
|
|
||||||
|
|
||||||
"Color": {
|
"Color": {
|
||||||
"fields": [
|
"fields": [
|
||||||
{ "name": "r", "type": "uint8_t" },
|
{ "name": "r", "type": "uint8_t" },
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
/* TODO: structure more categorically */
|
/* TODO: structure more categorically */
|
||||||
|
|
||||||
#include "twn_textures_c.h"
|
#include "twn_textures_c.h"
|
||||||
|
#include "twn_types_c.h"
|
||||||
#include "twn_text_c.h"
|
#include "twn_text_c.h"
|
||||||
#include "twn_option.h"
|
#include "twn_option.h"
|
||||||
#include "twn_deferred_commands.h"
|
#include "twn_deferred_commands.h"
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#define TWN_CAMERA_H
|
#define TWN_CAMERA_H
|
||||||
|
|
||||||
#include "twn_types.h"
|
#include "twn_types.h"
|
||||||
|
#include "twn_types_c.h"
|
||||||
|
|
||||||
/* TODO: make it cached? */
|
/* TODO: make it cached? */
|
||||||
/* for example, perspective matrix only needs recaluclation on FOV change */
|
/* for example, perspective matrix only needs recaluclation on FOV change */
|
||||||
|
19
src/twn_types_c.h
Normal file
19
src/twn_types_c.h
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#ifndef TWN_TYPES_C_H
|
||||||
|
#define TWN_TYPES_C_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
typedef struct Vec4 {
|
||||||
|
float x;
|
||||||
|
float y;
|
||||||
|
float z;
|
||||||
|
float w;
|
||||||
|
} Vec4;
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct Matrix4 {
|
||||||
|
Vec4 row[4];
|
||||||
|
} Matrix4;
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue
Block a user