]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/graphic.cpp
Clear focus in Panel if focused child is removed
[libs/gltk.git] / source / graphic.cpp
index 01bfcdb6a177db0fc16d8acf04498fcb4db47124..9b613a74bf0a83381f2c7cf02aacf5326844a377 100644 (file)
@@ -1,3 +1,10 @@
+/* $Id$
+
+This file is part of libmspgltk
+Copyright © 2007  Mikko Rasa, Mikkosoft Productions
+Distributed under the LGPL
+*/
+
 #include <msp/gl/immediate.h>
 #include "graphic.h"
 #include "resources.h"
@@ -14,9 +21,6 @@ Graphic::Graphic():
 
 void Graphic::render(unsigned wd, unsigned ht) const
 {
-       GL::VertexArray varr((GL::TEXCOORD2, GL::VERTEX2));
-       RefPtr<GL::VertexArrayBuilder> vab=varr.modify();
-
        vector<float> x, y;
        create_coords(0.0f-shadow.left, wd+shadow.right, border.left, border.right, slice.w-border.left-border.right, x);
        create_coords(0.0f-shadow.bottom, ht+shadow.top, border.bottom, border.top, slice.h-border.bottom-border.top, y);
@@ -31,7 +35,8 @@ void Graphic::render(unsigned wd, unsigned ht) const
        unsigned ymax=y.size()-(border.top ? 2 : 3);
 
        texture->bind();
-       GL::Immediate imm((GL::TEXCOORD2,GL::VERTEX2));
+       GL::Immediate imm((GL::COLOR4_UBYTE, GL::TEXCOORD2, GL::VERTEX2));
+       imm.color(1.0f, 1.0f, 1.0f);
        imm.begin(GL::QUADS);
        for(unsigned i=ymin; i<=ymax; ++i)
        {