-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCNC_Types.h
More file actions
70 lines (57 loc) · 1.18 KB
/
CNC_Types.h
File metadata and controls
70 lines (57 loc) · 1.18 KB
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
#ifndef CNC_TYPES_H
#define CNC_TYPES_H
#include <simd/simd.h>
#define SCREEN_WIDTH 600
#define SCREEN_HEIGHT 600
#define CNC_PI 3.14159265359
#define CNC_2PI (CNC_PI * 2)
#define CNC_PIHALF (CNC_PI / 2)
#define KILOBYTE 1024
#define MEGABYTE(x) (x*KILOBYTE)
typedef unsigned int u32;
typedef unsigned short u16;
typedef unsigned char u8;
typedef signed int s32;
typedef signed short s16;
typedef float f32;
typedef double f64;
typedef simd_float2 v2;
typedef simd_float3 v3;
typedef simd_float4 v4;
typedef simd_float3x3 m3;
typedef simd_float4x4 m4;
v2 vec2( f32 a, f32 b )
{
v2 result;
result.x = a;
result.y = b;
return result;
}
// mirror image of the types passed to the shader
struct VertexInput
{
v3 m_position;
v2 m_uv;
f32 m_angle;
};
struct UniformData
{
m4 m_projection2d;
v2 m_screenSize;
};
struct DrawCall
{
VertexInput m_vertices[6];
u32 m_textureId;
v2 m_position; // upper left corner
v2 m_size;
f32 m_angle;
};
struct ImageFile
{
s32 m_width;
s32 m_height;
u32 m_textureId;
void* m_data;
};
#endif//CNC_TYPES_H