1 | /* $Id: cr_framebuffer.h 22363 2009-08-20 09:46:01Z vboxsync $ */
|
---|
2 |
|
---|
3 | /** @file
|
---|
4 | * VBox crOpenGL: FBO related state info
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2009 Sun Microsystems, Inc.
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | *
|
---|
18 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
19 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
20 | * additional information or have any questions.
|
---|
21 | */
|
---|
22 |
|
---|
23 |
|
---|
24 | #ifndef CR_STATE_FRAMEBUFFEROBJECT_H
|
---|
25 | #define CR_STATE_FRAMEBUFFEROBJECT_H
|
---|
26 |
|
---|
27 | #include "cr_hash.h"
|
---|
28 | #include "state/cr_statetypes.h"
|
---|
29 | #include "state/cr_statefuncs.h"
|
---|
30 |
|
---|
31 | #ifdef __cplusplus
|
---|
32 | extern "C" {
|
---|
33 | #endif
|
---|
34 |
|
---|
35 | #define CR_MAX_COLOR_ATTACHMENTS 16
|
---|
36 |
|
---|
37 | typedef struct {
|
---|
38 | GLenum type; /*one of GL_NONE GL_TEXTURE GL_RENDERBUFFER_EXT*/
|
---|
39 | GLuint name;
|
---|
40 | GLint level;
|
---|
41 | GLint face;
|
---|
42 | GLint zoffset;
|
---|
43 | } CRFBOAttachmentPoint;
|
---|
44 |
|
---|
45 | typedef struct {
|
---|
46 | GLuint id;
|
---|
47 | CRFBOAttachmentPoint color[CR_MAX_COLOR_ATTACHMENTS];
|
---|
48 | CRFBOAttachmentPoint depth;
|
---|
49 | CRFBOAttachmentPoint stencil;
|
---|
50 | GLenum readbuffer;
|
---|
51 | /*@todo: we don't support drawbufferS yet, so it's a stub*/
|
---|
52 | GLenum drawbuffer[1];
|
---|
53 | } CRFramebufferObject;
|
---|
54 |
|
---|
55 | typedef struct {
|
---|
56 | GLuint id;
|
---|
57 | GLsizei width, height;
|
---|
58 | GLenum internalformat;
|
---|
59 | GLuint redBits, greenBits, blueBits, alphaBits, depthBits, stencilBits;
|
---|
60 | } CRRenderbufferObject;
|
---|
61 |
|
---|
62 | typedef struct {
|
---|
63 | CRFramebufferObject *framebuffer;
|
---|
64 | CRRenderbufferObject *renderbuffer;
|
---|
65 | CRHashTable *framebuffers;
|
---|
66 | CRHashTable *renderbuffers;
|
---|
67 | } CRFramebufferObjectState;
|
---|
68 |
|
---|
69 | DECLEXPORT(void) STATE_APIENTRY crStateFramebufferObjectInit(CRContext *ctx);
|
---|
70 | DECLEXPORT(void) STATE_APIENTRY crStateFramebufferObjectDestroy(CRContext *ctx);
|
---|
71 | DECLEXPORT(void) STATE_APIENTRY crStateFramebufferObjectSwitch(CRContext *from, CRContext *to);
|
---|
72 |
|
---|
73 | DECLEXPORT(void) STATE_APIENTRY crStateBindRenderbufferEXT(GLenum target, GLuint renderbuffer);
|
---|
74 | DECLEXPORT(void) STATE_APIENTRY crStateDeleteRenderbuffersEXT(GLsizei n, const GLuint *renderbuffers);
|
---|
75 | DECLEXPORT(void) STATE_APIENTRY crStateRenderbufferStorageEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
---|
76 | DECLEXPORT(void) STATE_APIENTRY crStateGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params);
|
---|
77 | DECLEXPORT(void) STATE_APIENTRY crStateBindFramebufferEXT(GLenum target, GLuint framebuffer);
|
---|
78 | DECLEXPORT(void) STATE_APIENTRY crStateDeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers);
|
---|
79 | DECLEXPORT(void) STATE_APIENTRY crStateFramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
---|
80 | DECLEXPORT(void) STATE_APIENTRY crStateFramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
---|
81 | DECLEXPORT(void) STATE_APIENTRY crStateFramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
|
---|
82 | DECLEXPORT(void) STATE_APIENTRY crStateFramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
---|
83 | DECLEXPORT(void) STATE_APIENTRY crStateGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, GLenum pname, GLint *params);
|
---|
84 | DECLEXPORT(void) STATE_APIENTRY crStateGenerateMipmapEXT(GLenum target);
|
---|
85 |
|
---|
86 | #ifdef __cplusplus
|
---|
87 | }
|
---|
88 | #endif
|
---|
89 |
|
---|
90 | #endif /* CR_STATE_FRAMEBUFFEROBJECT_H */
|
---|