xref: /haiku/src/libs/glut/glutState.h (revision 25a7b01d15612846f332751841da3579db313082)
1 /***********************************************************
2  *      Copyright (C) 1997, Be Inc.  Copyright (C) 1999, Jake Hamby.
3  *
4  * This program is freely distributable without licensing fees
5  * and is provided without guarantee or warrantee expressed or
6  * implied. This program is -not- in the public domain.
7  *
8  *
9  *  FILE:	glutState.h
10  *
11  *	DESCRIPTION:	the global state for GLUT
12  *		(takes the place of glutint.h in the C version)
13  ***********************************************************/
14 
15 /***********************************************************
16  *	Headers
17  ***********************************************************/
18 #include <GL/glut.h>
19 #include <Application.h>
20 
21 #include "glutWindow.h"
22 #include "glutMenu.h"
23 #include "glutGameMode.h"
24 
25 /***********************************************************
26  *	CLASS:	GlutState
27  *
28  *	DESCRIPTION:	all the global state variables
29  ***********************************************************/
30 struct GlutState {
31 	BApplication *display;
32 	thread_id appthread;
33 
34 	int initX, initY;			// initial window position
35 	int initWidth, initHeight;	// initial window size
36 	unsigned int displayMode;	// initial display mode
37 	char *displayString;		// verbose display mode
38 
39 	GlutWindow *currentWindow;	// current window
40 	GlutMenu *currentMenu;		// current menu
41 
42 	GlutWindow **windowList;	// array of pointers to windows
43 	int windowListSize;			// size of window list
44 
45 	GLUTidleCB idle;				// idle callback
46 	GLUTmenuStatusCB menuStatus;	// menu status callback
47 	int modifierKeys;				// only valid during keyboard callback
48 	int keyRepeatMode;				// global repeat
49 
50 	GlutGameMode gameMode;
51 
52 	bool debug;					// call glGetError
53 	bool quitAll;				// quit
54 
GlutStateGlutState55 	GlutState() {
56 		display = 0;
57 		appthread = 0;
58 		initX = initY = -1;
59 		initWidth = initHeight = 300;
60 		displayMode = GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH;
61 		displayString = 0;
62 		currentWindow = NULL;
63 		currentMenu = NULL;
64 		windowList = NULL;
65 		windowListSize = 0;
66 		idle = 0;
67 		menuStatus = 0;
68 		modifierKeys = ~0;
69 		keyRepeatMode = GLUT_KEY_REPEAT_DEFAULT;
70 		debug = quitAll = false;
71 	}
72 };
73 
74 /***********************************************************
75  *	Global variable (declared in glutInit.cpp)
76  ***********************************************************/
77 extern GlutState gState;
78