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
10constexpr const char* ENGINE_NAME = "Untitled 2D game engine";
11
12// Update
13constexpr u16
20
21// Types
23struct i32Vec2
24{
25 i32 x, y;
26};
27
28struct u32Vec2
29{
30 u32 x, y;
31};
32
33struct 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
46static constexpr Colour BLACK {};
48static constexpr Colour WHITE (255, 255, 255);
50static constexpr Colour RED (255, 0, 0);
52static constexpr Colour GREEN (0, 255, 0);
54static constexpr Colour BLUE (0, 0, 255);
55
57using 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*/
constexpr u16 UPDATE_PATCH
Patch update version.
constexpr u16 UPDATE_MAJOR
Major update version.
constexpr u16 UPDATE_MINOR
Minor update version.
constexpr const char * ENGINE_NAME
The name of the game engine TODO: instert name here when decided.
Colour Color
Alias for Colour, American spelling.
Has alias 'Color'. Holds an 24 bit colour (+ an alpha channel)
2D vector of 32 bit width integers
2D vector of 32 bit width unsigned integers