Update Ghoul

Adapt to glbindings changes
This commit is contained in:
Alexander Bock
2018-08-29 17:32:53 -04:00
parent aa85c2afb2
commit c287c03fe8
4 changed files with 29 additions and 18 deletions
+25 -15
View File
@@ -76,9 +76,13 @@
#include <ghoul/opengl/texture.h>
#include <ghoul/systemcapabilities/generalcapabilitiescomponent.h>
#include <ghoul/systemcapabilities/openglcapabilitiescomponent.h>
#include <glbinding/callbacks.h>
#include <glbinding/glbinding.h>
#include <numeric>
// @TODO(abock): Replace this with callback in windowdelegate
#define GLFW_INCLUDE_NONE
#include <GLFW/glfw3.h>
#if defined(_MSC_VER) && defined(OPENSPACE_ENABLE_VLD)
#include <vld.h>
#endif
@@ -506,8 +510,8 @@ void OpenSpaceEngine::destroy() {
void OpenSpaceEngine::initialize() {
LTRACE("OpenSpaceEngine::initialize(begin)");
glbinding::Binding::useCurrentContext();
glbinding::Binding::initialize();
//glbinding::Binding::useCurrentContext();
glbinding::Binding::initialize(glfwGetProcAddress);
// clear the screen so the user doesn't have to see old buffer contents left on the
// graphics card
@@ -1080,40 +1084,41 @@ void OpenSpaceEngine::initializeGL() {
case GL_INVALID_ENUM:
LERRORC(
"OpenGL Invalid State",
fmt::format("Function {}: GL_INVALID_ENUM", f.toString())
fmt::format("Function {}: GL_INVALID_ENUM", f.function->name())
);
break;
case GL_INVALID_VALUE:
LERRORC(
"OpenGL Invalid State",
fmt::format("Function {}: GL_INVALID_VALUE", f.toString())
fmt::format("Function {}: GL_INVALID_VALUE", f.function->name())
);
break;
case GL_INVALID_OPERATION:
LERRORC(
"OpenGL Invalid State",
fmt::format("Function {}: GL_INVALID_OPERATION", f.toString())
);
fmt::format(
"Function {}: GL_INVALID_OPERATION", f.function->name()
));
break;
case GL_INVALID_FRAMEBUFFER_OPERATION:
LERRORC(
"OpenGL Invalid State",
fmt::format(
"Function {}: GL_INVALID_FRAMEBUFFER_OPERATION",
f.toString()
f.function->name()
)
);
break;
case GL_OUT_OF_MEMORY:
LERRORC(
"OpenGL Invalid State",
fmt::format("Function {}: GL_OUT_OF_MEMORY", f.toString())
fmt::format("Function {}: GL_OUT_OF_MEMORY", f.function->name())
);
break;
default:
LERRORC(
"OpenGL Invalid State",
fmt::format("Unknown error code: {0:x}", error)
fmt::format("Unknown error code: {0:x}", static_cast<int>(error))
);
}
});
@@ -1135,16 +1140,21 @@ void OpenSpaceEngine::initializeGL() {
call.parameters.begin(),
call.parameters.end(),
std::string("("),
[](std::string a, AbstractValue* v) {
return a + v->asString() + ", ";
[](std::string a, const std::unique_ptr<AbstractValue>& v) {
std::stringstream s;
s << v;
return a + s.str() + ", ";
}
);
// Remove the final ", "
arguments = arguments.substr(0, arguments.size() - 2) + ")";
std::string returnValue = call.returnValue ?
" -> " + call.returnValue->asString() :
"";
std::string returnValue;
std::stringstream s;
if (call.returnValue) {
s << call.returnValue;
returnValue = " -> " + s.str();
}
LTRACEC(
"OpenGL",