]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/widget.cpp
Clear focus in Panel if focused child is removed
[libs/gltk.git] / source / widget.cpp
index be1f0a0cc90fb981bc0ea1a121e3f3f92d95030e..efb6155ef4a51d8fb4e69bde95323ea4e10c250d 100644 (file)
@@ -5,6 +5,7 @@ Copyright © 2007  Mikko Rasa, Mikkosoft Productions
 Distributed under the LGPL
 */
 
+#include <msp/gl/immediate.h>
 #include <msp/gl/matrix.h>
 #include <msp/gl/transform.h>
 #include <msp/strings/formatter.h>
@@ -108,9 +109,9 @@ void Widget::render_text(const Part &part, const string &text) const
        GL::scale_uniform(font_size);
 
        const GL::Color &color=style->get_font_color();
-       glColor3f(color.r, color.g, color.b);
-       font->draw_string(text);
-       glColor3f(1, 1, 1);
+       GL::Immediate imm((GL::COLOR4_UBYTE, GL::TEXCOORD2, GL::VERTEX2));
+       imm.color(color.r, color.g, color.b);
+       font->draw_string(text, imm);
 
        GL::pop_matrix();
 }