VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/state_tracker/state.h@ 39568

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

crOpenGL: more threading fixes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
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 STATE_H
8#define STATE_H
9
10#include "cr_glstate.h"
11#ifdef CHROMIUM_THREADSAFE
12#include "cr_threads.h"
13#endif
14
15typedef struct _crCheckIDHWID {
16 GLuint id, hwid;
17} crCheckIDHWID_t;
18
19extern SPUDispatchTable diff_api;
20extern CRStateBits *__currentBits;
21
22#define GetCurrentBits() __currentBits
23
24#ifdef CHROMIUM_THREADSAFE
25extern CRtsd __contextTSD;
26#define GetCurrentContext() crTSDRefGetCurrent(CRContext, &__contextTSD)
27
28/* NOTE: below SetCurrentContext stuff is supposed to be used only internally!!
29 * it is placed here only to simplify things since some code besides state_init.c
30 * (i.e. state_glsl.c) is using it */
31#define SetCurrentContext(_ctx) crTSDRefSetCurrent(CRContext, &__contextTSD, _ctx)
32#else
33extern CRContext *__currentContext;
34#define GetCurrentContext() __currentContext
35#endif
36
37extern void crStateTextureInitTextureObj (CRContext *ctx, CRTextureObj *tobj, GLuint name, GLenum target);
38extern void crStateTextureInitTextureFormat( CRTextureLevel *tl, GLenum internalFormat );
39
40/* Normally these functions would have been in cr_bufferobject.h but
41 * that led to a number of issues.
42 */
43void crStateBufferObjectInit(CRContext *ctx);
44
45void crStateBufferObjectDestroy (CRContext *ctx);
46
47void crStateBufferObjectDiff(CRBufferObjectBits *bb, CRbitvalue *bitID,
48 CRContext *fromCtx, CRContext *toCtx);
49
50void crStateBufferObjectSwitch(CRBufferObjectBits *bb, CRbitvalue *bitID,
51 CRContext *fromCtx, CRContext *toCtx);
52
53/* These would normally be in cr_client.h */
54
55void crStateClientDiff(CRClientBits *cb, CRbitvalue *bitID, CRContext *from, CRContext *to);
56
57void crStateClientSwitch(CRClientBits *cb, CRbitvalue *bitID, CRContext *from, CRContext *to);
58
59void crStateGetTextureObjectAndImage(CRContext *g, GLenum texTarget, GLint level,
60 CRTextureObj **obj, CRTextureLevel **img);
61
62void crStateFreeBufferObject(void *data);
63void crStateFreeFBO(void *data);
64void crStateFreeRBO(void *data);
65#endif
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