OGRE  1.9
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreGLTexture.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4  (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2014 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 
29 #ifndef __GLTEXTURE_H__
30 #define __GLTEXTURE_H__
31 
32 #include "OgreGLPrerequisites.h"
33 #include "OgrePlatform.h"
34 #include "OgreRenderTexture.h"
35 #include "OgreTexture.h"
36 #include "OgreGLSupport.h"
38 
39 namespace Ogre {
40 
42  {
43  public:
44  // Constructor
45  GLTexture(ResourceManager* creator, const String& name, ResourceHandle handle,
46  const String& group, bool isManual, ManualResourceLoader* loader,
47  GLSupport& support);
48 
49  virtual ~GLTexture();
50 
51  void createRenderTexture();
52 
54  HardwarePixelBufferSharedPtr getBuffer(size_t face, size_t mipmap);
55 
57  GLenum getGLTextureTarget(void) const;
58 
59  GLuint getGLID() const
60  {
61  return mTextureID;
62  }
63 
64  void getCustomAttribute(const String& name, void* pData);
65 
66  protected:
68  void createInternalResourcesImpl(void);
70  void prepareImpl(void);
72  void unprepareImpl(void);
74  void loadImpl(void);
76  void freeInternalResourcesImpl(void);
77 
83  void _createSurfaceList();
84 
87 
93 
94 
95  private:
96  GLuint mTextureID;
98 
102  };
103 }
104 
105 #endif // __GLTEXTURE_H__
Interface describing a manual resource loader.
Definition: OgreResource.h:514
LoadedImages mLoadedImages
Vector of images that were pulled from disk by prepareLoad but have yet to be pushed into texture mem...
Definition: OgreGLTexture.h:92
SharedPtr< vector< Image >::type > LoadedImages
Used to hold images between calls to prepare and load.
Definition: OgreGLTexture.h:86
#define _OgreGLExport
GLuint getGLID() const
Definition: OgreGLTexture.h:59
Shared pointer implementation used to share pixel buffers.
unsigned long long int ResourceHandle
Definition: OgreResource.h:41
GLSupport & mGLSupport
Definition: OgreGLTexture.h:97
vector< HardwarePixelBufferSharedPtr >::type SurfaceList
Vector of pointers to subsurfaces.
Defines a generic resource handler.
Reference-counted shared pointer, used for objects where implicit destruction is required.
_StringBase String
SurfaceList mSurfaceList
Abstract class representing a Texture resource.
Definition: OgreTexture.h:102