wglad
is a simplified and user-friendly wrapper around glad, designed to streamline OpenGL loading and make it more accessible for developers. With wglad
, integrating GLAD into your project is faster, easier, and more flexible.
- Simplified Integration: Replace complex GLAD setup with a streamlined interface.
- Flexible Usage: Multiple options to integrate WGLAD into your project.
- Enhanced Usability: Intuitive API for OpenGL loading and usage.
- Cross-Platform Compatibility: Works seamlessly on all major platforms.
- Customizable Configurations: Tailor the behavior to fit your project's requirements.
- Language: C/C++
- GLAD: The foundation for OpenGL loading.
- Build Tools: Supports integration with CMake or manual project setups.
- Compilers: msvc / llvm-clang / mingw-gcc
- TODO: intergration with linux (xlib)...
- Clone the repository:
git clone https://github.com/ripcode0/wglad.git cd wglad cmake -S . -B build -DBUILD_EXAMPLE=ON cmake --build build
- Include
wglad
source files in your project. - Ensure you have the necessary
GLAD
files generated from the GLAD Generator.
- Add
wglad
as a submodule to your repository:git submodule add https://github.com/ripcode0/wglad.git <submodule-path>/wglad
- Update your build system to include WGLAD.
- Clone or Submodule
- Link the library to your project:
- For CMake:
add_subdirectory(wglad) target_link_libraries(your_project PRIVATE wglad) or target_link_libraries(your_project PRIVATE wglad::wglad)
- For manual linking, add the
.lib
or.a
file to your linker options.
- For CMake:
-
Include
wglad
in your project:#include "<wglad/wglad.h>
-
Initialize
wglad
in your OpenGL application:HDC dc{}; HGLRC rc{}; wglad::create_context_from_hwnd(hwnd, &rc, &dc, true);
-
Render process:
glClearColor(0.2f, 0.25f, 0.3f, 1.f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //render contents ::SwapBuffers(dc);
-
Discard
wglad
context:wglad::release_context(hwnd, &rc, &dc);
We welcome contributions to improve WGLAD:
- Fork this repository.
- Create a branch:
git checkout -b feature-name
. - Commit your changes:
git commit -m "Add feature XYZ"
. - Push the branch:
git push origin feature-name
. - Submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
If WGLAD makes your OpenGL development smoother, give it a ⭐ on GitHub!