summaryrefslogtreecommitdiffstats
path: root/src/VBox/GuestHost/OpenGL/include/state/cr_feedback.h
blob: 168f20ebbe876a40c593cab52f915aaba4b41a57 (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
/* Copyright (c) 2001, Stanford University
 * All rights reserved.
 *
 * See the file LICENSE.txt for information on redistributing this software.
 */

#ifndef CR_STATE_FEEDBACK_H 
#define CR_STATE_FEEDBACK_H 

#include "state/cr_statetypes.h"

#include <iprt/cdefs.h>

#ifdef __cplusplus
extern "C" {
#endif

#define MAX_NAME_STACK_DEPTH 64

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

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

typedef struct {
	GLenum	type;
	GLuint	mask;
	GLfloat	*buffer;
	GLuint	bufferSize;
	GLuint	count;
} CRFeedbackState;

typedef struct {
   	GLuint *buffer;
   	GLuint bufferSize;
   	GLuint bufferCount;
   	GLuint hits;
   	GLuint nameStackDepth;
   	GLuint nameStack[MAX_NAME_STACK_DEPTH];
   	GLboolean hitFlag;
   	GLfloat hitMinZ, hitMaxZ;
} CRSelectionState;

extern DECLEXPORT(void) crStateFeedbackDiff(CRFeedbackState *from, CRFeedbackState *to,
                                            CRFeedbackBits *bb, CRbitvalue *bitID);
extern DECLEXPORT(void) crStateFeedbackSwitch(CRFeedbackBits *bb, CRbitvalue *bitID, 
                                              CRFeedbackState *from, CRFeedbackState *to);

#ifdef __cplusplus
}
#endif

#endif /* CR_STATE_FEEDBACK_H */