source: GTP/trunk/App/Demos/Vis/CHC_revisited/Texture.h @ 2757

Revision 2757, 1016 bytes checked in by mattausch, 16 years ago (diff)

loading textured scenes possible

Line 
1#ifndef NO_PRAGMA_ONCE
2#pragma once
3#endif
4
5#ifndef __TEXTURE_H
6#define __TEXTURE_H
7
8#include <string>
9
10namespace CHCDemo
11{
12
13///
14class Texture
15{
16public:
17        /** Constructor loading texture from file
18        */
19        Texture(const std::string &filename);
20        /** Destroys data.
21        */
22        ~Texture();
23        /** Returns image data.
24        */
25        void *GetImage() const;
26       
27        enum { FORMAT_INVALID, FORMAT_RGB, FORMAT_RGBA };
28       
29        /** Returns width of texture.
30        */
31        int GetWidth() const;
32        /** Returns width of texture.
33        */
34        int GetHeight() const;
35        /** Returns texture format. Currently only RGBA supported.
36        */
37        int GetFormat() const;
38        /** Returns name of the texture
39        */
40        std::string GetName() const;
41
42        int GetRowLength() const;
43
44        int GetPixelSize() const;
45       
46        int GetByteSize() const;
47        /** Bind the texture.
48        */
49        void Bind() const;
50
51protected:
52
53        void Create();
54
55        int mFormat;
56        int mWidth;
57        int mHeight;
58
59        unsigned int mTexId;
60
61        std::string mName;
62
63        void *mImage;
64};
65
66}
67
68#endif // __TEXTURE_H
Note: See TracBrowser for help on using the repository browser.