]> git.tdb.fi Git - libs/gltk.git/blob - source/image.h
Store the Resources reference only in Root widget
[libs/gltk.git] / source / image.h
1 /* $Id$
2
3 This file is part of libmspgltk
4 Copyright © 2007  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_GLTK_IMAGE_H_
9 #define MSP_GLTK_IMAGE_H_
10
11 #include <msp/gl/texture2d.h>
12 #include "widget.h"
13
14 namespace Msp {
15 namespace GLtk {
16
17 /**
18 A widget for displaying images.
19 */
20 class Image: public Widget
21 {
22 private:
23         const GL::Texture2D *image;
24         bool keep_aspect;
25
26 public:
27         Image(const GL::Texture2D * = 0);
28
29         void set_image(const GL::Texture2D *);
30         void set_keep_aspect(bool);
31 private:
32         virtual const char *get_class() const { return "image"; }
33         virtual void render_special(const Part &) const;
34 };
35
36 } // namespace GLtk
37 } // namespace Msp
38
39 #endif