Main Page | Class Hierarchy | Class List | Directories | File List | Class Members

CTex.h

00001 #ifndef __CTEX_H__
00002 #define __CTEX_H__ 
00003 
00004 #include <windows.h>
00005 
00011 class CTex
00012 {
00013 public:
00014 
00015         CTex()
00016         {
00017         _dimX = 0; 
00018         _dimY = 0;
00019         _pTex = 0;
00020         _cColourChannels = 4; // RGBA
00021         _uBGTexWidth = 0;
00022         _uBGTexHeight= 0;
00023         _texName = 0;
00024 
00025         }
00026 
00027     CTex(unsigned short dimX, unsigned short dimY)
00028     {
00029         Init(dimX, dimY);
00030     }
00031 
00032         ~CTex()
00033         {
00034         Shutdown();
00035         }
00036 
00041     void Init(unsigned short dimX, unsigned short dimY);
00042 
00048     void Shutdown()
00049     {
00050         _dimX = 0;
00051         _dimY = 0;
00052 
00053         if (_pTex)
00054             delete[] _pTex;
00055 
00056         if (_pBGTex)
00057             delete[] _pBGTex;
00058 
00059         _pTex   = 0;
00060 
00061         _pBGTex = 0;
00062         _uBGTexWidth = 0;
00063         _uBGTexHeight= 0;
00064 
00065 
00066     }
00067 
00068         GLfloat * GetTexPtr() { return _pTex; }
00069 
00070         void GenTexture();
00071 
00072     unsigned short GetDimX()      { return _dimX; }
00073     unsigned short GetDimY()      { return _dimY; }
00074 
00080     void GenerateBackgroundTexture();
00081     void GenerateBackgroundGeometry();
00082     void RenderBackgroundTexture();
00083 
00089     void RenderSubTexture();
00090 
00095     void RenderVolumeSubTexture();
00096 
00097     void DisplaySliceAlong_Y_Axis(unsigned iSliceNum);
00098     void DisplaySliceAlong_Z_Axis(unsigned iSliceNum);
00099     void DisplaySliceAlong_X_Axis(unsigned iSliceNum);
00100 
00101     void LetThereBeBackground(unsigned uWidth, unsigned uHeight);
00102 
00103 private:
00104     unsigned short    _dimX, _dimY, _cColourChannels;
00105     unsigned short    _uBGTexWidth, _uBGTexHeight;
00106     unsigned long     _size;
00107 
00108     unsigned short    _dim_volX, _dim_volY, _dimVolZ;
00109     GLfloat        *  _pTex, * _pBGTex;
00110     GLuint            _texName;
00111 };
00112 
00113 #endif // __CTEX_H__

Generated on Mon Dec 12 15:20:26 2005 for CCube by  doxygen 1.4.1