Josh's Graphics Library
Enums.h
Go to the documentation of this file.
1#pragma once
2
3namespace JGL {
4 enum class Direction : u8 {
5 None = 0,
6 Vertical = 1,
7 Horizontal = 2,
8 Diagonal_NWSE = 3, // North West -> South East.
9 Diagonal_SWNE = 4 // South West -> North East.
10 };
11
13 return static_cast<Direction>(static_cast<int>(a) | static_cast<int>(b));
14 }
15
16 inline bool operator&(Direction a, Direction b) {
17 return (u8)a & (u8)b;
18 }
19
20 static std::string to_string(const JGL::Direction& direction) {
21 switch (direction) {
23 return "None";
25 return "Vertical";
27 return "Horizontal";
29 return "Diagonal_NWSE";
31 return "Diagonal_SWNE";
32 default:
33 return "Unknown";
34 }
35 }
36
37 enum class MSAA_SAMPLE_RATE : u8 {
38 MSAA_NONE = 0,
39 MSAA_2X = 1,
40 MSAA_4X = 2,
41 MSAA_8X = 3
42 };
43
44 static std::string to_string(const JGL::MSAA_SAMPLE_RATE& sample_rate) {
45 switch (sample_rate) {
47 return "No MSAA";
49 return "MSAA 2x";
51 return "MSAA 4x";
53 return "MSAA 8x";
54 default:
55 return "Unknown";
56 }
57 }
58 static int to_int(const JGL::MSAA_SAMPLE_RATE& sample_rate) {
59 switch (sample_rate) {
61 return 0;
63 return 2;
65 return 4;
67 return 8;
68 default:
69 return 0;
70 }
71 }
72}
OpenGL Wrapper for rendering 2D & 3D graphics in both a 2D and 3D context.
Definition: JGL.h:31
bool operator&(Direction a, Direction b)
Definition: Enums.h:16
Direction operator|(Direction a, Direction b)
Definition: Enums.h:12
MSAA_SAMPLE_RATE
Definition: Enums.h:37
Direction
Definition: Enums.h:4