• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Razakhel / RaZ / 17345118961

30 Aug 2025 02:47PM UTC coverage: 74.197% (-0.1%) from 74.324%
17345118961

push

github

Razakhel
[CI] Changed the used Ubuntu & macOS images

- Bumped Ubuntu to 24.04, making available GCC 13.3.0 (previously 11.4.4) & Clang 18.1.3 (previously 14.0.0)

- Forced macOS to 15, making available Apple Clang 17.0 (previously 15.0)

8319 of 11212 relevant lines covered (74.2%)

1740.9 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

97.93
/src/RaZ/Script/LuaWindow.cpp
1
#include "RaZ/Data/Image.hpp"
2
#include "RaZ/Render/RenderSystem.hpp"
3
#include "RaZ/Render/Window.hpp"
4
#include "RaZ/Script/LuaWrapper.hpp"
5
#include "RaZ/Utils/TypeUtils.hpp"
6

7
#define SOL_ALL_SAFETIES_ON 1
8
#include "sol/sol.hpp"
9

10
namespace Raz {
11

12
using namespace TypeUtils;
13

14
void LuaWrapper::registerWindowTypes() {
2✔
15
  sol::state& state = getState();
2✔
16

17
  {
18
    sol::usertype<Window> window = state.new_usertype<Window>("Window",
19
                                                              sol::constructors<Window(RenderSystem&, unsigned int, unsigned int),
×
20
                                                                                Window(RenderSystem&, unsigned int, unsigned int, const std::string&),
21
                                                                                Window(RenderSystem&, unsigned int, unsigned int, const std::string&,
22
                                                                                       WindowSetting),
23
                                                                                Window(RenderSystem&, unsigned int, unsigned int, const std::string&,
24
                                                                                       WindowSetting, uint8_t)>());
2✔
25
    window["getWidth"]                 = &Window::getWidth;
2✔
26
    window["getHeight"]                = &Window::getHeight;
2✔
27
#if !defined(RAZ_NO_OVERLAY)
28
    window["getOverlay"]               = &Window::getOverlay;
2✔
29
#endif
30
    window["setClearColor"]            = sol::overload([] (const Window& w, const Color& c) { w.setClearColor(c); },
3✔
31
                                                       PickOverload<const Color&, float>(&Window::setClearColor),
2✔
32
                                                       [] (const Window& w, float r, float g, float b) { w.setClearColor(r, g, b); },
1✔
33
                                                       PickOverload<float, float, float, float>(&Window::setClearColor));
4✔
34
    window["setTitle"]                 = &Window::setTitle;
2✔
35
    window["setIcon"]                  = &Window::setIcon;
2✔
36
    window["resize"]                   = &Window::resize;
2✔
37
    window["makeFullscreen"]           = &Window::makeFullscreen;
2✔
38
    window["makeWindowed"]             = &Window::makeWindowed;
2✔
39
    window["enableFaceCulling"]        = sol::overload([] (const Window& w) { w.enableFaceCulling(); },
3✔
40
                                                       PickOverload<bool>(&Window::enableFaceCulling));
4✔
41
    window["disableFaceCulling"]       = &Window::disableFaceCulling;
2✔
42
    window["recoverVerticalSyncState"] = &Window::recoverVerticalSyncState;
2✔
43
    window["enableVerticalSync"]       = sol::overload([] (const Window& w) { w.enableVerticalSync(); },
3✔
44
                                                       PickOverload<bool>(&Window::enableVerticalSync));
4✔
45
    window["disableVerticalSync"]      = &Window::disableVerticalSync;
2✔
46
    window["showCursor"]               = &Window::showCursor;
2✔
47
    window["hideCursor"]               = &Window::hideCursor;
2✔
48
    window["disableCursor"]            = &Window::disableCursor;
2✔
49
    window["addKeyCallback"]           = sol::overload([] (Window& w, Keyboard::Key k, std::function<void(float)> c) { w.addKeyCallback(k, std::move(c)); },
3✔
50
                                                       [] (Window& w, Keyboard::Key k, std::function<void(float)> c,
×
51
                                                           Input::ActionTrigger f) { w.addKeyCallback(k, std::move(c), f); },
1✔
52
                                                       PickOverload<Keyboard::Key, std::function<void(float)>,
53
                                                                    Input::ActionTrigger, std::function<void()>>(&Window::addKeyCallback));
4✔
54
    window["addMouseButtonCallback"]   = sol::overload([] (Window& w, Mouse::Button b,
2✔
55
                                                           std::function<void(float)> c) { w.addMouseButtonCallback(b, std::move(c)); },
1✔
56
                                                       [] (Window& w, Mouse::Button b, std::function<void(float)> c,
×
57
                                                           Input::ActionTrigger f) { w.addMouseButtonCallback(b, std::move(c), f); },
1✔
58
                                                       PickOverload<Mouse::Button, std::function<void(float)>, Input::ActionTrigger,
59
                                                                    std::function<void()>>(&Window::addMouseButtonCallback));
4✔
60
    window["setMouseScrollCallback"]   = &Window::setMouseScrollCallback;
2✔
61
    window["setMouseMoveCallback"]     = &Window::setMouseMoveCallback;
2✔
62
    window["setCloseCallback"]         = &Window::setCloseCallback;
2✔
63
    window["updateCallbacks"]          = &Window::updateCallbacks;
2✔
64
#if !defined(RAZ_NO_OVERLAY)
65
    window["enableOverlay"]            = sol::overload([] (Window& w) { w.enableOverlay(); },
3✔
66
                                                       PickOverload<bool>(&Window::enableOverlay));
4✔
67
    window["disableOverlay"]           = &Window::disableOverlay;
2✔
68
#endif
69
    window["run"]                      = &Window::run;
2✔
70
    window["recoverMousePosition"]     = &Window::recoverMousePosition;
2✔
71

72
    state.new_enum<WindowSetting>("WindowSetting", {
2✔
73
      { "FOCUSED",        WindowSetting::FOCUSED },
2✔
74
      { "RESIZABLE",      WindowSetting::RESIZABLE },
2✔
75
      { "VISIBLE",        WindowSetting::VISIBLE },
2✔
76
      { "DECORATED",      WindowSetting::DECORATED },
2✔
77
      { "AUTO_MINIMIZE",  WindowSetting::AUTO_MINIMIZE },
2✔
78
      { "ALWAYS_ON_TOP",  WindowSetting::ALWAYS_ON_TOP },
2✔
79
      { "MAXIMIZED",      WindowSetting::MAXIMIZED },
2✔
80
#if !defined(RAZ_PLATFORM_EMSCRIPTEN)
81
      { "CENTER_CURSOR",  WindowSetting::CENTER_CURSOR },
2✔
82
      { "TRANSPARENT_FB", WindowSetting::TRANSPARENT_FB },
2✔
83
      { "AUTOFOCUS",      WindowSetting::AUTOFOCUS },
2✔
84
#endif
85
      { "DEFAULT",        WindowSetting::DEFAULT },
2✔
86
      { "NON_RESIZABLE",  WindowSetting::NON_RESIZABLE },
2✔
87
      { "WINDOWED",       WindowSetting::WINDOWED },
2✔
88
      { "BORDERLESS",     WindowSetting::BORDERLESS },
2✔
89
      { "INVISIBLE",      WindowSetting::INVISIBLE }
2✔
90
    });
91

92
    state.new_enum<Input::ActionTrigger>("Input", {
2✔
93
      { "ONCE",   Input::ONCE },
2✔
94
      { "ALWAYS", Input::ALWAYS }
2✔
95
    });
96

97
    state.new_enum<Keyboard::Key>("Keyboard", {
2✔
98
      { "A", Keyboard::A },
2✔
99
      { "B", Keyboard::B },
2✔
100
      { "C", Keyboard::C },
2✔
101
      { "D", Keyboard::D },
2✔
102
      { "E", Keyboard::E },
2✔
103
      { "F", Keyboard::F },
2✔
104
      { "G", Keyboard::G },
2✔
105
      { "H", Keyboard::H },
2✔
106
      { "I", Keyboard::I },
2✔
107
      { "J", Keyboard::J },
2✔
108
      { "K", Keyboard::K },
2✔
109
      { "L", Keyboard::L },
2✔
110
      { "M", Keyboard::M },
2✔
111
      { "N", Keyboard::N },
2✔
112
      { "O", Keyboard::O },
2✔
113
      { "P", Keyboard::P },
2✔
114
      { "Q", Keyboard::Q },
2✔
115
      { "R", Keyboard::R },
2✔
116
      { "S", Keyboard::S },
2✔
117
      { "T", Keyboard::T },
2✔
118
      { "U", Keyboard::U },
2✔
119
      { "V", Keyboard::V },
2✔
120
      { "W", Keyboard::W },
2✔
121
      { "X", Keyboard::X },
2✔
122
      { "Y", Keyboard::Y },
2✔
123
      { "Z", Keyboard::Z },
2✔
124

125
      { "F1",  Keyboard::F1 },
2✔
126
      { "F2",  Keyboard::F2 },
2✔
127
      { "F3",  Keyboard::F3 },
2✔
128
      { "F4",  Keyboard::F4 },
2✔
129
      { "F5",  Keyboard::F5 },
2✔
130
      { "F6",  Keyboard::F6 },
2✔
131
      { "F7",  Keyboard::F7 },
2✔
132
      { "F8",  Keyboard::F8 },
2✔
133
      { "F9",  Keyboard::F9 },
2✔
134
      { "F10", Keyboard::F10 },
2✔
135
      { "F11", Keyboard::F11 },
2✔
136
      { "F12", Keyboard::F12 },
2✔
137

138
      { "UP",    Keyboard::UP },
2✔
139
      { "DOWN",  Keyboard::DOWN },
2✔
140
      { "RIGHT", Keyboard::RIGHT },
2✔
141
      { "LEFT",  Keyboard::LEFT },
2✔
142

143
      { "NUMLOCK",   Keyboard::NUMLOCK },
2✔
144
      { "NUM0",      Keyboard::NUM0 },
2✔
145
      { "NUM1",      Keyboard::NUM1 },
2✔
146
      { "NUM2",      Keyboard::NUM2 },
2✔
147
      { "NUM3",      Keyboard::NUM3 },
2✔
148
      { "NUM4",      Keyboard::NUM4 },
2✔
149
      { "NUM5",      Keyboard::NUM5 },
2✔
150
      { "NUM6",      Keyboard::NUM6 },
2✔
151
      { "NUM7",      Keyboard::NUM7 },
2✔
152
      { "NUM8",      Keyboard::NUM8 },
2✔
153
      { "NUM9",      Keyboard::NUM9 },
2✔
154
      { "DECIMAL",   Keyboard::DECIMAL },
2✔
155
      { "DIVIDE",    Keyboard::DIVIDE },
2✔
156
      { "MULTIPLY",  Keyboard::MULTIPLY },
2✔
157
      { "SUBSTRACT", Keyboard::SUBSTRACT },
2✔
158
      { "ADD",       Keyboard::ADD },
2✔
159

160
      { "LEFT_SHIFT",  Keyboard::LEFT_SHIFT },
2✔
161
      { "RIGHT_SHIFT", Keyboard::RIGHT_SHIFT },
2✔
162
      { "LEFT_CTRL",   Keyboard::LEFT_CTRL },
2✔
163
      { "RIGHT_CTRL",  Keyboard::RIGHT_CTRL },
2✔
164
      { "LEFT_ALT",    Keyboard::LEFT_ALT },
2✔
165
      { "RIGHT_ALT",   Keyboard::RIGHT_ALT },
2✔
166

167
      { "HOME",         Keyboard::HOME },
2✔
168
      { "END",          Keyboard::END },
2✔
169
      { "PAGEUP",       Keyboard::PAGEUP },
2✔
170
      { "PAGEDOWN",     Keyboard::PAGEDOWN },
2✔
171
      { "CAPSLOCK",     Keyboard::CAPSLOCK },
2✔
172
      { "SPACE",        Keyboard::SPACE },
2✔
173
      { "BACKSPACE",    Keyboard::BACKSPACE },
2✔
174
      { "INSERT",       Keyboard::INSERT },
2✔
175
      { "ESCAPE",       Keyboard::ESCAPE },
2✔
176
      { "PRINT_SCREEN", Keyboard::PRINT_SCREEN },
2✔
177
      { "PAUSE",        Keyboard::PAUSE }
2✔
178
    });
179

180
    state.new_enum<Mouse::Button>("Mouse", {
2✔
181
      { "LEFT_CLICK",   Mouse::LEFT_CLICK },
2✔
182
      { "RIGHT_CLICK",  Mouse::RIGHT_CLICK },
2✔
183
      { "MIDDLE_CLICK", Mouse::MIDDLE_CLICK }
2✔
184
    });
185
  }
2✔
186
}
2✔
187

188
} // namespace Raz
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc