A lightweight, modular 2D/3D graphics engine built with C++20 and OpenGL. This project serves as a sandbox for exploring computer graphics, featuring a custom abstraction layer over OpenGL and real-time debugging capabilities.
- Abstraction Layer: Clean wrappers for OpenGL objects (Vertex Arrays, Buffers, Shaders).
- Camera System: Fully functional 3D camera with mouse and keyboard input handling.
- Lighting: Basic lighting implementation with support for object materials and light source visualization.
- UI Integration: Real-time parameter tuning using ImGui.
- Modern C++: Built using C++20 standards.
- Graphics API: OpenGL 4.5, GLSL 330
- Windowing & Input: GLFW
- OpenGL Loader: GLAD
- Mathematics: GLM
- GUI: ImGui
- Build System: CMake
- A C++20 compatible compiler (e.g., MSVC 2019+, GCC 10+, or Clang 10+).
- CMake 3.16 or higher.
-
Clone the repository:
git clone https://github.com/Pekos123/CppOpenGL.git cd CppOpenGL -
Create a build directory and configure:
mkdir build cd build cmake .. -
Build the project:
- Windows:
cmake --build .
- Windows:
After building, you can run the sandbox executable located in the build output directory.
Note: Currently, the sandbox expects shaders to be located relative to the executable path. Ensure the
engine/shadersdirectory is accessible.
engine/: Core engine library containing the abstraction layer.include/: Header files for the engine.src/: Implementation of engine components.shaders/: Default GLSL shader files.
sandbox/: A demo application demonstrating engine usage.external/: Third-party dependencies (GLFW, GLM, GLAD, ImGui).
- W/A/S/D: Move the camera.
- Mouse: Rotate the camera view.
- ImGui Windows: Adjust object colors, light position, and camera sensitivity in real-time.
This project is open-source and available under the MIT License.