summaryrefslogtreecommitdiff
path: root/src/core/vert.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/vert.h')
-rw-r--r--src/core/vert.h35
1 files changed, 13 insertions, 22 deletions
diff --git a/src/core/vert.h b/src/core/vert.h
index a2fdb74..0542ded 100644
--- a/src/core/vert.h
+++ b/src/core/vert.h
@@ -7,42 +7,33 @@
#include "../util/type.h"
#include "../util/assert.h"
-//typedef uint Color; // ARGB by default
-
-typedef uint Color; // ARGB by default
+typedef uint Color; // ARGB
#define COLOR_A(c) ((c >> 24) & 0xff)
#define COLOR_R(c) ((c >> 16) & 0xff)
#define COLOR_G(c) ((c >> 8) & 0xff)
#define COLOR_B(c) (c & 0xff)
-typedef Vec4 Color32; // 4个float的颜色
+typedef Vec4 Color32;
Color color32_tocolor(Color32* c);
void color_tocolor32(Color c, Color32* out);
void color32_saturate(Color32* c);
-enum VertMask {
- VERTMASK_POSITION = 1 ,
- VERTMASK_NORMAL = 1 << 1,
- VERTMASK_COLOR = 1 << 2,
- VERTMASK_TANGENT = 1 << 3,
- VERTMASK_UV = 1 << 4,
-};
-
-/*标准的顶点结构,禁止修改*/
+/*readonly*/
typedef struct Vert {
- uint index;
- uint comp;
- Vec3* position;
- Vec3* normal;
- Vec3* tangent;
- Vec2* uv;
+ int index;
+ Vec3 position;
+ Vec3 normal;
+ Vec3 tangent;
+ Vec2 texcoord;
Color color;
+ Vec4 joint;
+ Vec4 weight;
} Vert;
-Vert* vert_new(uint comp); /*新建vert*/
-void vert_init(Vert* v, uint comp); /*如果某些component没创建,创建它*/
-void vert_free(Vert* v); /*释放vert*/
+Vert* vert_new(uint comp);
+void vert_init(Vert* v, uint comp);
+void vert_free(Vert* v);
#endif \ No newline at end of file