OgreGLES2Texture.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-2013 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 __GLES2Texture_H__
30 #define __GLES2Texture_H__
31 
32 #include "OgreGLES2Prerequisites.h"
33 #include "OgreGLES2Support.h"
34 #include "OgrePlatform.h"
35 #include "OgreRenderTexture.h"
36 #include "OgreTexture.h"
39 
40 namespace Ogre {
42  {
43  public:
44  // Constructor
45  GLES2Texture(ResourceManager* creator, const String& name, ResourceHandle handle,
46  const String& group, bool isManual, ManualResourceLoader* loader,
47  GLES2Support& support);
48 
49  virtual ~GLES2Texture();
50 
51  void createRenderTexture();
53  HardwarePixelBufferSharedPtr getBuffer(size_t face, size_t mipmap);
54 
55  // Takes the OGRE texture type (1d/2d/3d/cube) and returns the appropriate GL one
56  GLenum getGLES2TextureTarget(void) const;
57 
58  GLuint getGLID() const
59  {
60  return mTextureID;
61  }
62 
63  protected:
65  void createInternalResourcesImpl(void);
67  void prepareImpl(void);
69  void unprepareImpl(void);
71  void loadImpl(void);
73  void freeInternalResourcesImpl(void);
74 
80  void _createSurfaceList();
81 
84 
90 
92  void _createGLTexResource();
93 
94 #if OGRE_PLATFORM == OGRE_PLATFORM_ANDROID
95 
96  virtual void notifyOnContextLost();
97 
99  virtual void notifyOnContextReset();
100 #endif
101 
102  private:
103  GLuint mTextureID;
105 
109 
110  };
111 }
112 
113 #endif
GLuint getGLID() const
#define _OgreGLES2Export
Interface describing a manual resource loader.
Definition: OgreResource.h:514
Abstract class representing a Texture resource.
Definition: OgreTexture.h:102
unsigned long long int ResourceHandle
Definition: OgreResource.h:41
SurfaceList mSurfaceList
GLES2Support & mGLSupport
LoadedImages mLoadedImages
Vector of images that were pulled from disk by prepareLoad but have yet to be pushed into texture mem...
SharedPtr< vector< Image >::type > LoadedImages
Used to hold images between calls to prepare and load.
_StringBase String
Shared pointer implementation used to share pixel buffers.
Defines a generic resource handler.
Reference-counted shared pointer, used for objects where implicit destruction is required.
#define MANAGED_RESOURCE
vector< HardwarePixelBufferSharedPtr >::type SurfaceList
Vector of pointers to subsurfaces.

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Tue Mar 18 2014 19:15:25