From afa12b02f7704df5f2741355108091393aad49b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Nobel-J=C3=B8rgensen?= Date: Wed, 14 Feb 2018 10:54:57 +0100 Subject: [PATCH] Fix Invalid Enum bug. Fix windows compilation --- include/sre/impl/GL.hpp | 2 +- include/sre/impl/GL.inl | 7 ++++++- src/sre/Framebuffer.cpp | 3 ++- src/sre/Renderer.cpp | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/include/sre/impl/GL.hpp b/include/sre/impl/GL.hpp index a2b510c8..291cdd5d 100755 --- a/include/sre/impl/GL.hpp +++ b/include/sre/impl/GL.hpp @@ -23,7 +23,7 @@ #include // For internal debugging of gl errors -inline void checkGLError(); +inline void checkGLError(const char* title = nullptr); inline bool hasExtension(std::string extensionName); inline std::vector listExtension(); diff --git a/include/sre/impl/GL.inl b/include/sre/impl/GL.inl index 5ca27f26..0688806a 100755 --- a/include/sre/impl/GL.inl +++ b/include/sre/impl/GL.inl @@ -8,12 +8,17 @@ #include #include -void checkGLError() { +void checkGLError(const char* title) { for(GLenum err; (err = glGetError()) != GL_NO_ERROR;) { + if (err != GL_NONE) + { + if (title) std::cerr << title << std::endl; + } //Process/log the error. switch (err){ case GL_INVALID_ENUM: + std::cerr << "GL_INVALID_ENUM"< namespace sre{ Framebuffer::FrameBufferBuilder& Framebuffer::FrameBufferBuilder::withTexture(std::shared_ptr texture) { @@ -205,4 +206,4 @@ namespace sre{ return std::shared_ptr(framebuffer); } -} \ No newline at end of file +} diff --git a/src/sre/Renderer.cpp b/src/sre/Renderer.cpp index d218aacc..82e50707 100755 --- a/src/sre/Renderer.cpp +++ b/src/sre/Renderer.cpp @@ -83,7 +83,7 @@ namespace sre { #ifndef GL_POINT_SPRITE #define GL_POINT_SPRITE 0x8861 #endif // !GL_POINT_SPRITE - if (renderInfo.graphicsAPIVersion.find_first_of("3.1") == 0){ + if (renderInfo.graphicsAPIVersion.find("3.1") == 0){ glEnable(GL_POINT_SPRITE); }