2D_Game_Engine
Loading...
Searching...
No Matches
include
structs.hpp
Go to the documentation of this file.
1
#pragma once
2
3
struct
Vec2
{
4
union
{
5
float
x
;
6
float
w
;
7
};
8
union
{
9
float
y
;
10
float
h
;
11
};
12
Vec2
();
13
Vec2
(
float
x
,
float
y
);
14
};
15
16
struct
Vec3
{
17
float
r
,
g
,
b
;
18
Vec3
();
19
Vec3
(
float
r
,
float
g
,
float
b
);
20
};
21
22
struct
Vec4
{
23
float
r
,
g
,
b
,
a
;
24
Vec4
();
25
Vec4
(
float
r
,
float
g
,
float
b
,
float
a
);
26
};
27
28
struct
Vertex
{
29
Vec2
position
;
30
Vec2
texcoords
;
31
int
layer
;
32
float
texID
;
33
34
Vertex
();
35
Vertex
(
Vec2
pos,
Vec2
texcoords
,
int
layer
,
float
texID
);
36
};
37
38
struct
LineVertex
{
39
Vec2
pos
;
40
Vec4
color
;
41
int
layer
;
42
43
LineVertex
();
44
LineVertex
(
Vec2
pos
,
Vec4
color
,
int
layer
);
45
};
46
47
struct
PointVertex
{
48
Vec2
pos
;
49
Vec4
color
;
50
float
border
;
51
int
layer
;
52
53
PointVertex
();
54
PointVertex
(
Vec2
pos
,
Vec4
color
,
float
border
,
int
layer
);
55
};
56
57
struct
TriangleVertex
{
58
Vec2
position
;
59
Vec4
color
;
60
int
layer
;
61
TriangleVertex
();
62
TriangleVertex
(
Vec2
pos,
Vec4
color
,
int
layer
);
63
};
64
65
Vec2
operator+
(
Vec2
a,
Vec2
b);
66
Vec2
operator-
(
Vec2
a,
Vec2
b);
67
Vec2
operator*
(
Vec2
a,
Vec2
b);
68
Vec2
operator*
(
float
a,
Vec2
b);
69
Vec2
operator*
(
Vec2
a,
float
b);
70
Vec2
operator/
(
Vec2
a,
Vec2
b);
71
Vec2
operator/
(
float
a,
Vec2
b);
72
Vec2
operator/
(
Vec2
a,
int
b);
73
74
struct
Rect
{
75
Vec2
pos
;
76
Vec2
size
;
77
Vec2
vel
;
78
79
Rect
();
80
Rect
(
Vec2
pos
,
Vec2
size
,
Vec2
vel
);
81
};
82
83
std::ostream &
operator<<
(std::ostream &os,
const
Vec2
&v);
84
std::ostream &
operator<<
(std::ostream &os,
const
Vec3
&v);
85
std::ostream &
operator<<
(std::ostream &os,
const
Vec4
&v);
86
std::ostream &
operator<<
(std::ostream &os,
const
Vertex
&v);
87
std::ostream &
operator<<
(std::ostream &os,
const
LineVertex
&v);
88
std::ostream &
operator<<
(std::ostream &os,
const
PointVertex
&v);
89
std::ostream &
operator<<
(std::ostream &os,
const
TriangleVertex
&v);
90
std::ostream &
operator<<
(std::ostream &os,
const
Rect
&v);
LineVertex
Definition
structs.hpp:38
LineVertex::pos
Vec2 pos
Definition
structs.hpp:39
LineVertex::color
Vec4 color
Definition
structs.hpp:40
LineVertex::LineVertex
LineVertex()
Definition
structs.cpp:16
LineVertex::layer
int layer
Definition
structs.hpp:41
PointVertex
Definition
structs.hpp:47
PointVertex::color
Vec4 color
Definition
structs.hpp:49
PointVertex::pos
Vec2 pos
Definition
structs.hpp:48
PointVertex::border
float border
Definition
structs.hpp:50
PointVertex::layer
int layer
Definition
structs.hpp:51
PointVertex::PointVertex
PointVertex()
Definition
structs.cpp:19
Rect
Definition
structs.hpp:74
Rect::size
Vec2 size
Definition
structs.hpp:76
Rect::pos
Vec2 pos
Definition
structs.hpp:75
Rect::Rect
Rect()
Definition
structs.cpp:57
Rect::vel
Vec2 vel
Definition
structs.hpp:77
TriangleVertex
Definition
structs.hpp:57
TriangleVertex::layer
int layer
Definition
structs.hpp:60
TriangleVertex::color
Vec4 color
Definition
structs.hpp:59
TriangleVertex::position
Vec2 position
Definition
structs.hpp:58
TriangleVertex::TriangleVertex
TriangleVertex()
Definition
structs.cpp:13
Vec2
Definition
structs.hpp:3
Vec2::y
float y
Definition
structs.hpp:9
Vec2::Vec2
Vec2()
Definition
structs.cpp:4
Vec2::w
float w
Definition
structs.hpp:6
Vec2::h
float h
Definition
structs.hpp:10
Vec2::x
float x
Definition
structs.hpp:5
Vec3
Definition
structs.hpp:16
Vec3::b
float b
Definition
structs.hpp:17
Vec3::r
float r
Definition
structs.hpp:17
Vec3::g
float g
Definition
structs.hpp:17
Vec3::Vec3
Vec3()
Definition
structs.cpp:7
Vec4
Definition
structs.hpp:22
Vec4::g
float g
Definition
structs.hpp:23
Vec4::b
float b
Definition
structs.hpp:23
Vec4::a
float a
Definition
structs.hpp:23
Vec4::Vec4
Vec4()
Definition
structs.cpp:10
Vec4::r
float r
Definition
structs.hpp:23
Vertex
Definition
structs.hpp:28
Vertex::texID
float texID
Definition
structs.hpp:32
Vertex::position
Vec2 position
Definition
structs.hpp:29
Vertex::Vertex
Vertex()
Definition
structs.cpp:22
Vertex::texcoords
Vec2 texcoords
Definition
structs.hpp:30
Vertex::layer
int layer
Definition
structs.hpp:31
operator-
Vec2 operator-(Vec2 a, Vec2 b)
Definition
structs.cpp:29
operator*
Vec2 operator*(Vec2 a, Vec2 b)
Definition
structs.cpp:33
operator/
Vec2 operator/(Vec2 a, Vec2 b)
Definition
structs.cpp:45
operator<<
std::ostream & operator<<(std::ostream &os, const Vec2 &v)
Definition
structs.cpp:60
operator+
Vec2 operator+(Vec2 a, Vec2 b)
Definition
structs.cpp:25
Generated by
1.10.0