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