summaryrefslogtreecommitdiff
path: root/helpers
diff options
context:
space:
mode:
authorJose Fonseca <jfonseca@vmware.com>2015-05-28 15:55:33 +0100
committerJose Fonseca <jfonseca@vmware.com>2015-05-29 16:22:54 +0100
commit4a697ec692aa762eb8cdb7812f5a051c5870020f (patch)
tree8c8a7eab61c46ea42a55391cd9695e47a631a163 /helpers
parent04c307a8a8439adf38c0f14d065275f571a7b486 (diff)
egltrace: Warn instead of assert on GL API mismatch.
Some OpenGL ES implementions end up being just a thin veil on top of desktop OpenGL. Fixes #341.
Diffstat (limited to 'helpers')
-rw-r--r--helpers/glprofile.cpp13
-rw-r--r--helpers/glprofile.hpp3
2 files changed, 15 insertions, 1 deletions
diff --git a/helpers/glprofile.cpp b/helpers/glprofile.cpp
index 8004add4..5520c032 100644
--- a/helpers/glprofile.cpp
+++ b/helpers/glprofile.cpp
@@ -28,6 +28,8 @@
#include <assert.h>
+#include <sstream>
+
#include "os.hpp"
#include "glproc.hpp"
@@ -77,6 +79,15 @@ Profile::matches(const Profile expected) const
}
+std::string
+Profile::str(void) const
+{
+ std::stringstream ss;
+ ss << *this;
+ return ss.str();
+}
+
+
std::ostream &
operator << (std::ostream &os, const Profile & profile) {
os << "OpenGL";
@@ -213,7 +224,7 @@ getCurrentContextProfile(void)
const char *version = (const char *)_glGetString(GL_VERSION);
if (!version) {
- os::log("warning: null GL_VERSION\n");
+ os::log("apitrace: warning: got null GL_VERSION\n");
return profile;
}
diff --git a/helpers/glprofile.hpp b/helpers/glprofile.hpp
index 554294fb..be2a111f 100644
--- a/helpers/glprofile.hpp
+++ b/helpers/glprofile.hpp
@@ -106,6 +106,9 @@ struct Profile {
core < other.core ||
forwardCompatible < other.forwardCompatible;
}
+
+ std::string
+ str(void) const;
};