summaryrefslogtreecommitdiff
path: root/src/VBox/GuestHost/OpenGL/include/state/cr_occlude.h
blob: 9791ec6a5cd377d87b1616772928fccf23f8cafb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* Copyright (c) 2001, Stanford University
 * All rights reserved.
 *
 * See the file LICENSE.txt for information on redistributing this software.
 */

#ifndef CR_OCCLUSION_H
#define CR_OCCLUSION_H

#include "cr_hash.h"
#include "state/cr_statetypes.h"

#include <iprt/cdefs.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
	CRbitvalue	dirty[CR_MAX_BITARRAY];
} CROcclusionBits;


/*
 * Occlusion query object.
 */
typedef struct {
	GLenum target;
	GLuint name;
	GLuint refCount;
	GLuint passedCounter;
	GLboolean active;
	CRbitvalue dirty[CR_MAX_BITARRAY];  /* dirty data or state */
	GLintptrARB dirtyStart, dirtyLength; /* dirty region */
} CROcclusionObject;


typedef struct {
	CRHashTable *objects;
	GLuint currentQueryObject;
} CROcclusionState;


DECLEXPORT(void) crStateOcclusionInit(CRContext *ctx);

DECLEXPORT(void) crStateOcclusionDestroy(CRContext *ctx);

DECLEXPORT(void) crStateOcclusionDiff(CROcclusionBits *bb, CRbitvalue *bitID,
                                      CRContext *fromCtx, CRContext *toCtx);
DECLEXPORT(void) crStateOcclusionSwitch(CROcclusionBits *bb, CRbitvalue *bitID, 
                                        CRContext *fromCtx, CRContext *toCtx);


#ifdef __cplusplus
}
#endif

#endif /* CR_OCCLUSION_H */