blob: fd90ae1a9260d6446b9f0192a385c9e2fce705ce [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
17#include "angleutils.h"
18
19namespace gl
20{
21class Colorbuffer;
22class Depthbuffer;
23class Stencilbuffer;
24
25class 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
42 Colorbuffer *getColorbuffer();
43 Depthbuffer *getDepthbuffer();
44 Stencilbuffer *getStencilbuffer();
45
46 GLenum completeness();
47
48 private:
49 DISALLOW_COPY_AND_ASSIGN(Framebuffer);
50
51 GLuint mColorbufferHandle;
52 GLenum mColorbufferType;
53
54 GLuint mDepthbufferHandle;
55 GLenum mDepthbufferType;
56
57 GLuint mStencilbufferHandle;
58 GLenum mStencilbufferType;
59};
60}
61
62#endif // LIBGLESV2_FRAMEBUFFER_H_