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