VirtualBox

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

Last change on this file since 69474 was 69474, checked in by vboxsync, 7 years ago

*: scm updates - header files should have 'svn:keywords=Id Revision' too (doesn't mean they have to use them).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 2.2 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#include "state/cr_statefuncs.h"
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18typedef struct {
19 CRbitvalue dirty[CR_MAX_BITARRAY];
20 CRbitvalue arrayBinding[CR_MAX_BITARRAY];
21 CRbitvalue elementsBinding[CR_MAX_BITARRAY];
22 CRbitvalue packBinding[CR_MAX_BITARRAY];
23 CRbitvalue unpackBinding[CR_MAX_BITARRAY];
24} CRBufferObjectBits;
25
26
27/*
28 * Buffer object, like a texture object, but encapsulates arbitrary
29 * data (vertex, image, etc).
30 */
31typedef struct {
32 GLuint refCount;
33 GLuint id;
34 GLuint hwid;
35 GLenum usage;
36 GLenum access;
37 GLuint size; /* buffer size in bytes */
38 GLvoid *pointer; /* only valid while buffer is mapped */
39 GLvoid *data; /* the buffer data, if retainBufferData is true */
40 GLboolean bResyncOnRead; /* buffer data could be changed on server side,
41 so we need to resync every time guest wants to read from it*/
42 CRbitvalue dirty[CR_MAX_BITARRAY]; /* dirty data or state */
43 GLintptrARB dirtyStart, dirtyLength; /* dirty region */
44 /* bitfield representing the object usage. 1 means the object is used by the context with the given bitid */
45 CRbitvalue ctxUsage[CR_MAX_BITARRAY];
46} CRBufferObject;
47
48typedef struct {
49 GLboolean retainBufferData; /* should state tracker retain buffer data? */
50 CRBufferObject *arrayBuffer;
51 CRBufferObject *elementsBuffer;
52 CRBufferObject *packBuffer;
53 CRBufferObject *unpackBuffer;
54
55 CRBufferObject *nullBuffer; /* name = 0 */
56} CRBufferObjectState;
57
58DECLEXPORT(CRBufferObject *) crStateGetBoundBufferObject(GLenum target, CRBufferObjectState *b);
59DECLEXPORT(GLboolean) crStateIsBufferBound(GLenum target);
60struct CRContext;
61DECLEXPORT(GLboolean) crStateIsBufferBoundForCtx(struct CRContext *g, GLenum target);
62
63DECLEXPORT(GLuint) STATE_APIENTRY crStateBufferHWIDtoID(GLuint hwid);
64DECLEXPORT(GLuint) STATE_APIENTRY crStateGetBufferHWID(GLuint id);
65
66DECLEXPORT(void) crStateRegBuffers(GLsizei n, GLuint *buffers);
67#ifdef __cplusplus
68}
69#endif
70
71#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