OGRE  1.9
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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-2014 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
#define OGRE_MAX_MULTIPLE_RENDER_TARGETS
Define max number of multiple render targets (MRTs) to render to at once.
Definition: OgreConfig.h:116
unsigned int uint32
Definition: OgrePlatform.h:344
GL surface descriptor.
#define _OgreGLES2Export
Factory for GL ES 2 Frame Buffer Objects, and related things.
const GLES2SurfaceDesc & getSurface(size_t attachment)
An abstract class that contains a depth/stencil buffer.
PixelFormat
The pixel format used for images, textures, and render surfaces.
Frame Buffer Object abstraction.
unsigned int uint