Untitled 2D game engine
pre-alpha
A 2D game engine made with Vulkan in C++
Loading...
Searching...
No Matches
constants_and_types.h
Go to the documentation of this file.
1
4
5
#pragma once
6
#include <opinionated_type_names.h>
7
8
// Engine details
10
constexpr
const
char
*
ENGINE_NAME
=
"Untitled 2D game engine"
;
11
12
// Update
13
constexpr
u16
15
UPDATE_MAJOR
= 1,
17
UPDATE_MINOR
= 0,
19
UPDATE_PATCH
= 0;
20
21
// Types
23
struct
i32Vec2
24
{
25
i32 x, y;
26
};
27
28
struct
u32Vec2
29
{
30
u32 x, y;
31
};
32
33
struct
Colour
34
{
35
u8 r, g, b, a;
36
constexpr
Colour() : r(0), g(0), b(0), a(255) {}
37
38
constexpr
Colour(u8 red, u8 green, u8 blue)
39
: r(red), g(green), b(blue), a(255) {}
40
41
constexpr
Colour(u8 red, u8 green, u8 blue, u8 alpha)
42
: r(red), g(green), b(blue), a(alpha) {}
43
};
44
// Colour constants
46
static
constexpr
Colour
BLACK {};
48
static
constexpr
Colour
WHITE (255, 255, 255);
50
static
constexpr
Colour
RED (255, 0, 0);
52
static
constexpr
Colour
GREEN (0, 255, 0);
54
static
constexpr
Colour
BLUE (0, 0, 255);
55
57
using
Color
=
Colour
;
58
59
/*
60
NOTES:
61
62
What cases does this engine use:
63
Variables use camelCase
64
65
Functions use PascalCase
66
Structs use PascalCase (unless starts with type (e.g. u8))
67
Classes use PascalCase
68
69
Constants use UPPERCASE_SNAKE_CASE
70
71
.h files use lowercase_snake_case
72
.cpp files use lowercase_snake_case
73
74
namespaces use lowercase (single word)
75
76
Use /// for doxygen documentation
77
*/
UPDATE_PATCH
constexpr u16 UPDATE_PATCH
Patch update version.
Definition
constants_and_types.h:19
UPDATE_MAJOR
constexpr u16 UPDATE_MAJOR
Major update version.
Definition
constants_and_types.h:15
UPDATE_MINOR
constexpr u16 UPDATE_MINOR
Minor update version.
Definition
constants_and_types.h:17
ENGINE_NAME
constexpr const char * ENGINE_NAME
The name of the game engine TODO: instert name here when decided.
Definition
constants_and_types.h:10
Color
Colour Color
Alias for Colour, American spelling.
Definition
constants_and_types.h:57
Colour
Has alias 'Color'. Holds an 24 bit colour (+ an alpha channel)
Definition
constants_and_types.h:34
i32Vec2
2D vector of 32 bit width integers
Definition
constants_and_types.h:24
u32Vec2
2D vector of 32 bit width unsigned integers
Definition
constants_and_types.h:29
Engine
constants_and_types.h
Generated by
1.13.2