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 {
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__
Simple, copying manager/factory for RenderTextures.
A 'canvas' which can receive the results of a rendering operation.
unsigned int uint
#define GL_NONE
PixelFormat
The pixel format used for images, textures, and render surfaces.
bool requiresTextureFlipping() const
GL surface descriptor.
static const String CustomAttributeString_FBO
static const String CustomAttributeString_TARGET
Manager/factory for RenderTextures.
#define _OgreGLExport
#define _OgrePrivate
Definition: OgrePlatform.h:258
virtual void getBestDepthStencil(GLenum internalFormat, GLenum *depthFormat, GLenum *stencilFormat)
This class represents a RenderTarget that renders to a Texture.
_StringBase String
unsigned int uint32
Definition: OgrePlatform.h:359
static const String CustomAttributeString_GLCONTEXT
Base class for GL Render Textures.
Template class for creating single-instance global classes.
Definition: OgreSingleton.h:64
GLHardwarePixelBuffer * buffer
This class represents a render target that renders to multiple RenderTextures at once.

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