From 766c3d68fd9cb26c4de54bf2377228fea998edf4 Mon Sep 17 00:00:00 2001 From: Hartmut Seichter Date: Sat, 1 Jul 2023 23:00:22 +0200 Subject: [PATCH] some clean up --- README.md | 16 ++++++++++++++-- src/lib/src/shader.cpp | 7 +++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6060d9a..1db15bb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ParadisSO - a minimal 2D graphics engine -**ParadiSO** was conceived as a heavily stripped down version of my pixwerx engine. It is a minimalistic 2D graphics engine for educational purposes. It uses modern C++ and a datadriven design, but no ECS. +**ParadiSO** was conceived as a heavily stripped down 2D version of my `pixwerx` engine. *ParadiSO* mimics a minimalistic approach to 2D graphics for educational purposes. It uses modern C++ and a data-driven design, but no ECS. ## Educational @@ -10,4 +10,16 @@ Some arguments for its educational side: * heavily inspired by Rust code * math code is eager evaluation but `constexpr` to compensate overheads * hides old-style `C` APIs behind a renovated facade -* it leans heavily on the STL and its algorithms \ No newline at end of file +* it leans heavily on the STL and its algorithms + +## Minimal + +Because this engine should show some patterns and design concepts it tries to avoid adding unnecessary bloat. + +## Dependencies + +ParadiSO comes with batteries included. However, it should be mentioned here: + +* [GLFW 3.3.8](https://github.com/glfw/glfw) +* [GLAD](https://github.com/Dav1dde/glad) + diff --git a/src/lib/src/shader.cpp b/src/lib/src/shader.cpp index 7ed3fa5..7a6b04e 100644 --- a/src/lib/src/shader.cpp +++ b/src/lib/src/shader.cpp @@ -148,14 +148,17 @@ struct Shader::impl { // potentially the GL driver hasn't been loaded if (is_valid()) { - // deleting and detaching should happen much earlier + // detach first + for (auto s : _shader_stages) { + glDetachShader(_shader_program, s); + } + // deleting for (auto s : _shader_stages) { glDeleteShader(s); } // only program needs to be deleted - glDeleteProgram(_shader_program); } }