A simple library for learning and experimenting with Graphics APIs, written in C++. For now, supports only OpenGL 4.5.
- Abstractions of OpenGL objects for use under the RAII concept:
- Shader, VertexBuffer, IndexBuffer, Texture2D, CubeMapTexture, etc
- Window abstraction using GLFW3
- Application base class for quick and clean prototyping
- Logging abstraction
- ImGui integration into Application base class
- window abstraction: GLFW3
- OpenGL headers: GLAD
- logging library: SPDLOG
- math library: GLM
- gui library: ImGui
- image loading library: STB
See examples/ directory.
Use '--recursive' when cloning.
Style used: Google C++ Style
Example of an app that uses Application as a base class:
#define SGL_USE_IMGUI
#include <SGL/SGL.h>
Class HelloTriangle : public sgl::Application
{
...
protected:
virtual void Start() override {
m_Window->SetWindowSizeCallback(HelloTriangle::OnResize);
}
virtual void Update(float dt) override;
virtual void Render() override {
glClear(GL_COLOR_BUFFER_BIT);
...
}
virtual void OnImGuiRender() override {
ImGui::ShowDemoWindow(&mybool);
}
...
}
Distributed under MIT License Copyright (c) 2022 authors
- Texture support:
- image loading
- Texture2D abstraction
- IndexBuffer abstraction
- TexturedQuad example
- code readability updates
- fixes to make the SGL usable as a library, not just a standalone project
- support for loading binary and text files
- ImGui integration, Application base class updates
- CubeMapTexture abstraction
- Window abstraction using GLFW
- GL function loading using GLAD
- Logging abstraction using SPDLOG, along with custom asserts
- Added GLM as math library
- VertexBuffer abstraction
- VertexArray abstraction
- Shaders abstraction
- Examples:
- HelloTriangle
- VertexBuffers
- other core modules:
- Timer, Timestep
- Application base class