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

#ifndef CR_STATE_VIEWPORT_H
#define CR_STATE_VIEWPORT_H

#include "state/cr_statetypes.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
	CRbitvalue dirty[CR_MAX_BITARRAY];
	CRbitvalue v_dims[CR_MAX_BITARRAY];
	CRbitvalue s_dims[CR_MAX_BITARRAY];
	CRbitvalue enable[CR_MAX_BITARRAY];
	CRbitvalue depth[CR_MAX_BITARRAY];
} CRViewportBits;

typedef struct {
	/* Viewport state */
	GLint viewportX;
	GLint viewportY;
	GLint viewportW;
	GLint viewportH;
	GLclampd nearClip;
	GLclampd farClip;
	GLboolean viewportValid;

	/* Scissor state */
	GLboolean	scissorTest;
	GLint		scissorX;
	GLint		scissorY;
	GLsizei		scissorW;
	GLsizei		scissorH;
	GLboolean   scissorValid;
} CRViewportState;

DECLEXPORT(void) crStateViewportInit(CRContext *ctx);

DECLEXPORT(void) crStateViewportApply( CRViewportState *v, GLvectorf *p );
DECLEXPORT(void) crStateViewportMakeCurrent(CRViewportState *v, CRViewportBits *vb);

DECLEXPORT(void) crStateViewportDiff(CRViewportBits *bb, CRbitvalue *bitID,
                                     CRContext *fromCtx, CRContext *toCtx);
DECLEXPORT(void) crStateViewportSwitch(CRViewportBits *bb, CRbitvalue *bitID, 
                                       CRContext *fromCtx, CRContext *toCtx);

#ifdef __cplusplus
}
#endif

#endif /* CR_STATE_VIEWPORT_H */