Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 969 vs 970 for /trunk/Source Code/Platform/Video/OpenGL/GLStates.cpp

Diff revisions: vs.
  @@ -60,6 +60,7 @@
60 60 vec4<I32> GL_API::s_activeViewport = vec4<I32>(-1);
61 61 vec4<I32> GL_API::s_previousViewport = vec4<I32>(-1);
62 62 vec4<I32> GL_API::s_activeScissor = vec4<I32>(-1);
63 + vec4<F32> GL_API::s_activeClearColour = DefaultColours::DIVIDE_BLUE;
63 64 GLfloat GL_API::s_depthFarVal = 1.0f;
64 65 bool GL_API::s_primitiveRestartEnabled = false;
65 66 bool GL_API::s_rasterizationEnabled = true;
  @@ -144,14 +145,9 @@
144 145 s_activeViewport.set(-1);
145 146 s_previousViewport.set(-1);
146 147 s_activeScissor.set(-1);
148 + s_activeClearColour.set(DefaultColours::DIVIDE_BLUE);
147 149
148 150 Attorney::GLAPIShaderProgram::unbind();
149 -
150 - glClearColor(DefaultColours::DIVIDE_BLUE.r,
151 - DefaultColours::DIVIDE_BLUE.g,
152 - DefaultColours::DIVIDE_BLUE.b,
153 - DefaultColours::DIVIDE_BLUE.a);
154 -
155 151 }
156 152
157 153 /// Pixel pack alignment is usually changed by textures, PBOs, etc
  @@ -760,6 +756,16 @@
760 756 GL_API::s_previousViewport.w);
761 757 }
762 758
759 + bool GL_API::setClearColour(const vec4<F32>& colour) {
760 + if (colour != GL_API::s_activeClearColour) {
761 + glClearColor(colour.r, colour.g, colour.b, colour.a);
762 + GL_API::s_activeClearColour.set(colour);
763 + return true;
764 + }
765 +
766 + return false;
767 + }
768 +
763 769 bool GL_API::setScissor(I32 x, I32 y, I32 width, I32 height) {
764 770 if (vec4<I32>(x, y, width, height) != GL_API::s_activeScissor) {
765 771 glScissor(x, y, width, height);