VirtualBox

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

最後變更 在這個檔案從80404是 80404,由 vboxsync 提交於 6 年 前

Additions,GuestHost/OpenGL: Windows additions build fix, bugref:9529src\VBox\Additions\WINNT

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

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