blob: c1376e3c83c13f7a58dbf3cc02cf840c1a891c5e [file] [log] [blame]
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +00001//
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.orgea0e1af2010-03-22 19:33:14 +000017#include "common/angleutils.h"
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000018
19namespace gl
20{
21class Colorbuffer;
22class Depthbuffer;
23class Stencilbuffer;
daniel@transgaming.comcdacc8e2010-07-28 19:20:50 +000024class DepthStencilbuffer;
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000025
26class Framebuffer
27{
28 public:
29 Framebuffer();
30
31 ~Framebuffer();
32
33 void setColorbuffer(GLenum type, GLuint colorbuffer);
34 void setDepthbuffer(GLenum type, GLuint depthbuffer);
35 void setStencilbuffer(GLenum type, GLuint stencilbuffer);
36
37 void detachTexture(GLuint texture);
38 void detachRenderbuffer(GLuint renderbuffer);
39
40 IDirect3DSurface9 *getRenderTarget();
41 IDirect3DSurface9 *getDepthStencil();
42
daniel@transgaming.com092bd482010-05-12 03:39:36 +000043 unsigned int getRenderTargetSerial();
daniel@transgaming.com339ae702010-05-12 03:40:20 +000044 unsigned int getDepthbufferSerial();
daniel@transgaming.com092bd482010-05-12 03:39:36 +000045
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000046 Colorbuffer *getColorbuffer();
daniel@transgaming.comcdacc8e2010-07-28 19:20:50 +000047 DepthStencilbuffer *getDepthbuffer();
48 DepthStencilbuffer *getStencilbuffer();
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000049
daniel@transgaming.comc46c9c02010-04-23 18:34:55 +000050 GLenum getColorbufferType();
51 GLenum getDepthbufferType();
52 GLenum getStencilbufferType();
53
54 GLuint getColorbufferHandle();
55 GLuint getDepthbufferHandle();
56 GLuint getStencilbufferHandle();
57
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000058 GLenum completeness();
59
60 private:
61 DISALLOW_COPY_AND_ASSIGN(Framebuffer);
62
63 GLuint mColorbufferHandle;
64 GLenum mColorbufferType;
65
66 GLuint mDepthbufferHandle;
67 GLenum mDepthbufferType;
68
69 GLuint mStencilbufferHandle;
70 GLenum mStencilbufferType;
71};
72}
73
74#endif // LIBGLESV2_FRAMEBUFFER_H_