source: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Texture.h @ 2850

Revision 2850, 1.5 KB checked in by mattausch, 16 years ago (diff)

debug version before siggraph

RevLine 
[2757]1#ifndef NO_PRAGMA_ONCE
2#pragma once
3#endif
4
5#ifndef __TEXTURE_H
6#define __TEXTURE_H
7
8#include <string>
9
[2776]10namespace CHCDemoEngine
[2757]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       
[2846]29        enum { CLAMP, REPEAT };
30
[2757]31        /** Returns width of texture.
32        */
33        int GetWidth() const;
34        /** Returns width of texture.
35        */
36        int GetHeight() const;
37        /** Returns texture format. Currently only RGBA supported.
38        */
39        int GetFormat() const;
40        /** Returns name of the texture
41        */
42        std::string GetName() const;
43
44        int GetRowLength() const;
45
46        int GetPixelSize() const;
47       
[2768]48        inline int GetByteSize() const;
[2757]49        /** Bind the texture.
50        */
51        void Bind() const;
52
[2846]53        void SetBoundaryModeS(int mode) { mBoundaryModeS = mode; }
54        void SetBoundaryModeT(int mode) { mBoundaryModeT = mode; }
[2768]55
[2850]56        //void SetUseMipMap(bool useMipMap) { mUseMipMap = useMipMap; }
57
[2846]58        int GetBoundaryModeS() const { return mBoundaryModeS; }
59        int GetBoundaryModeT() const { return mBoundaryModeT; }
[2768]60
[2846]61        /** Creates the texture from the image
62        */
63        void Create();
[2850]64       
[2846]65
66
[2757]67protected:
68
69        int mFormat;
70        int mWidth;
71        int mHeight;
72
73        unsigned int mTexId;
74
[2846]75        int mBoundaryModeS;
76        int mBoundaryModeT;
77
[2757]78        std::string mName;
79
[2768]80        int mByteSize;
[2757]81        void *mImage;
[2850]82
83        bool mUseMipMap;
[2757]84};
85
[2768]86
87inline int Texture::GetByteSize() const
88{
89        return mByteSize;
[2757]90}
91
[2768]92}
93
[2757]94#endif // __TEXTURE_H
Note: See TracBrowser for help on using the repository browser.