]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/graphic.h
Remove dead code from Panel::Child
[libs/gltk.git] / source / graphic.h
index b93111348175874150190c1666c5d6896d6efe61..f457d3690b297a91d989dc92ed9ce5fa634268d4 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef MSP_GLTK_GRAPHIC_H_
 #define MSP_GLTK_GRAPHIC_H_
 
+#include <msp/gl/primitivebuilder.h>
 #include <msp/gl/texture2d.h>
 #include <msp/datafile/loader.h>
 #include "geometry.h"
@@ -10,6 +11,9 @@ namespace GLtk {
 
 class Resources;
 
+/**
+Stores a single graphical element.  Graphics are used as parts of widgets.
+*/
 class Graphic
 {
 public:
@@ -31,13 +35,6 @@ public:
                void shadow();
        };
 
-       Graphic();
-       const Sides &get_border() const { return border; }
-       const Sides &get_shadow() const { return shadow; }
-       const GL::Texture2D *get_texture() const { return texture; }
-       unsigned get_width() const  { return slice.w; }
-       unsigned get_height() const { return slice.h; }
-       void render(unsigned, unsigned) const;
 private:
        Sides border;
        Sides shadow;
@@ -45,6 +42,15 @@ private:
        Geometry slice;
        bool repeat;
 
+public:
+       Graphic();
+       const Sides &get_border() const { return border; }
+       const Sides &get_shadow() const { return shadow; }
+       const GL::Texture2D *get_texture() const { return texture; }
+       unsigned get_width() const  { return slice.w; }
+       unsigned get_height() const { return slice.h; }
+       void build(unsigned, unsigned, GL::PrimitiveBuilder &) const;
+private:
        void create_coords(float, float, float, float, float, std::vector<float> &) const;
        void create_texcoords(float, float, float, float, float, std::vector<float> &) const;
 };