1 /***********************************************************
2 * Copyright (C) 1997, Be Inc. All rights reserved.
4 * FILE: glutCallback.cpp
6 * DESCRIPTION: put all the callback setting routines in
8 ***********************************************************/
10 /***********************************************************
12 ***********************************************************/
15 #include "glutState.h"
17 /***********************************************************
18 * Window related callbacks
19 ***********************************************************/
21 glutDisplayFunc(GLUTdisplayCB displayFunc
)
23 /* XXX Remove the warning after GLUT 3.0. */
25 __glutFatalError("NULL display callback not allowed in GLUT 3.0; update your code.");
26 gState
.currentWindow
->display
= displayFunc
;
30 glutKeyboardFunc(GLUTkeyboardCB keyboardFunc
)
32 gState
.currentWindow
->keyboard
= keyboardFunc
;
36 glutSpecialFunc(GLUTspecialCB specialFunc
)
38 gState
.currentWindow
->special
= specialFunc
;
42 glutMouseFunc(GLUTmouseCB mouseFunc
)
44 gState
.currentWindow
->mouse
= mouseFunc
;
48 glutMotionFunc(GLUTmotionCB motionFunc
)
50 gState
.currentWindow
->motion
= motionFunc
;
54 glutPassiveMotionFunc(GLUTpassiveCB passiveMotionFunc
)
56 gState
.currentWindow
->passive
= passiveMotionFunc
;
60 glutEntryFunc(GLUTentryCB entryFunc
)
62 gState
.currentWindow
->entry
= entryFunc
;
64 gState
.currentWindow
->entryState
= -1;
69 glutVisibilityFunc(GLUTvisibilityCB visibilityFunc
)
71 gState
.currentWindow
->visibility
= visibilityFunc
;
75 glutReshapeFunc(GLUTreshapeCB reshapeFunc
)
78 gState
.currentWindow
->reshape
= reshapeFunc
;
80 gState
.currentWindow
->reshape
= __glutDefaultReshape
;
84 /***********************************************************
85 * General callbacks (timer callback in glutEvent.cpp)
86 ***********************************************************/
87 /* DEPRICATED, use glutMenuStatusFunc instead. */
89 glutMenuStateFunc(GLUTmenuStateCB menuStateFunc
)
91 gState
.menuStatus
= (GLUTmenuStatusCB
) menuStateFunc
;
95 glutMenuStatusFunc(GLUTmenuStatusCB menuStatusFunc
)
97 gState
.menuStatus
= menuStatusFunc
;
101 glutIdleFunc(GLUTidleCB idleFunc
)
103 gState
.idle
= idleFunc
;
106 /***********************************************************
107 * Unsupported callbacks
108 ***********************************************************/
110 glutOverlayDisplayFunc(GLUTdisplayCB displayFunc
)
115 glutSpaceballMotionFunc(GLUTspaceMotionCB spaceMotionFunc
)
120 glutSpaceballRotateFunc(GLUTspaceRotateCB spaceRotateFunc
)
125 glutSpaceballButtonFunc(GLUTspaceButtonCB spaceButtonFunc
)
130 glutButtonBoxFunc(GLUTbuttonBoxCB buttonBoxFunc
)
135 glutDialsFunc(GLUTdialsCB dialsFunc
)
140 glutTabletMotionFunc(GLUTtabletMotionCB tabletMotionFunc
)
145 glutTabletButtonFunc(GLUTtabletButtonCB tabletButtonFunc
)