OgreGLES2RenderTexture.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 __GLES2RenderTexture_H__
30 #define __GLES2RenderTexture_H__
31 
32 #include "OgreGLES2Texture.h"
33 
34 namespace Ogre {
35  class GLES2HardwarePixelBuffer;
36 
40  {
41  public:
45 
46  GLES2SurfaceDesc() :buffer(0), zoffset(0), numSamples(0) {}
47  };
48 
52  {
53  public:
54  GLES2RenderTexture(const String &name, const GLES2SurfaceDesc &target, bool writeGamma, uint fsaa);
55  virtual ~GLES2RenderTexture();
56  bool requiresTextureFlipping() const { return true; }
57  };
58 
61  class _OgreGLES2Export GLES2RTTManager : public Singleton<GLES2RTTManager>
62  {
63  public:
64  virtual ~GLES2RTTManager();
65 
68  virtual RenderTexture *createRenderTexture(const String &name, const GLES2SurfaceDesc &target, bool writeGamma, uint fsaa) = 0;
69 
72  virtual bool checkFormat(PixelFormat format) = 0;
73 
76  virtual void bind(RenderTarget *target) = 0;
77 
82  virtual void unbind(RenderTarget *target) = 0;
83 
84  virtual void getBestDepthStencil(GLenum internalFormat, GLenum *depthFormat, GLenum *stencilFormat)
85  {
86  *depthFormat = GL_NONE;
87  *stencilFormat = GL_NONE;
88  }
89 
92  virtual MultiRenderTarget* createMultiRenderTarget(const String & name);
93 
96  virtual PixelFormat getSupportedAlternative(PixelFormat format);
97  };
98 
101  class GLES2CopyingRTTManager;
103  {
104  public:
106  const String &name,
107  const GLES2SurfaceDesc &target,
108  bool writeGamma, uint fsaa);
109 
110  virtual void getCustomAttribute(const String& name, void* pData);
111  };
112 
117  {
118  public:
120  virtual ~GLES2CopyingRTTManager();
121 
124  virtual RenderTexture *createRenderTexture(const String &name, const GLES2SurfaceDesc &target, bool writeGamma, uint fsaa);
125 
128  virtual bool checkFormat(PixelFormat format);
129 
132  virtual void bind(RenderTarget *target);
133 
136  virtual void unbind(RenderTarget *target);
137  };
138 }
139 
140 #endif
Ogre::GLES2RenderTexture::requiresTextureFlipping
bool requiresTextureFlipping() const
Definition: OgreGLES2RenderTexture.h:56
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::GLES2CopyingRTTManager
Simple, copying manager/factory for RenderTextures.
Definition: OgreGLES2RenderTexture.h:116
Ogre::GLES2RTTManager::getBestDepthStencil
virtual void getBestDepthStencil(GLenum internalFormat, GLenum *depthFormat, GLenum *stencilFormat)
Definition: OgreGLES2RenderTexture.h:84
Ogre::GLES2CopyingRenderTexture
Definition: OgreGLES2RenderTexture.h:102
Ogre::uint32
unsigned int uint32
Definition: OgrePlatform.h:359
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::GLES2HardwarePixelBuffer
Definition: OgreGLES2HardwarePixelBuffer.h:36
Ogre::RenderTarget
A 'canvas' which can receive the results of a rendering operation.
Definition: OgreRenderTarget.h:65
Ogre::PixelFormat
PixelFormat
The pixel format used for images, textures, and render surfaces.
Definition: OgrePixelFormat.h:43
Ogre::GLES2SurfaceDesc::numSamples
uint numSamples
Definition: OgreGLES2RenderTexture.h:44
GL_NONE
#define GL_NONE
Definition: OgreGLESPrerequisites.h:116
Ogre::Singleton
Template class for creating single-instance global classes.
Definition: OgreSingleton.h:64
OgreGLES2Texture.h
Ogre::GLES2SurfaceDesc
GL surface descriptor.
Definition: OgreGLES2RenderTexture.h:39
Ogre::GLES2SurfaceDesc::buffer
GLES2HardwarePixelBuffer * buffer
Definition: OgreGLES2RenderTexture.h:42
Ogre::MultiRenderTarget
This class represents a render target that renders to multiple RenderTextures at once.
Definition: OgreRenderTexture.h:69
Ogre::uint
unsigned int uint
Definition: OgrePrerequisites.h:114
Ogre::GLES2RTTManager
Manager/factory for RenderTextures.
Definition: OgreGLES2RenderTexture.h:61
Ogre::GLES2SurfaceDesc::GLES2SurfaceDesc
GLES2SurfaceDesc()
Definition: OgreGLES2RenderTexture.h:46
_OgreGLES2Export
#define _OgreGLES2Export
Definition: OgreGLES2Prerequisites.h:260
Ogre::RenderTexture
This class represents a RenderTarget that renders to a Texture.
Definition: OgreRenderTexture.h:48
Ogre::GLES2SurfaceDesc::zoffset
uint32 zoffset
Definition: OgreGLES2RenderTexture.h:43
Ogre::GLES2RenderTexture
Base class for GL Render Textures.
Definition: OgreGLES2RenderTexture.h:51

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 Apr 13 2021 08:53:15