31 #include "Platform/GraphicAPI.h" 32 #include "Core/Application/Application.h" 33 #include "Core/Macro/Macro.h" 34 #include "Utilities/Format/Format.h" 65 auto texture = GraphicFactory::Create<Texture>();
66 uint8_t buffer[] = { r, g, b };
67 texture->Load(buffer, 1, 1);
73 return MakeTexture(MakeVector3(r, g, b));
78 uint8_t r =
static_cast<uint8_t
>(Clamp(color.r, 0.0f, 1.0f) * 255.0f);
79 uint8_t g =
static_cast<uint8_t
>(Clamp(color.g, 0.0f, 1.0f) * 255.0f);
80 uint8_t b =
static_cast<uint8_t
>(Clamp(color.b, 0.0f, 1.0f) * 255.0f);
81 return MakeTexture(r, g, b);
86 return MakeTexture(ColorPaletteToVector3(color));
91 auto cubemap = GraphicFactory::Create<CubeMap>();
92 uint8_t buffer[] = { r, g, b };
93 std::array<uint8_t*, 6> sides = { buffer, buffer, buffer, buffer, buffer, buffer };
94 cubemap->Load(sides, 1, 1);
100 return MakeCubeMap(MakeVector3(r, g, b));
105 uint8_t r =
static_cast<uint8_t
>(Clamp(color.r, 0.0f, 1.0f) * 255.0f);
106 uint8_t g =
static_cast<uint8_t
>(Clamp(color.g, 0.0f, 1.0f) * 255.0f);
107 uint8_t b =
static_cast<uint8_t
>(Clamp(color.b, 0.0f, 1.0f) * 255.0f);
108 return MakeCubeMap(r, g, b);
113 return MakeCubeMap(ColorPaletteToVector3(color));
116 static Vector3 ColorPaletteToVector3(Palette color)
121 return MakeVector3(1.0f, 0.0f, 0.0f);
123 return MakeVector3(0.0f, 1.0f, 0.0f);
125 return MakeVector3(0.0f, 0.0f, 1.0f);
127 return MakeVector3(1.0f, 1.0f, 0.0f);
129 return MakeVector3(0.0f, 1.0f, 1.0f);
131 return MakeVector3(1.0f, 0.0f, 1.0f);
133 return MakeVector3(0.0f, 0.0f, 0.0f);
135 return MakeVector3(1.0f, 1.0f, 1.0f);
137 return MakeVector3(1.0f, 0.5f, 0.0f);
139 return MakeVector3(0.5f, 1.0f, 0.0f);
140 case Colors::MAGENTA:
141 return MakeVector3(1.0f, 0.0f, 0.5f);
143 return MakeVector3(0.5f, 0.0f, 1.0f);
144 case Colors::SKYBLUE:
145 return MakeVector3(0.0f, 0.5f, 1.0f);
147 return MakeVector3(0.0f, 1.0f, 0.5f);
148 case Colors::FLAT_NORMAL:
149 return MakeVector3(0.5f, 0.5f, 1.0f);
151 return MakeVector3(1.0f, 0.5f, 0.5f);
153 return MakeVector3(0.5f, 1.0f, 0.5f);
155 return MakeVector3(0.5f, 0.5f, 0.5f);
157 return MakeVector3(0.0f);
Definition: AbstractFactory.h:61
Definition: Application.cpp:49