aboutsummaryrefslogtreecommitdiffstats
path: root/src/menu/background_color.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/menu/background_color.cpp32
1 files changed, 4 insertions, 28 deletions
diff --git a/src/menu/background_color.cpp b/src/menu/background_color.cpp
index d0c088fb..f55763b7 100644
--- a/src/menu/background_color.cpp
+++ b/src/menu/background_color.cpp
@@ -27,39 +27,15 @@
namespace usdx
{
- BackgroundColor::BackgroundColor(const DrawableControl &control) :
- Background(control)
+ BackgroundColor::BackgroundColor(const DrawableControl &control)
+ : Background(control), color(0,0,0)
{
- this->color[0] = 0;
- this->color[1] = 0;
- this->color[2] = 0;
- this->color[3] = 0;
- this->color[4] = 0;
- this->color[5] = 0;
- this->color[6] = 0;
- this->color[7] = 0;
- this->color[8] = 0;
- this->color[9] = 0;
- this->color[10] = 0;
- this->color[11] = 0;
}
BackgroundColor::BackgroundColor(const DrawableControl &control,
const RgbColor &color) :
- Background(control)
+ Background(control), color(color)
{
- this->color[0] = color.get_red();
- this->color[1] = color.get_green();
- this->color[2] = color.get_blue();
- this->color[3] = color.get_red();
- this->color[4] = color.get_green();
- this->color[5] = color.get_blue();
- this->color[6] = color.get_red();
- this->color[7] = color.get_green();
- this->color[8] = color.get_blue();
- this->color[9] = color.get_red();
- this->color[10] = color.get_green();
- this->color[11] = color.get_blue();
}
void BackgroundColor::draw()
@@ -77,7 +53,7 @@ namespace usdx
glEnableClientState(GL_COLOR_ARRAY);
glVertexPointer(2, GL_INT, 0, vertices);
- glColorPointer(3, GL_UNSIGNED_BYTE, 0, color);
+ glColorPointer(3, GL_UNSIGNED_BYTE, 0, color.get_array(4));
glDrawArrays(GL_QUADS, 0, 4);