summaryrefslogtreecommitdiff
path: root/src/core/vert.h
blob: d5944420a42be4c55615f9d9d93cd2c2d01a4aa4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef _SOFTSHADEROOM_VERT_H_
#define _SOFTSHADEROOM_VERT_H_

#include "mem.h"
#include "color.h"
#include "../math/math.h"
#include "../util/type.h"
#include "../util/assert.h"

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;

Color color32_tocolor(Color32* c);
void color_tocolor32(Color c, Color32* out);
void color32_saturate(Color32* c);

/*readonly*/
typedef struct Vert {
	uint index;
	Vec3 position;
	Vec3 normal;
	Vec4 tangent;
	Vec2 texcoord;
	Color color;
/*
	Vec4 joint;
	Vec4 weight;
*/
} Vert;

#endif