Nameless Engine
Loading...
Searching...
No Matches
ShadowMapType.hpp
1#pragma once
2
3// Standard.
4#include <stdexcept>
5#include <string>
6
7// Custom.
8#include "misc/Error.h"
9
10namespace ne {
12 enum class ShadowMapType : unsigned int {
13 DIRECTIONAL = 0,
14 SPOT,
15 POINT,
16
17 // ... new types go here ...
18
19 SIZE // marks the size of this enum
20 };
21
29 inline std::string shadowMapTypeToString(ShadowMapType type) {
30 switch (type) {
31 case (ShadowMapType::DIRECTIONAL): {
32 return "directional";
33 break;
34 }
35 case (ShadowMapType::SPOT): {
36 return "spot";
37 break;
38 }
39 case (ShadowMapType::POINT): {
40 return "point";
41 break;
42 }
43 case (ShadowMapType::SIZE): {
44 Error error("not a valid type");
45 error.showError();
46 throw std::runtime_error(error.getFullErrorMessage());
47 break;
48 }
49 }
50
51 Error error("unknown shadow map type");
52 error.showError();
53 throw std::runtime_error(error.getFullErrorMessage());
54 }
55}