OgreGL3PlusRenderTexture.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 __GL3PlusRENDERTEXTURE_H__
30 #define __GL3PlusRENDERTEXTURE_H__
31 
32 #include "OgreGL3PlusTexture.h"
33 
34 namespace Ogre {
35  class GL3PlusHardwarePixelBuffer;
36 
39  struct _OgrePrivate GL3PlusSurfaceDesc
40  {
41  public:
45 
46  GL3PlusSurfaceDesc() :buffer(0), zoffset(0), numSamples(0) {}
47  };
48 
52  {
53  public:
54  GL3PlusRenderTexture(const String &name, const GL3PlusSurfaceDesc &target, bool writeGamma, uint fsaa);
55  virtual ~GL3PlusRenderTexture();
56  bool requiresTextureFlipping() const { return true; }
57 
61  };
62 
65  class _OgreGL3PlusExport GL3PlusRTTManager : public Singleton<GL3PlusRTTManager>
66  {
67  public:
68  virtual ~GL3PlusRTTManager();
69 
72  virtual RenderTexture *createRenderTexture(const String &name, const GL3PlusSurfaceDesc &target, bool writeGamma, uint fsaa) = 0;
73 
76  virtual bool checkFormat(PixelFormat format) = 0;
77 
80  virtual void bind(RenderTarget *target) = 0;
81 
86  virtual void unbind(RenderTarget *target) = 0;
87 
88  virtual void getBestDepthStencil(GLenum internalFormat, GLenum *depthFormat, GLenum *stencilFormat)
89  {
90  *depthFormat = GL_NONE;
91  *stencilFormat = GL_NONE;
92  }
93 
96  virtual MultiRenderTarget* createMultiRenderTarget(const String & name);
97 
100  virtual PixelFormat getSupportedAlternative(PixelFormat format);
101  };
102 
103 }
104 
105 #endif
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::GL3PlusSurfaceDesc::GL3PlusSurfaceDesc
GL3PlusSurfaceDesc()
Definition: OgreGL3PlusRenderTexture.h:46
Ogre::GL3PlusRenderTexture
Base class for GL Render Textures.
Definition: OgreGL3PlusRenderTexture.h:51
Ogre::uint32
unsigned int uint32
Definition: OgrePlatform.h:359
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::GL3PlusRenderTexture::CustomAttributeString_GLCONTEXT
static const String CustomAttributeString_GLCONTEXT
Definition: OgreGL3PlusRenderTexture.h:60
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
GL_NONE
#define GL_NONE
Definition: OgreGLESPrerequisites.h:116
_OgreGL3PlusExport
#define _OgreGL3PlusExport
Definition: OgreGL3PlusPrerequisites.h:91
Ogre::GL3PlusRTTManager
Manager/factory for RenderTextures.
Definition: OgreGL3PlusRenderTexture.h:65
Ogre::Singleton
Template class for creating single-instance global classes.
Definition: OgreSingleton.h:64
Ogre::GL3PlusSurfaceDesc
GL surface descriptor.
Definition: OgreGL3PlusRenderTexture.h:39
Ogre::MultiRenderTarget
This class represents a render target that renders to multiple RenderTextures at once.
Definition: OgreRenderTexture.h:69
Ogre::GL3PlusRTTManager::getBestDepthStencil
virtual void getBestDepthStencil(GLenum internalFormat, GLenum *depthFormat, GLenum *stencilFormat)
Definition: OgreGL3PlusRenderTexture.h:88
Ogre::GL3PlusHardwarePixelBuffer
Definition: OgreGL3PlusHardwarePixelBuffer.h:36
Ogre::GL3PlusSurfaceDesc::numSamples
uint numSamples
Definition: OgreGL3PlusRenderTexture.h:44
Ogre::uint
unsigned int uint
Definition: OgrePrerequisites.h:114
Ogre::GL3PlusRenderTexture::CustomAttributeString_TARGET
static const String CustomAttributeString_TARGET
Definition: OgreGL3PlusRenderTexture.h:59
Ogre::RenderTexture
This class represents a RenderTarget that renders to a Texture.
Definition: OgreRenderTexture.h:48
OgreGL3PlusTexture.h
Ogre::GL3PlusSurfaceDesc::zoffset
uint32 zoffset
Definition: OgreGL3PlusRenderTexture.h:43
Ogre::GL3PlusSurfaceDesc::buffer
GL3PlusHardwarePixelBuffer * buffer
Definition: OgreGL3PlusRenderTexture.h:42
Ogre::GL3PlusRenderTexture::requiresTextureFlipping
bool requiresTextureFlipping() const
Definition: OgreGL3PlusRenderTexture.h:56
Ogre::GL3PlusRenderTexture::CustomAttributeString_FBO
static const String CustomAttributeString_FBO
Definition: OgreGL3PlusRenderTexture.h:58

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