]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/graphic.h
Report non-basic variables in Layout::LinearProgram as having zero value
[libs/gltk.git] / source / graphic.h
index a9722ad97ff3e498187fffae3ff229a4654e66ae..81ad669c717f0a66d1a977825f33212254edbaf1 100644 (file)
@@ -10,6 +10,9 @@ namespace GLtk {
 
 class Resources;
 
+/**
+Stores a single graphical element.  Graphics are used as parts of widgets.
+*/
 class Graphic
 {
 public:
@@ -23,6 +26,7 @@ public:
                typedef Resources Collection;
 
                Loader(Graphic &, Resources &);
+               Graphic &get_object() const { return graph; }
        private:
                void texture(const std::string &);
                void slice(unsigned, unsigned, unsigned, unsigned);
@@ -30,6 +34,14 @@ public:
                void shadow();
        };
 
+private:
+       Sides border;
+       Sides shadow;
+       const GL::Texture2D *texture;
+       Geometry slice;
+       bool repeat;
+
+public:
        Graphic();
        const Sides &get_border() const { return border; }
        const Sides &get_shadow() const { return shadow; }
@@ -38,10 +50,8 @@ public:
        unsigned get_height() const { return slice.h; }
        void render(unsigned, unsigned) const;
 private:
-       Sides border;
-       Sides shadow;
-       const GL::Texture2D *texture;
-       Geometry slice;
+       void create_coords(float, float, float, float, float, std::vector<float> &) const;
+       void create_texcoords(float, float, float, float, float, std::vector<float> &) const;
 };
 
 } // namespace GLtk