OGRE  1.9
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreGLESTexture.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) 2008 Renato Araujo Oliveira Filho <renatox@gmail.com>
8 Copyright (c) 2000-2014 Torus Knot Software Ltd
9 
10 Permission is hereby granted, free of charge, to any person obtaining a copy
11 of this software and associated documentation files (the "Software"), to deal
12 in the Software without restriction, including without limitation the rights
13 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 copies of the Software, and to permit persons to whom the Software is
15 furnished to do so, subject to the following conditions:
16 
17 The above copyright notice and this permission notice shall be included in
18 all copies or substantial portions of the Software.
19 
20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26 THE SOFTWARE.
27 -----------------------------------------------------------------------------
28 */
29 
30 #ifndef __GLESTexture_H__
31 #define __GLESTexture_H__
32 
33 #include "OgreGLESPrerequisites.h"
34 #include "OgreGLESSupport.h"
35 #include "OgrePlatform.h"
36 #include "OgreRenderTexture.h"
37 #include "OgreTexture.h"
40 
41 namespace Ogre {
43  {
44  public:
45  // Constructor
46  GLESTexture(ResourceManager* creator, const String& name, ResourceHandle handle,
47  const String& group, bool isManual, ManualResourceLoader* loader,
48  GLESSupport& support);
49 
50  virtual ~GLESTexture();
51 
52  void createRenderTexture();
54  HardwarePixelBufferSharedPtr getBuffer(size_t face, size_t mipmap);
55 
56  // Takes the OGRE texture type (1d/2d/3d/cube) and returns the appropriate GL one
57  GLenum getGLESTextureTarget(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 
95  void _createGLTexResource();
96 
97 #if OGRE_PLATFORM == OGRE_PLATFORM_ANDROID
98 
99  virtual void notifyOnContextLost();
100 
102  virtual void notifyOnContextReset();
103 #endif
104 
105  private:
106  GLuint mTextureID;
108 
110  typedef std::vector<HardwarePixelBufferSharedPtr> SurfaceList;
112  };
113 
114 }
115 
116 #endif
LoadedImages mLoadedImages
Vector of images that were pulled from disk by prepareLoad but have yet to be pushed into texture mem...
SurfaceList mSurfaceList
SharedPtr< std::vector< Image > > LoadedImages
Used to hold images between calls to prepare and load.
Interface describing a manual resource loader.
Definition: OgreResource.h:514
#define _OgreGLESExport
#define MANAGED_RESOURCE
GLuint getGLID() const
Shared pointer implementation used to share pixel buffers.
unsigned long long int ResourceHandle
Definition: OgreResource.h:41
Defines a generic resource handler.
Reference-counted shared pointer, used for objects where implicit destruction is required.
std::vector< HardwarePixelBufferSharedPtr > SurfaceList
Vector of pointers to subsurfaces.
_StringBase String
Abstract class representing a Texture resource.
Definition: OgreTexture.h:102
GLESSupport & mGLSupport