VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/include/state/cr_framebuffer.h@ 22509

Last change on this file since 22509 was 22363, checked in by vboxsync, 15 years ago

crOpenGL: fix FBO support when used by several guest applications

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.7 KB
Line 
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
32extern "C" {
33#endif
34
35#define CR_MAX_COLOR_ATTACHMENTS 16
36
37typedef 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
45typedef 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
55typedef struct {
56 GLuint id;
57 GLsizei width, height;
58 GLenum internalformat;
59 GLuint redBits, greenBits, blueBits, alphaBits, depthBits, stencilBits;
60} CRRenderbufferObject;
61
62typedef struct {
63 CRFramebufferObject *framebuffer;
64 CRRenderbufferObject *renderbuffer;
65 CRHashTable *framebuffers;
66 CRHashTable *renderbuffers;
67} CRFramebufferObjectState;
68
69DECLEXPORT(void) STATE_APIENTRY crStateFramebufferObjectInit(CRContext *ctx);
70DECLEXPORT(void) STATE_APIENTRY crStateFramebufferObjectDestroy(CRContext *ctx);
71DECLEXPORT(void) STATE_APIENTRY crStateFramebufferObjectSwitch(CRContext *from, CRContext *to);
72
73DECLEXPORT(void) STATE_APIENTRY crStateBindRenderbufferEXT(GLenum target, GLuint renderbuffer);
74DECLEXPORT(void) STATE_APIENTRY crStateDeleteRenderbuffersEXT(GLsizei n, const GLuint *renderbuffers);
75DECLEXPORT(void) STATE_APIENTRY crStateRenderbufferStorageEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
76DECLEXPORT(void) STATE_APIENTRY crStateGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params);
77DECLEXPORT(void) STATE_APIENTRY crStateBindFramebufferEXT(GLenum target, GLuint framebuffer);
78DECLEXPORT(void) STATE_APIENTRY crStateDeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers);
79DECLEXPORT(void) STATE_APIENTRY crStateFramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
80DECLEXPORT(void) STATE_APIENTRY crStateFramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
81DECLEXPORT(void) STATE_APIENTRY crStateFramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
82DECLEXPORT(void) STATE_APIENTRY crStateFramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
83DECLEXPORT(void) STATE_APIENTRY crStateGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, GLenum pname, GLint *params);
84DECLEXPORT(void) STATE_APIENTRY crStateGenerateMipmapEXT(GLenum target);
85
86#ifdef __cplusplus
87}
88#endif
89
90#endif /* CR_STATE_FRAMEBUFFEROBJECT_H */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette