daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. |
| 3 | // Use of this source code is governed by a BSD-style license that can be |
| 4 | // found in the LICENSE file. |
| 5 | // |
| 6 | |
| 7 | // Framebuffer.h: Defines the gl::Framebuffer class. Implements GL framebuffer |
| 8 | // objects and related functionality. [OpenGL ES 2.0.24] section 4.4 page 105. |
| 9 | |
| 10 | #ifndef LIBGLESV2_FRAMEBUFFER_H_ |
| 11 | #define LIBGLESV2_FRAMEBUFFER_H_ |
| 12 | |
| 13 | #define GL_APICALL |
| 14 | #include <GLES2/gl2.h> |
| 15 | #include <d3d9.h> |
| 16 | |
alokp@chromium.org | ea0e1af | 2010-03-22 19:33:14 +0000 | [diff] [blame] | 17 | #include "common/angleutils.h" |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 18 | |
| 19 | namespace gl |
| 20 | { |
| 21 | class Colorbuffer; |
| 22 | class Depthbuffer; |
| 23 | class Stencilbuffer; |
| 24 | |
| 25 | class Framebuffer |
| 26 | { |
| 27 | public: |
| 28 | Framebuffer(); |
| 29 | |
| 30 | ~Framebuffer(); |
| 31 | |
| 32 | void setColorbuffer(GLenum type, GLuint colorbuffer); |
| 33 | void setDepthbuffer(GLenum type, GLuint depthbuffer); |
| 34 | void setStencilbuffer(GLenum type, GLuint stencilbuffer); |
| 35 | |
| 36 | void detachTexture(GLuint texture); |
| 37 | void detachRenderbuffer(GLuint renderbuffer); |
| 38 | |
| 39 | IDirect3DSurface9 *getRenderTarget(); |
| 40 | IDirect3DSurface9 *getDepthStencil(); |
| 41 | |
daniel@transgaming.com | 092bd48 | 2010-05-12 03:39:36 +0000 | [diff] [blame^] | 42 | unsigned int getRenderTargetSerial(); |
| 43 | |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 44 | Colorbuffer *getColorbuffer(); |
| 45 | Depthbuffer *getDepthbuffer(); |
| 46 | Stencilbuffer *getStencilbuffer(); |
| 47 | |
daniel@transgaming.com | c46c9c0 | 2010-04-23 18:34:55 +0000 | [diff] [blame] | 48 | GLenum getColorbufferType(); |
| 49 | GLenum getDepthbufferType(); |
| 50 | GLenum getStencilbufferType(); |
| 51 | |
| 52 | GLuint getColorbufferHandle(); |
| 53 | GLuint getDepthbufferHandle(); |
| 54 | GLuint getStencilbufferHandle(); |
| 55 | |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 56 | GLenum completeness(); |
| 57 | |
| 58 | private: |
| 59 | DISALLOW_COPY_AND_ASSIGN(Framebuffer); |
| 60 | |
| 61 | GLuint mColorbufferHandle; |
| 62 | GLenum mColorbufferType; |
| 63 | |
| 64 | GLuint mDepthbufferHandle; |
| 65 | GLenum mDepthbufferType; |
| 66 | |
| 67 | GLuint mStencilbufferHandle; |
| 68 | GLenum mStencilbufferType; |
| 69 | }; |
| 70 | } |
| 71 | |
| 72 | #endif // LIBGLESV2_FRAMEBUFFER_H_ |