Neo  0.5.0
Developer Documentation
TextureRef.h
Go to the documentation of this file.
1 //========================================================================
2 // Copyright (c) 2003-2011 Anael Seghezzi <www.maratis3d.com>
3 //
4 // This software is provided 'as-is', without any express or implied
5 // warranty. In no event will the authors be held liable for any damages
6 // arising from the use of this software.
7 //
8 // Permission is granted to anyone to use this software for any purpose,
9 // including commercial applications, and to alter it and redistribute it
10 // freely, subject to the following restrictions:
11 //
12 // 1. The origin of this software must not be misrepresented; you must not
13 // claim that you wrote the original software. If you use this software
14 // in a product, an acknowledgment in the product documentation would
15 // be appreciated but is not required.
16 //
17 // 2. Altered source versions must be plainly marked as such, and must not
18 // be misrepresented as being the original software.
19 //
20 // 3. This notice may not be removed or altered from any source
21 // distribution.
22 //
23 //========================================================================
24 
25 
26 #ifndef __TEXTURE_REF_H
27 #define __TEXTURE_REF_H
28 
29 namespace Neo
30 {
31 // Texture ref
32 class NEO_ENGINE_EXPORT TextureRef : public DataRef
33 {
34 private:
35 
36  // data
37  bool m_mipmap;
38  unsigned int m_components;
39  unsigned int m_width;
40  unsigned int m_height;
41  unsigned int m_textureId;
42 
43 public:
44 
45  // constructor / destructor
46  TextureRef(unsigned int textureId, const char * filename, bool mipmap);
47  ~TextureRef(void);
48 
49  // clear / destroy
50  void clear(void);
51  void destroy(void);
52 
53  // get new
54  static TextureRef * getNew(unsigned int textureId, const char * filename, bool mipmap);
55 
56 public:
57 
58  // update
59  void update(void);
60 
61  // type
62  int getType(void){ return M_REF_TEXTURE; }
63 
64  // data
65  inline bool isMipmapEnabled(void){ return m_mipmap; }
66  inline unsigned int getComponents(void){ return m_components; }
67  inline unsigned int getWidth(void){ return m_width; }
68  inline unsigned int getHeight(void){ return m_height; }
69  inline void setWidth(unsigned int width){ m_width = width; }
70  inline void setHeight(unsigned int height){ m_height = height; }
71  inline void setTextureId(unsigned int textureId){ m_textureId = textureId; }
72  inline unsigned int getTextureId(void){ return m_textureId; }
73 };
74 }
75 #endif
unsigned int getHeight(void)
Definition: TextureRef.h:68
void setWidth(unsigned int width)
Definition: TextureRef.h:69
void setHeight(unsigned int height)
Definition: TextureRef.h:70
Definition: DataManager.h:32
bool isMipmapEnabled(void)
Definition: TextureRef.h:65
int getType(void)
Definition: TextureRef.h:62
unsigned int getComponents(void)
Definition: TextureRef.h:66
unsigned int getTextureId(void)
Definition: TextureRef.h:72
void setTextureId(unsigned int textureId)
Definition: TextureRef.h:71
Definition: TextureRef.h:32
Definition: Color.h:29
unsigned int getWidth(void)
Definition: TextureRef.h:67