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 |
|
---|
15 | typedef struct _crCheckIDHWID {
|
---|
16 | GLuint id, hwid;
|
---|
17 | } crCheckIDHWID_t;
|
---|
18 |
|
---|
19 | extern SPUDispatchTable diff_api;
|
---|
20 | extern CRStateBits *__currentBits;
|
---|
21 |
|
---|
22 | #define GetCurrentBits() __currentBits
|
---|
23 |
|
---|
24 | #ifdef CHROMIUM_THREADSAFE
|
---|
25 | extern CRtsd __contextTSD;
|
---|
26 | #define GetCurrentContext() (CRContext *) crGetTSD(&__contextTSD)
|
---|
27 | #else
|
---|
28 | extern CRContext *__currentContext;
|
---|
29 | #define GetCurrentContext() __currentContext
|
---|
30 | #endif
|
---|
31 |
|
---|
32 | extern void crStateTextureInitTextureObj (CRContext *ctx, CRTextureObj *tobj, GLuint name, GLenum target);
|
---|
33 | extern void crStateTextureInitTextureFormat( CRTextureLevel *tl, GLenum internalFormat );
|
---|
34 |
|
---|
35 | /* Normally these functions would have been in cr_bufferobject.h but
|
---|
36 | * that led to a number of issues.
|
---|
37 | */
|
---|
38 | void crStateBufferObjectInit(CRContext *ctx);
|
---|
39 |
|
---|
40 | void crStateBufferObjectDestroy (CRContext *ctx);
|
---|
41 |
|
---|
42 | void crStateBufferObjectDiff(CRBufferObjectBits *bb, CRbitvalue *bitID,
|
---|
43 | CRContext *fromCtx, CRContext *toCtx);
|
---|
44 |
|
---|
45 | void crStateBufferObjectSwitch(CRBufferObjectBits *bb, CRbitvalue *bitID,
|
---|
46 | CRContext *fromCtx, CRContext *toCtx);
|
---|
47 |
|
---|
48 | /* These would normally be in cr_client.h */
|
---|
49 |
|
---|
50 | void crStateClientDiff(CRClientBits *cb, CRbitvalue *bitID, CRContext *from, CRContext *to);
|
---|
51 |
|
---|
52 | void crStateClientSwitch(CRClientBits *cb, CRbitvalue *bitID, CRContext *from, CRContext *to);
|
---|
53 |
|
---|
54 | void crStateGetTextureObjectAndImage(CRContext *g, GLenum texTarget, GLint level,
|
---|
55 | CRTextureObj **obj, CRTextureLevel **img);
|
---|
56 |
|
---|
57 | void crStateFreeBufferObject(void *data);
|
---|
58 | void crStateFreeFBO(void *data);
|
---|
59 | void crStateFreeRBO(void *data);
|
---|
60 | #endif
|
---|