2 * DOS/DJGPP Mesa Utility Toolkit
5 * Copyright (C) 2005 Daniel Borca All Rights Reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * DANIEL BORCA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 GLUTSShotCB _glut_timer_cb
[MAX_TIMER_CB
];
31 GLUTidleCB _glut_idle_func
= NULL
;
35 glutDisplayFunc (GLUTdisplayCB func
)
37 _glut_current
->display
= func
;
42 glutReshapeFunc (GLUTreshapeCB func
)
44 _glut_current
->reshape
= func
;
49 glutKeyboardFunc (GLUTkeyboardCB func
)
51 _glut_current
->keyboard
= func
;
56 glutMouseFunc (GLUTmouseCB func
)
58 _glut_current
->mouse
= func
;
63 glutMotionFunc (GLUTmotionCB func
)
65 _glut_current
->motion
= func
;
70 glutPassiveMotionFunc (GLUTpassiveCB func
)
72 _glut_current
->passive
= func
;
77 glutEntryFunc (GLUTentryCB func
)
79 _glut_current
->entry
= func
;
84 glutVisibilityFunc (GLUTvisibilityCB func
)
86 _glut_current
->visibility
= func
;
91 glutWindowStatusFunc (GLUTwindowStatusCB func
)
93 _glut_current
->windowStatus
= func
;
98 glutIdleFunc (GLUTidleCB func
)
100 _glut_idle_func
= func
;
105 glutTimerFunc (unsigned int millis
, GLUTtimerCB func
, int value
)
110 for (i
= 0; i
< MAX_TIMER_CB
; i
++) {
111 GLUTSShotCB
*cb
= &_glut_timer_cb
[i
];
112 if (cb
->func
== NULL
) {
115 cb
->time
= glutGet(GLUT_ELAPSED_TIME
) + millis
;
124 glutSpecialFunc (GLUTspecialCB func
)
126 _glut_current
->special
= func
;
131 glutSpaceballMotionFunc (GLUTspaceMotionCB func
)
133 _glut_current
->spaceMotion
= func
;
138 glutSpaceballRotateFunc (GLUTspaceRotateCB func
)
140 _glut_current
->spaceRotate
= func
;
145 glutSpaceballButtonFunc (GLUTspaceButtonCB func
)
147 _glut_current
->spaceButton
= func
;
152 glutDialsFunc (GLUTdialsCB func
)
154 _glut_current
->dials
= func
;
159 glutButtonBoxFunc (GLUTbuttonBoxCB func
)
161 _glut_current
->buttonBox
= func
;
166 glutTabletMotionFunc (GLUTtabletMotionCB func
)
168 _glut_current
->tabletMotion
= func
;
173 glutTabletButtonFunc (GLUTtabletButtonCB func
)
175 _glut_current
->tabletButton
= func
;
180 glutJoystickFunc (GLUTjoystickCB func
, int interval
)
182 _glut_current
->joystick
= func
;
187 glutKeyboardUpFunc (GLUTkeyboardCB func
)
189 _glut_current
->keyboardUp
= func
;
194 glutSpecialUpFunc (GLUTspecialCB func
)
196 _glut_current
->specialUp
= func
;
201 glutMouseWheelFunc (GLUTmouseWheelCB func
)
203 _glut_current
->mouseWheel
= func
;