Skip to content

Commit

Permalink
Fix Invalid Enum bug. Fix windows compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
mortennobel committed Feb 14, 2018
1 parent 9a682d4 commit afa12b0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/sre/impl/GL.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <vector>

// 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<std::string> listExtension();
Expand Down
7 changes: 6 additions & 1 deletion include/sre/impl/GL.inl
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@
#include <iostream>
#include <sstream>

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"<<std::endl;
break;
case GL_INVALID_VALUE:
Expand Down
3 changes: 2 additions & 1 deletion src/sre/Framebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "sre/impl/GL.hpp"

#include "sre/Log.hpp"
#include <algorithm>

namespace sre{
Framebuffer::FrameBufferBuilder& Framebuffer::FrameBufferBuilder::withTexture(std::shared_ptr<Texture> texture) {
Expand Down Expand Up @@ -205,4 +206,4 @@ namespace sre{

return std::shared_ptr<Framebuffer>(framebuffer);
}
}
}
2 changes: 1 addition & 1 deletion src/sre/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit afa12b0

Please sign in to comment.