diff --git a/src/nostalgia/glutils/CMakeLists.txt b/src/nostalgia/glutils/CMakeLists.txt index 3b236f50..7f7f15f6 100644 --- a/src/nostalgia/glutils/CMakeLists.txt +++ b/src/nostalgia/glutils/CMakeLists.txt @@ -12,11 +12,12 @@ if(APPLE) else() set(OPENGL_gl_LIBRARY GL) endif() +find_package(glad REQUIRED) target_link_libraries( NostalgiaGlUtils PUBLIC OxStd - ${OPENGL_gl_LIBRARY} + glad::glad ) install( diff --git a/src/nostalgia/glutils/glutils.cpp b/src/nostalgia/glutils/glutils.cpp index c9950cc5..b17e4dad 100644 --- a/src/nostalgia/glutils/glutils.cpp +++ b/src/nostalgia/glutils/glutils.cpp @@ -30,13 +30,21 @@ void deleteVertexArray(GLuint v) noexcept { glDeleteVertexArrays(1, &v); } +void deleteProgram(GLuint v) noexcept { + glDeleteProgram(v); +} + +void deleteShader(GLuint v) noexcept { + glDeleteShader(v); +} + template struct GLObject; template struct GLObject; template struct GLObject; template struct GLObject; template struct GLObject; -template struct GLObject; -template struct GLObject; +template struct GLObject; +template struct GLObject; [[nodiscard]] static ox::Result buildShader(GLuint shaderType, const GLchar *src, const char *shaderName) noexcept { diff --git a/src/nostalgia/glutils/glutils.hpp b/src/nostalgia/glutils/glutils.hpp index d39a827c..ee142542 100644 --- a/src/nostalgia/glutils/glutils.hpp +++ b/src/nostalgia/glutils/glutils.hpp @@ -13,7 +13,8 @@ #endif #include #else -#include +#include +#include #endif #include @@ -102,20 +103,22 @@ void deleteFrameBuffer(GLuint b) noexcept; void deleteRenderBuffer(GLuint b) noexcept; void deleteTexture(GLuint t) noexcept; void deleteVertexArray(GLuint v) noexcept; +void deleteProgram(GLuint p) noexcept; +void deleteShader(GLuint s) noexcept; extern template struct GLObject; extern template struct GLObject; extern template struct GLObject; extern template struct GLObject; extern template struct GLObject; -extern template struct GLObject; -extern template struct GLObject; +extern template struct GLObject; +extern template struct GLObject; using GLBuffer = GLObject; using GLFrameBuffer = GLObject; using GLRenderBuffer = GLObject; -using GLShader = GLObject; -using GLProgram = GLObject; +using GLShader = GLObject; +using GLProgram = GLObject; using GLTexture = GLObject; using GLVertexArray = GLObject; diff --git a/src/nostalgia/studio/filedialogmanager.hpp b/src/nostalgia/studio/filedialogmanager.hpp index fdc9405f..68c77fe0 100644 --- a/src/nostalgia/studio/filedialogmanager.hpp +++ b/src/nostalgia/studio/filedialogmanager.hpp @@ -27,7 +27,9 @@ class FileDialogManager : public nostalgia::studio::Task { FileDialogManager() noexcept = default; template - explicit FileDialogManager(Args ...args) noexcept; + explicit FileDialogManager(Args ...args) noexcept { + pathChosen.connect(args...); + } ~FileDialogManager() noexcept override = default; @@ -38,9 +40,4 @@ class FileDialogManager : public nostalgia::studio::Task { }; -template -FileDialogManager::FileDialogManager(Args ...args) noexcept { - pathChosen.connect(args...); -} - } \ No newline at end of file