]> git.lizzy.rs Git - irrlicht.git/blob - source/Irrlicht/CGUIImageList.h
Merge branch 'opengl3' of https://github.com/numberZero/irrlicht
[irrlicht.git] / source / Irrlicht / CGUIImageList.h
1 // This file is part of the "Irrlicht Engine".\r
2 // written by Reinhard Ostermeier, reinhard@nospam.r-ostermeier.de\r
3 \r
4 #ifndef __C_GUI_IMAGE_LIST_H_INCLUDED__\r
5 #define __C_GUI_IMAGE_LIST_H_INCLUDED__\r
6 \r
7 #include "IGUIImageList.h"\r
8 #include "IVideoDriver.h"\r
9 \r
10 namespace irr\r
11 {\r
12 namespace gui\r
13 {\r
14 \r
15 class CGUIImageList : public IGUIImageList\r
16 {\r
17 public:\r
18 \r
19         //! constructor\r
20         CGUIImageList( video::IVideoDriver* Driver );\r
21 \r
22         //! destructor\r
23         virtual ~CGUIImageList();\r
24 \r
25         //! Creates the image list from texture.\r
26         //! \param texture: The texture to use\r
27         //! \param imageSize: Size of a single image\r
28         //! \param useAlphaChannel: true if the alpha channel from the texture should be used\r
29         //! \return\r
30         //! true if the image list was created\r
31         bool createImageList(video::ITexture* texture,\r
32                                 core::dimension2d<s32> imageSize,\r
33                                 bool useAlphaChannel);\r
34 \r
35         //! Draws an image and clips it to the specified rectangle if wanted\r
36         //! \param index: Index of the image\r
37         //! \param destPos: Position of the image to draw\r
38         //! \param clip: Optional pointer to a rectangle against which the text will be clipped.\r
39         //! If the pointer is null, no clipping will be done.\r
40         virtual void draw( s32 index, const core::position2d<s32>& destPos,\r
41                 const core::rect<s32>* clip = 0 ) override;\r
42 \r
43         //! Returns the count of Images in the list.\r
44         //! \return Returns the count of Images in the list.\r
45         s32 getImageCount() const override\r
46         { return ImageCount; }\r
47 \r
48         //! Returns the size of the images in the list.\r
49         //! \return Returns the size of the images in the list.\r
50         core::dimension2d<s32> getImageSize() const override\r
51         { return ImageSize; }\r
52 \r
53 private:\r
54 \r
55         video::IVideoDriver*            Driver;\r
56         video::ITexture*                        Texture;\r
57         s32                                                     ImageCount;\r
58         core::dimension2d<s32>  ImageSize;\r
59         s32                                                     ImagesPerRow;\r
60         bool                                                    UseAlphaChannel;\r
61 };\r
62 \r
63 } // end namespace gui\r
64 } // end namespace irr\r
65 \r
66 #endif\r
67 \r