OgreGLES2FrameBufferObject.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 #ifndef __OgreGLES2FBO_H__
29 #define __OgreGLES2FBO_H__
30 
31 #include "OgreGLES2RenderTexture.h"
32 #include "OgreGLES2Context.h"
34 
35 namespace Ogre {
36 
37  class GLES2FBOManager;
38  struct GLES2SurfaceDesc;
39 
43  {
44  public:
47 
51  void bindSurface(size_t attachment, const GLES2SurfaceDesc &target);
54  void unbindSurface(size_t attachment);
55 
58  void bind();
59 
62  void swapBuffers();
63 
69  void attachDepthBuffer( DepthBuffer *depthBuffer );
70  void detachDepthBuffer();
71 
73  uint32 getWidth();
74  uint32 getHeight();
75  PixelFormat getFormat();
76  GLsizei getFSAA();
77 
78  GLES2FBOManager *getManager() { return mManager; }
79  const GLES2SurfaceDesc &getSurface(size_t attachment) { return mColour[attachment]; }
80 
81 #if OGRE_PLATFORM == OGRE_PLATFORM_ANDROID
82 
83  void notifyOnContextLost();
84 
86  void notifyOnContextReset(const GLES2SurfaceDesc &target);
87 #endif
88 
89  private:
91  GLsizei mNumSamples;
92  GLuint mFB;
97  // Arbitrary number of texture surfaces
99 
100 
108  void initialise();
109  };
110 
111 }
112 
113 #endif
Ogre::GLES2FrameBufferObject::mStencil
GLES2SurfaceDesc mStencil
Definition: OgreGLES2FrameBufferObject.h:96
OGRE_MAX_MULTIPLE_RENDER_TARGETS
#define OGRE_MAX_MULTIPLE_RENDER_TARGETS
Define max number of multiple render targets (MRTs) to render to at once.
Definition: OgreConfig.h:116
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::DepthBuffer
An abstract class that contains a depth/stencil buffer.
Definition: OgreDepthBuffer.h:82
Ogre::GLES2FrameBufferObject::getSurface
const GLES2SurfaceDesc & getSurface(size_t attachment)
Definition: OgreGLES2FrameBufferObject.h:79
Ogre::GLES2FBOManager
Factory for GL ES 2 Frame Buffer Objects, and related things.
Definition: OgreGLES2FBORenderTexture.h:70
Ogre::GLES2FrameBufferObject::mDepth
GLES2SurfaceDesc mDepth
Definition: OgreGLES2FrameBufferObject.h:95
Ogre::uint32
unsigned int uint32
Definition: OgrePlatform.h:359
OgreGLES2RenderTexture.h
Ogre::PixelFormat
PixelFormat
The pixel format used for images, textures, and render surfaces.
Definition: OgrePixelFormat.h:43
Ogre::GLES2FrameBufferObject::mManager
GLES2FBOManager * mManager
Definition: OgreGLES2FrameBufferObject.h:90
Ogre::GLES2FrameBufferObject::mFB
GLuint mFB
Definition: OgreGLES2FrameBufferObject.h:92
Ogre::GLES2SurfaceDesc
GL surface descriptor.
Definition: OgreGLES2RenderTexture.h:39
OgreGLES2ManagedResource.h
OgreGLES2Context.h
Ogre::GLES2FrameBufferObject::mMultisampleFB
GLuint mMultisampleFB
Definition: OgreGLES2FrameBufferObject.h:93
Ogre::uint
unsigned int uint
Definition: OgrePrerequisites.h:114
_OgreGLES2Export
#define _OgreGLES2Export
Definition: OgreGLES2Prerequisites.h:260
Ogre::GLES2FrameBufferObject::getManager
GLES2FBOManager * getManager()
Definition: OgreGLES2FrameBufferObject.h:78
Ogre::GLES2FrameBufferObject::mMultisampleColourBuffer
GLES2SurfaceDesc mMultisampleColourBuffer
Definition: OgreGLES2FrameBufferObject.h:94
Ogre::GLES2FrameBufferObject::mNumSamples
GLsizei mNumSamples
Definition: OgreGLES2FrameBufferObject.h:91
Ogre::GLES2FrameBufferObject
Frame Buffer Object abstraction.
Definition: OgreGLES2FrameBufferObject.h:42

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