OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreGLFrameBufferObject.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 __OgreGLFBO_H__
29 #define __OgreGLFBO_H__
30 
31 #include "OgreGLRenderTexture.h"
32 #include "OgreGLContext.h"
33 
34 namespace Ogre {
35 
39  {
40  public:
41  GLFrameBufferObject(GLFBOManager *manager, uint fsaa);
43 
47  void bindSurface(size_t attachment, const GLSurfaceDesc &target);
50  void unbindSurface(size_t attachment);
51 
54  void bind();
55 
58  void swapBuffers();
59 
65  void attachDepthBuffer( DepthBuffer *depthBuffer );
66  void detachDepthBuffer();
67 
69  GLuint getGLFBOID() const { return mFB; }
71  GLuint getGLMultisampleFBOID() const { return mMultisampleFB; }
72 
74  uint32 getWidth();
75  uint32 getHeight();
76  PixelFormat getFormat();
77  GLsizei getFSAA();
78 
79  GLFBOManager *getManager() { return mManager; }
80  const GLSurfaceDesc &getSurface(size_t attachment) { return mColour[attachment]; }
81  private:
83  GLsizei mNumSamples;
84  GLuint mFB;
89  // Arbitrary number of texture surfaces
91 
92 
100  void initialise();
101  };
102 
103 }
104 
105 #endif
#define OGRE_MAX_MULTIPLE_RENDER_TARGETS
Define max number of multiple render targets (MRTs) to render to at once.
Definition: OgreConfig.h:117
GLuint getGLFBOID() const
Get the GL id for the FBO.
unsigned int uint32
Definition: OgrePlatform.h:420
const GLSurfaceDesc & getSurface(size_t attachment)
GLuint getGLMultisampleFBOID() const
Get the GL id for the multisample FBO.
#define _OgreGLExport
An abstract class that contains a depth/stencil buffer.
Frame Buffer Object abstraction.
PixelFormat
The pixel format used for images, textures, and render surfaces.
Factory for GL Frame Buffer Objects, and related things.
GL surface descriptor.
unsigned int uint