VirtualBox

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

Last change on this file since 41057 was 41057, checked in by vboxsync, 13 years ago

crOpenGL: fix gl resource leaking (server part)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.1 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#ifndef IN_GUEST
45 /* bitfield representing the object usage. 1 means the object is used by the context with the given bitid */
46 CRbitvalue ctxUsage[CR_MAX_BITARRAY];
47#endif
48} CRBufferObject;
49
50typedef struct {
51 GLboolean retainBufferData; /* should state tracker retain buffer data? */
52 CRBufferObject *arrayBuffer;
53 CRBufferObject *elementsBuffer;
54 CRBufferObject *packBuffer;
55 CRBufferObject *unpackBuffer;
56
57 CRBufferObject *nullBuffer; /* name = 0 */
58} CRBufferObjectState;
59
60DECLEXPORT(CRBufferObject *) crStateGetBoundBufferObject(GLenum target, CRBufferObjectState *b);
61DECLEXPORT(GLboolean) crStateIsBufferBound(GLenum target);
62
63DECLEXPORT(GLuint) STATE_APIENTRY crStateBufferHWIDtoID(GLuint hwid);
64DECLEXPORT(GLuint) STATE_APIENTRY crStateGetBufferHWID(GLuint id);
65
66#ifdef __cplusplus
67}
68#endif
69
70#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