OGRE  2.0
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  protected:
66  void createInternalResourcesImpl(void);
68  void prepareImpl(void);
70  void unprepareImpl(void);
72  void loadImpl(void);
74  void freeInternalResourcesImpl(void);
75 
81  void _createSurfaceList();
82 
85 
91 
93  void _createGLTexResource();
94 
95 #if OGRE_PLATFORM == OGRE_PLATFORM_ANDROID
96 
97  virtual void notifyOnContextLost();
98 
100  virtual void notifyOnContextReset();
101 #endif
102 
103  private:
104  GLuint mTextureID;
106 
108  typedef std::vector<HardwarePixelBufferSharedPtr> SurfaceList;
110  };
111 
112 }
113 
114 #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:498
#define _OgreGLESExport
#define MANAGED_RESOURCE
GLuint getGLID() const
Shared pointer implementation used to share pixel buffers.
unsigned long long int ResourceHandle
Definition: OgreResource.h:39
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
Definition: OgreCommon.h:53
Abstract class representing a Texture resource.
Definition: OgreTexture.h:111
GLESSupport & mGLSupport