|
@@ -57,6 +57,13 @@ void OpenGL::initContext()
|
|
|
state.color.b = glcolor[2] * 255;
|
|
|
state.color.a = glcolor[3] * 255;
|
|
|
|
|
|
+ // Same with the current clear color.
|
|
|
+ glGetFloatv(GL_COLOR_CLEAR_VALUE, glcolor);
|
|
|
+ state.clearColor.r = glcolor[0] * 255;
|
|
|
+ state.clearColor.g = glcolor[1] * 255;
|
|
|
+ state.clearColor.b = glcolor[2] * 255;
|
|
|
+ state.clearColor.a = glcolor[3] * 255;
|
|
|
+
|
|
|
// Initialize multiple texture unit support for shaders, if available.
|
|
|
state.textureUnits.clear();
|
|
|
if (Shader::isSupported())
|
|
@@ -164,11 +171,22 @@ void OpenGL::setColor(const Color &c)
|
|
|
state.color = c;
|
|
|
}
|
|
|
|
|
|
-Color OpenGL::getColor()
|
|
|
+Color OpenGL::getColor() const
|
|
|
{
|
|
|
return state.color;
|
|
|
}
|
|
|
|
|
|
+void OpenGL::setClearColor(const Color &c)
|
|
|
+{
|
|
|
+ glClearColor(c.r / 255.0f, c.g / 255.0f, c.b / 255.0f, c.a / 255.0f);
|
|
|
+ state.clearColor = c;
|
|
|
+}
|
|
|
+
|
|
|
+Color OpenGL::getClearColor() const
|
|
|
+{
|
|
|
+ return state.clearColor;
|
|
|
+}
|
|
|
+
|
|
|
void OpenGL::setActiveTextureUnit(int textureunit)
|
|
|
{
|
|
|
if (textureunit < 0 || (size_t) textureunit >= state.textureUnits.size())
|