-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgraphic_types.h
More file actions
55 lines (44 loc) · 786 Bytes
/
graphic_types.h
File metadata and controls
55 lines (44 loc) · 786 Bytes
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
#pragma once
#include "types.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef uint32_t color;
typedef union argbcolor {
struct {
uint32_t blue: 8;
uint32_t green: 8;
uint32_t red: 8;
uint32_t alpha: 8;
};
uint32_t color;
} argbcolor;
typedef struct {
i32 x;
i32 y;
} gpu_point;
typedef struct {
i32 x;
i32 y;
} int_point;
typedef struct {
u32 width;
u32 height;
} gpu_size;
typedef struct {
gpu_point point;
gpu_size size;
} gpu_rect;
#define MAX_DIRTY_RECTS 64
typedef struct draw_ctx {
gpu_rect dirty_rects[MAX_DIRTY_RECTS];
uint32_t* fb;
uint32_t stride;
uint32_t width;
uint32_t height;
uint32_t dirty_count;
bool full_redraw;
} draw_ctx;
#ifdef __cplusplus
}
#endif