]> git.tdb.fi Git - libs/gltk.git/blob - source/image.h
Rearrange members
[libs/gltk.git] / source / image.h
1 /* $Id$
2
3 This file is part of libmspgltk
4 Copyright © 2010-2011  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         virtual const char *get_class() const { return "image"; }
30
31         void set_image(const GL::Texture2D *);
32         void set_keep_aspect(bool);
33
34 private:
35         virtual void render_special(const Part &) const;
36 };
37
38 } // namespace GLtk
39 } // namespace Msp
40
41 #endif