Skip to content

Commit 8e01c1d

Browse files
authored
Merge pull request #363 from mikomikotaishi/master
Add Colors namespace and missing enums
2 parents be2efd4 + 42bff08 commit 8e01c1d

File tree

1 file changed

+83
-0
lines changed

1 file changed

+83
-0
lines changed

modules/raylib.cppm

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,33 @@ module;
1010
#define RAYMATH_IMPLEMENTATION
1111
#include "../include/raylib-cpp.hpp"
1212

13+
#undef LIGHTGRAY
14+
#undef GRAY
15+
#undef DARKGRAY
16+
#undef YELLOW
17+
#undef GOLD
18+
#undef ORANGE
19+
#undef PINK
20+
#undef RED
21+
#undef MAROON
22+
#undef GREEN
23+
#undef LIME
24+
#undef DARKGREEN
25+
#undef SKYBLUE
26+
#undef BLUE
27+
#undef DARKBLUE
28+
#undef PURPLE
29+
#undef VIOLET
30+
#undef DARKPURPLE
31+
#undef BEIGE
32+
#undef BROWN
33+
#undef DARKBROWN
34+
#undef WHITE
35+
#undef BLACK
36+
#undef BLANK
37+
#undef MAGENTA
38+
#undef RAYWHITE
39+
1340
export module raylib;
1441

1542
/**
@@ -60,6 +87,29 @@ export namespace raylib {
6087
using raylib::Wave;
6188
using raylib::Window;
6289

90+
// Enums
91+
using ::ConfigFlags;
92+
using ::TraceLogLevel;
93+
using ::KeyboardKey;
94+
using ::MouseButton;
95+
using ::MouseCursor;
96+
using ::GamepadButton;
97+
using ::GamepadAxis;
98+
using ::MaterialMapIndex;
99+
using ::ShaderLocationIndex;
100+
using ::ShaderUniformDataType;
101+
using ::ShaderAttributeDataType;
102+
using ::PixelFormat;
103+
using ::TextureFilter;
104+
using ::TextureWrap;
105+
using ::CubemapLayout;
106+
using ::FontType;
107+
using ::BlendMode;
108+
using ::Gesture;
109+
using ::CameraMode;
110+
using ::CameraProjection;
111+
using ::NPatchLayout;
112+
63113
// From Functions.hpp
64114
using raylib::InitWindow;
65115
using raylib::SetWindowTitle;
@@ -108,6 +158,39 @@ export namespace raylib {
108158
using raylib::TextToPascal;
109159
using raylib::TextToInteger;
110160

161+
/**
162+
* @namespace raylib::Colors
163+
* @brief Re-exports all Color macros as inline constexpr
164+
*/
165+
namespace Colors {
166+
inline constexpr ::Color LIGHTGRAY = CLITERAL(::Color){ 200, 200, 200, 255 };
167+
inline constexpr ::Color GRAY = CLITERAL(::Color){ 130, 130, 130, 255 };
168+
inline constexpr ::Color DARKGRAY = CLITERAL(::Color){ 80, 80, 80, 255 };
169+
inline constexpr ::Color YELLOW = CLITERAL(::Color){ 253, 249, 0, 255 };
170+
inline constexpr ::Color GOLD = CLITERAL(::Color){ 255, 203, 0, 255 };
171+
inline constexpr ::Color ORANGE = CLITERAL(::Color){ 255, 161, 0, 255 };
172+
inline constexpr ::Color PINK = CLITERAL(::Color){ 255, 109, 194, 255 };
173+
inline constexpr ::Color RED = CLITERAL(::Color){ 230, 41, 55, 255 };
174+
inline constexpr ::Color MAROON = CLITERAL(::Color){ 190, 33, 55, 255 };
175+
inline constexpr ::Color GREEN = CLITERAL(::Color){ 0, 228, 48, 255 };
176+
inline constexpr ::Color LIME = CLITERAL(::Color){ 0, 158, 47, 255 };
177+
inline constexpr ::Color DARKGREEN = CLITERAL(::Color){ 0, 117, 44, 255 };
178+
inline constexpr ::Color SKYBLUE = CLITERAL(::Color){ 102, 191, 255, 255 };
179+
inline constexpr ::Color BLUE = CLITERAL(::Color){ 0, 121, 241, 255 };
180+
inline constexpr ::Color DARKBLUE = CLITERAL(::Color){ 0, 82, 172, 255 };
181+
inline constexpr ::Color PURPLE = CLITERAL(::Color){ 200, 122, 255, 255 };
182+
inline constexpr ::Color VIOLET = CLITERAL(::Color){ 135, 60, 190, 255 };
183+
inline constexpr ::Color DARKPURPLE = CLITERAL(::Color){ 112, 31, 126, 255 };
184+
inline constexpr ::Color BEIGE = CLITERAL(::Color){ 211, 176, 131, 255 };
185+
inline constexpr ::Color BROWN = CLITERAL(::Color){ 127, 106, 79, 255 };
186+
inline constexpr ::Color DARKBROWN = CLITERAL(::Color){ 76, 63, 47, 255 };
187+
inline constexpr ::Color WHITE = CLITERAL(::Color){ 255, 255, 255, 255 };
188+
inline constexpr ::Color BLACK = CLITERAL(::Color){ 0, 0, 0, 255 };
189+
inline constexpr ::Color BLANK = CLITERAL(::Color){ 0, 0, 0, 0 };
190+
inline constexpr ::Color MAGENTA = CLITERAL(::Color){ 255, 0, 255, 255 };
191+
inline constexpr ::Color RAYWHITE = CLITERAL(::Color){ 245, 245, 245, 255 };
192+
}
193+
111194
/**
112195
* @namespace raylib::Keyboard
113196
* @brief Input-related functions: keyboard

0 commit comments

Comments
 (0)