VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/include/state/cr_bufferobject.h@ 27091

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

crOpenGL: add GL_ARB_pixel_buffer_object support

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
1/* Copyright (c) 2001, Stanford University
2 * All rights reserved.
3 *
4 * See the file LICENSE.txt for information on redistributing this software.
5 */
6
7#ifndef CR_STATE_BUFFEROBJECT_H
8#define CR_STATE_BUFFEROBJECT_H
9
10#include "cr_hash.h"
11#include "state/cr_statetypes.h"
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17typedef struct {
18 CRbitvalue dirty[CR_MAX_BITARRAY];
19 CRbitvalue arrayBinding[CR_MAX_BITARRAY];
20 CRbitvalue elementsBinding[CR_MAX_BITARRAY];
21 CRbitvalue packBinding[CR_MAX_BITARRAY];
22 CRbitvalue unpackBinding[CR_MAX_BITARRAY];
23} CRBufferObjectBits;
24
25
26/*
27 * Buffer object, like a texture object, but encapsulates arbitrary
28 * data (vertex, image, etc).
29 */
30typedef struct {
31 GLuint refCount;
32 GLuint name;
33 GLenum usage;
34 GLenum access;
35 GLuint size; /* buffer size in bytes */
36 GLvoid *pointer; /* only valid while buffer is mapped */
37 GLvoid *data; /* the buffer data, if retainBufferData is true */
38 GLboolean bResyncOnRead; /* buffer data could be changed on server side,
39 so we need to resync every time guest wants to read from it*/
40 CRbitvalue dirty[CR_MAX_BITARRAY]; /* dirty data or state */
41 GLintptrARB dirtyStart, dirtyLength; /* dirty region */
42} CRBufferObject;
43
44typedef struct {
45 GLboolean retainBufferData; /* should state tracker retain buffer data? */
46 CRBufferObject *arrayBuffer;
47 CRBufferObject *elementsBuffer;
48 CRBufferObject *packBuffer;
49 CRBufferObject *unpackBuffer;
50
51 CRBufferObject *nullBuffer; /* name = 0 */
52
53 CRHashTable *buffers;
54
55 GLboolean bResyncNeeded;
56} CRBufferObjectState;
57
58DECLEXPORT(CRBufferObject *) crStateGetBoundBufferObject(GLenum target, CRBufferObjectState *b);
59DECLEXPORT(GLboolean) crStateIsBufferBound(GLenum target);
60
61#ifdef __cplusplus
62}
63#endif
64
65#endif /* CR_STATE_BUFFEROBJECT_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