summaryrefslogtreecommitdiff
path: root/retrace
diff options
context:
space:
mode:
authorMark Janes <mark.a.janes@intel.com>2017-11-02 13:53:19 -0700
committerMark Janes <mark.a.janes@intel.com>2017-11-27 11:29:21 -0800
commit718cdc66dd273fc1ccad765d378cdbccc8da1f65 (patch)
tree79975f8c6a3045c24435c43684f518746be8f123 /retrace
parentfb8ca898d8d47012d46a278c5d39e3010590af1e (diff)
State: Enable glClearColor
Diffstat (limited to 'retrace')
-rw-r--r--retrace/daemon/glframe_state_enums.cpp1
-rw-r--r--retrace/daemon/glframe_state_override.cpp19
2 files changed, 20 insertions, 0 deletions
diff --git a/retrace/daemon/glframe_state_enums.cpp b/retrace/daemon/glframe_state_enums.cpp
index 32d50706..ec0316d7 100644
--- a/retrace/daemon/glframe_state_enums.cpp
+++ b/retrace/daemon/glframe_state_enums.cpp
@@ -48,6 +48,7 @@ glretrace::state_name_to_enum(const std::string &value) {
{"GL_BLEND_SRC", GL_BLEND_SRC},
{"GL_BLEND_SRC_ALPHA", GL_BLEND_SRC_ALPHA},
{"GL_BLEND_SRC_RGB", GL_BLEND_SRC_RGB},
+ {"GL_COLOR_CLEAR_VALUE", GL_COLOR_CLEAR_VALUE},
{"GL_CONSTANT_ALPHA", GL_CONSTANT_ALPHA},
{"GL_CONSTANT_COLOR", GL_CONSTANT_COLOR},
{"GL_CULL_FACE", GL_CULL_FACE},
diff --git a/retrace/daemon/glframe_state_override.cpp b/retrace/daemon/glframe_state_override.cpp
index 0af7f4d6..814ece38 100644
--- a/retrace/daemon/glframe_state_override.cpp
+++ b/retrace/daemon/glframe_state_override.cpp
@@ -93,6 +93,7 @@ StateOverride::getState(const StateKey &item,
break;
}
case GL_BLEND_COLOR:
+ case GL_COLOR_CLEAR_VALUE:
case GL_LINE_WIDTH: {
get_float_state(n, data);
break;
@@ -218,6 +219,17 @@ StateOverride::enact_state(const KeyMap &m) const {
assert(GL::GetError() == GL_NO_ERROR);
break;
}
+ case GL_COLOR_CLEAR_VALUE: {
+ std::vector<float> f(4);
+ IntFloat u;
+ for (int j = 0; j < 4; ++j) {
+ u.i = i.second[j];
+ f[j] = u.f;
+ }
+ GlFunctions::ClearColor(f[0], f[1], f[2], f[3]);
+ assert(GL::GetError() == GL_NO_ERROR);
+ break;
+ }
case GL_LINE_WIDTH: {
// assert(i.second.size() == 1);
IntFloat u;
@@ -343,4 +355,11 @@ StateOverride::onState(SelectionId selId,
callback->onState(selId, experimentCount, renderId,
k, {state_enum_to_name(data[0])});
}
+ {
+ StateKey k("Rendering", "Clear State", "GL_COLOR_CLEAR_VALUE");
+ getState(k, &data);
+ std::vector<std::string> color;
+ floatStrings(data, &color);
+ callback->onState(selId, experimentCount, renderId, k, color);
+ }
}