X-Git-Url: http://git.tdb.fi/?p=libs%2Fgltk.git;a=blobdiff_plain;f=source%2Fgraphic.h;h=1647d2f811f49704ca3ce9795fdedaef637ebcb9;hp=b93111348175874150190c1666c5d6896d6efe61;hb=c2635c5a3dca6a6cea5562fd387beb0662b18cf0;hpb=a38c924ff32081f5cd67c2b0e2d5ca61f0e99de2 diff --git a/source/graphic.h b/source/graphic.h index b931113..1647d2f 100644 --- a/source/graphic.h +++ b/source/graphic.h @@ -1,3 +1,10 @@ +/* $Id$ + +This file is part of libmspgltk +Copyright © 2007 Mikko Rasa, Mikkosoft Productions +Distributed under the LGPL +*/ + #ifndef MSP_GLTK_GRAPHIC_H_ #define MSP_GLTK_GRAPHIC_H_ @@ -10,6 +17,9 @@ namespace GLtk { class Resources; +/** +Stores a single graphical element. Graphics are used as parts of widgets. +*/ class Graphic { public: @@ -31,6 +41,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; } @@ -39,12 +57,6 @@ public: unsigned get_height() const { return slice.h; } void render(unsigned, unsigned) const; private: - Sides border; - Sides shadow; - const GL::Texture2D *texture; - Geometry slice; - bool repeat; - void create_coords(float, float, float, float, float, std::vector &) const; void create_texcoords(float, float, float, float, float, std::vector &) const; };