summaryrefslogtreecommitdiffhomepage
path: root/include/rodeo/gfx_t.h
blob: 3d206c2e5d9e65da054640308645c9e5480e52cf (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#pragma once

// -- internal --
// public
#include "rodeo_types.h"
#include "rodeo/math/vec2_t.h"
// -- system --
#include <inttypes.h>

typedef struct irodeo_gfx_texture_2d irodeo_gfx_texture_2d_t;

typedef
struct
{
	irodeo_gfx_texture_2d_t *data;
	uint32_t width;
	uint32_t height;
}
rodeo_gfx_texture_2d_t;

typedef
union
{
	struct
	{
		float red;
		float green;
		float blue;
		float alpha;
	}
	colors;
	float array[4];
}
rodeo_color_RGBAFloat_t;

typedef
union
{
	struct
	{
		uint8_t red;
		uint8_t green;
		uint8_t blue;
		uint8_t alpha;
	}
	colors;
	uint32_t rgba;
	uint8_t array[4];
}
rodeo_color_RGBA8_t;

typedef
struct
{
	float x;
	float y;
	float z;
	rodeo_color_RGBAFloat_t color;
	//float red;
	//float green;
	//float blue;
	//float alpha;
	float texture_x;
	float texture_y;
	float texture_id;
}
rodeo_gfx_vertex_t;

typedef uint16_t rodeo_gfx_index_t;

typedef
struct
{
	rodeo_math_vec2_t target;
	float turns;
	float zoom;
	rodeo_math_vec2_t offset;
}
rodeo_gfx_camera_2d_t;