OgreGLRenderTexture.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 __GLRENDERTEXTURE_H__
30 #define __GLRENDERTEXTURE_H__
31 
32 #include "OgreGLTexture.h"
33 
34 namespace Ogre {
37  struct _OgrePrivate GLSurfaceDesc
38  {
39  public:
43 
44  GLSurfaceDesc() :buffer(0), zoffset(0), numSamples(0) {}
45  };
46 
50  {
51  public:
52  GLRenderTexture(const String &name, const GLSurfaceDesc &target, bool writeGamma, uint fsaa);
53  virtual ~GLRenderTexture();
54 
55  bool requiresTextureFlipping() const { return true; }
56 
60  };
61 
64  class _OgreGLExport GLRTTManager: public Singleton<GLRTTManager>
65  {
66  public:
67  virtual ~GLRTTManager();
68 
71  virtual RenderTexture *createRenderTexture(const String &name, const GLSurfaceDesc &target, bool writeGamma, uint fsaa) = 0;
72 
75  virtual bool checkFormat(PixelFormat format) = 0;
76 
79  virtual void bind(RenderTarget *target) = 0;
80 
85  virtual void unbind(RenderTarget *target) = 0;
86 
87  virtual void getBestDepthStencil(GLenum internalFormat, GLenum *depthFormat, GLenum *stencilFormat)
88  {
89  *depthFormat = GL_NONE;
90  *stencilFormat = GL_NONE;
91  }
92 
95  virtual MultiRenderTarget* createMultiRenderTarget(const String & name);
96 
99  virtual PixelFormat getSupportedAlternative(PixelFormat format);
100  };
101 
104  class GLCopyingRTTManager;
106  {
107  public:
108  GLCopyingRenderTexture(GLCopyingRTTManager *manager, const String &name, const GLSurfaceDesc &target,
109  bool writeGamma, uint fsaa);
110 
111  virtual void getCustomAttribute(const String& name, void* pData);
112  };
113 
118  {
119  public:
121  virtual ~GLCopyingRTTManager();
122 
125  virtual RenderTexture *createRenderTexture(const String &name, const GLSurfaceDesc &target, bool writeGamma, uint fsaa);
126 
129  virtual bool checkFormat(PixelFormat format);
130 
133  virtual void bind(RenderTarget *target);
134 
137  virtual void unbind(RenderTarget *target);
138  };
139 }
140 
141 #endif // __GLTEXTURE_H__
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::GLRenderTexture
Base class for GL Render Textures.
Definition: OgreGLRenderTexture.h:49
Ogre::GLRenderTexture::CustomAttributeString_FBO
static const String CustomAttributeString_FBO
Definition: OgreGLRenderTexture.h:57
Ogre::GLCopyingRTTManager
Simple, copying manager/factory for RenderTextures.
Definition: OgreGLRenderTexture.h:117
Ogre::uint32
unsigned int uint32
Definition: OgrePlatform.h:359
Ogre::GLRenderTexture::requiresTextureFlipping
bool requiresTextureFlipping() const
Definition: OgreGLRenderTexture.h:55
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::GLSurfaceDesc::numSamples
uint numSamples
Definition: OgreGLRenderTexture.h:42
Ogre::GLCopyingRenderTexture
Definition: OgreGLRenderTexture.h:105
Ogre::RenderTarget
A 'canvas' which can receive the results of a rendering operation.
Definition: OgreRenderTarget.h:65
Ogre::GLRTTManager::getBestDepthStencil
virtual void getBestDepthStencil(GLenum internalFormat, GLenum *depthFormat, GLenum *stencilFormat)
Definition: OgreGLRenderTexture.h:87
Ogre::PixelFormat
PixelFormat
The pixel format used for images, textures, and render surfaces.
Definition: OgrePixelFormat.h:43
GL_NONE
#define GL_NONE
Definition: OgreGLESPrerequisites.h:116
_OgreGLExport
#define _OgreGLExport
Definition: OgreGLPrerequisites.h:99
Ogre::Singleton
Template class for creating single-instance global classes.
Definition: OgreSingleton.h:64
Ogre::MultiRenderTarget
This class represents a render target that renders to multiple RenderTextures at once.
Definition: OgreRenderTexture.h:69
Ogre::GLRenderTexture::CustomAttributeString_TARGET
static const String CustomAttributeString_TARGET
Definition: OgreGLRenderTexture.h:58
OgreGLTexture.h
Ogre::uint
unsigned int uint
Definition: OgrePrerequisites.h:114
Ogre::GLSurfaceDesc::buffer
GLHardwarePixelBuffer * buffer
Definition: OgreGLRenderTexture.h:40
Ogre::RenderTexture
This class represents a RenderTarget that renders to a Texture.
Definition: OgreRenderTexture.h:48
Ogre::GLRenderTexture::CustomAttributeString_GLCONTEXT
static const String CustomAttributeString_GLCONTEXT
Definition: OgreGLRenderTexture.h:59
Ogre::GLRTTManager
Manager/factory for RenderTextures.
Definition: OgreGLRenderTexture.h:64
Ogre::GLSurfaceDesc
GL surface descriptor.
Definition: OgreGLRenderTexture.h:37
Ogre::GLHardwarePixelBuffer
Definition: OgreGLHardwarePixelBuffer.h:35
Ogre::GLSurfaceDesc::GLSurfaceDesc
GLSurfaceDesc()
Definition: OgreGLRenderTexture.h:44
Ogre::GLSurfaceDesc::zoffset
uint32 zoffset
Definition: OgreGLRenderTexture.h:41

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