@@ -68,16 +68,22 @@ static cae::KeyCode translateKey(const int key)
6868void cae::GLFW::keyCallback (GLFWwindow *window, const int key, int , const int action, int )
6969{
7070 auto *self = static_cast <GLFW *>(glfwGetWindowUserPointer (window));
71- if (self == nullptr ) {
71+ if (self == nullptr )
72+ {
7273 return ;
7374 }
7475
7576 WindowEvent e{};
76- if (action == GLFW_PRESS ) {
77+ if (action == GLFW_PRESS )
78+ {
7779 e.type = WindowEventType::KeyDown;
78- } else if (action == GLFW_RELEASE ) {
80+ }
81+ else if (action == GLFW_RELEASE )
82+ {
7983 e.type = WindowEventType::KeyUp;
80- } else {
84+ }
85+ else
86+ {
8187 return ;
8288 }
8389
@@ -88,7 +94,8 @@ void cae::GLFW::keyCallback(GLFWwindow *window, const int key, int, const int ac
8894void cae::GLFW::mouseButtonCallback (GLFWwindow *window, int button, const int action, int )
8995{
9096 auto *self = static_cast <GLFW *>(glfwGetWindowUserPointer (window));
91- if (self == nullptr ) {
97+ if (self == nullptr )
98+ {
9299 return ;
93100 }
94101
@@ -102,7 +109,8 @@ void cae::GLFW::mouseButtonCallback(GLFWwindow *window, int button, const int ac
102109void cae::GLFW::cursorPosCallback (GLFWwindow *window, const double x, const double y)
103110{
104111 auto *self = static_cast <GLFW *>(glfwGetWindowUserPointer (window));
105- if (self == nullptr ) {
112+ if (self == nullptr )
113+ {
106114 return ;
107115 }
108116
@@ -117,7 +125,8 @@ void cae::GLFW::cursorPosCallback(GLFWwindow *window, const double x, const doub
117125void cae::GLFW::scrollCallback (GLFWwindow *window, const double xoffset, const double yoffset)
118126{
119127 auto *self = static_cast <GLFW *>(glfwGetWindowUserPointer (window));
120- if (self == nullptr ) {
128+ if (self == nullptr )
129+ {
121130 return ;
122131 }
123132
@@ -132,12 +141,13 @@ void cae::GLFW::scrollCallback(GLFWwindow *window, const double xoffset, const d
132141void cae::GLFW::frameBufferResizeCallback (GLFWwindow *window, const int width, const int height)
133142{
134143 auto *self = static_cast <GLFW *>(glfwGetWindowUserPointer (window));
135- if (self == nullptr ) {
144+ if (self == nullptr )
145+ {
136146 return ;
137147 }
138148
139149 self->m_frameBufferResized = true ;
140- self->m_frameBufferSize = {.width = static_cast <uint16_t >(width), .height = static_cast <uint16_t >(height)};
150+ self->m_frameBufferSize = {.width = static_cast <uint16_t >(width), .height = static_cast <uint16_t >(height)};
141151
142152 WindowEvent e{};
143153 e.type = WindowEventType::Resize;
@@ -176,7 +186,7 @@ bool cae::GLFW::create(const std::string &name, const WindowSize size)
176186 glfwSetCursorPosCallback (m_window, cursorPosCallback);
177187 glfwSetScrollCallback (m_window, scrollCallback);
178188#ifdef __APPLE__
179- glfwMakeContextCurrent ((GLFWwindow*)m_window);
189+ glfwMakeContextCurrent ((GLFWwindow *)m_window);
180190#endif
181191 return true ;
182192}
@@ -229,7 +239,8 @@ void cae::GLFW::setIcon(const std::string &path) const
229239
230240bool cae::GLFW::pollEvent (WindowEvent &event)
231241{
232- if (m_eventQueue.empty ()) {
242+ if (m_eventQueue.empty ())
243+ {
233244 return false ;
234245 }
235246
0 commit comments