12 #include <GLFW/glfw3.h>
22 #pragma clang diagnostic push
23 #pragma clang diagnostic ignored "-Wpadded"
29 :
GLFW(
"Volume Visualizer", VOLVIZ_DEFAULT_WINDOW_WIDTH,
30 VOLVIZ_DEFAULT_WINDOW_HEIGHT) {}
52 inline operator
bool() const noexcept {
53 return !glfwWindowShouldClose(
window);
58 inline void waitEvents() const noexcept { glfwWaitEvents(); }
60 inline void pollEvents() const noexcept { glfwPollEvents(); }
69 std::size_t
width() const noexcept;
71 std::
size_t height() const noexcept;
88 #pragma clang diagnostic pop
94 #endif // VolViz_GLFW_h
void hide() noexcept
Hides the current window.
Definition: GLFW.cpp:111
GLsizei const GLchar *const * string
Definition: glad.h:2514
std::function< void(double, double)> mouseMoveCallback
mouse move callback
Definition: GLFW.h:82
void detachContext() noexcept
Detaches the context from the current thread.
Definition: GLFW.cpp:121
GLuint const GLchar * name
Definition: glad.h:2430
void show() noexcept
Unhides the current window.
Definition: GLFW.cpp:113
GLint GLsizei width
Definition: glad.h:2100
GLint GLsizei GLsizei height
Definition: glad.h:2100
std::size_t width() const noexcept
Returns the width of the window.
Definition: GLFW.cpp:123
void pollEvents() const noexcept
Definition: GLFW.h:60
void swapBuffers() const noexcept
Definition: GLFW.h:56
void waitEvents() const noexcept
Definition: GLFW.h:58
std::vector< std::string > supportedExtensions_
Definition: GLFW.h:86
std::function< void(int, int, int, int)> keyInputHandler
keyboard input handler
Definition: GLFW.h:74
bool isHidden() const noexcept
Returns true if the window is hidden.
Definition: GLFW.cpp:115
bool supportsExtension(std::string name) const noexcept
Definition: GLFW.cpp:137
GLFWwindow * window
Definition: GLFW.h:85
std::function< void(int, int, int)> mouseButtonCallback
mouse button callback
Definition: GLFW.h:80
GLFW()
Crates a GLFW context associated with a hidden window.
Definition: GLFW.h:28
void makeCurrent() noexcept
Makes the window's conext current.
Definition: GLFW.cpp:119
RAII wrapper for GLFW.
Definition: GLFW.h:25
std::function< void(double, double)> scrollWheelInputHandler
scroll wheel input handler
Definition: GLFW.h:78
~GLFW()
Definition: GLFW.cpp:106
std::function< void(std::size_t, std::size_t)> windowResizeCallback
window resize callback
Definition: GLFW.h:76
decltype(auto) supportedExtensions() const noexcept
Definition: GLFW.h:64