A thin, modern, header-only C++17 wrapper for GLFW providing RAII objects, scoped enums, and exceptions.
GLFWPP is a C++ wrapper for the GLFW library, which is used for creating windows, contexts, and handling input for graphics applications using OpenGL, OpenGL ES, or Vulkan. It provides a modern, object-oriented interface with RAII resource management, scoped enums, and exception-based error handling, solving the problem of manually managing GLFW's C-style API in C++ projects.
C++ developers building cross-platform graphics applications, games, or simulations who want a safer and more modern interface to GLFW without sacrificing performance or compatibility.
Developers choose GLFWPP because it offers the safety and convenience of modern C++ features like RAII and exceptions while being a thin wrapper that closely mirrors the original GLFW API, ensuring low overhead and easy porting of existing GLFW code.
GLFW C++ Wrapper - thin, modern, C++17, header-only GLFW wrapper
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automatic cleanup of GLFW resources like windows and monitors through destructors, preventing memory leaks and simplifying code.
Scoped enums replace GLFW macros, catching invalid enum errors during compilation and reducing runtime bugs.
Uses exceptions for GLFW errors, eliminating manual error code checks and making error handling more intuitive in C++.
Closely mirrors GLFW's naming and functionality, allowing easy porting of existing code and use of official documentation.
Easy to add to projects without building a separate library, as it's header-only and integrates seamlessly with CMake.
The glfw::Event class uses std::function, which can introduce performance penalties for high-frequency callbacks, as noted in the README.
Forces exception-based error handling, which may not fit projects that disable exceptions or prefer error codes for control flow.
Mixing GLFWPP with raw GLFW calls requires careful management of callbacks and resource ownership, adding potential bugs.