Fix a few conversion bugs. For example, GLshort->GLfloat conversion
[mesa.git] / src / glut / dos / callback.c
1 /*
2 * DOS/DJGPP Mesa Utility Toolkit
3 * Version: 1.0
4 *
5 * Copyright (C) 2005 Daniel Borca All Rights Reserved.
6 *
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:
13 *
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
16 *
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.
23 */
24
25
26 #include "internal.h"
27
28
29 GLUTSShotCB _glut_timer_cb[MAX_TIMER_CB];
30
31 GLUTidleCB _glut_idle_func = NULL;
32
33
34 void APIENTRY
35 glutDisplayFunc (GLUTdisplayCB func)
36 {
37 _glut_current->display = func;
38 }
39
40
41 void APIENTRY
42 glutReshapeFunc (GLUTreshapeCB func)
43 {
44 _glut_current->reshape = func;
45 }
46
47
48 void APIENTRY
49 glutKeyboardFunc (GLUTkeyboardCB func)
50 {
51 _glut_current->keyboard = func;
52 }
53
54
55 void APIENTRY
56 glutMouseFunc (GLUTmouseCB func)
57 {
58 _glut_current->mouse = func;
59 }
60
61
62 void APIENTRY
63 glutMotionFunc (GLUTmotionCB func)
64 {
65 _glut_current->motion = func;
66 }
67
68
69 void APIENTRY
70 glutPassiveMotionFunc (GLUTpassiveCB func)
71 {
72 _glut_current->passive = func;
73 }
74
75
76 void APIENTRY
77 glutEntryFunc (GLUTentryCB func)
78 {
79 _glut_current->entry = func;
80 }
81
82
83 void APIENTRY
84 glutVisibilityFunc (GLUTvisibilityCB func)
85 {
86 _glut_current->visibility = func;
87 }
88
89
90 void APIENTRY
91 glutWindowStatusFunc (GLUTwindowStatusCB func)
92 {
93 _glut_current->windowStatus = func;
94 }
95
96
97 void APIENTRY
98 glutIdleFunc (GLUTidleCB func)
99 {
100 _glut_idle_func = func;
101 }
102
103
104 void APIENTRY
105 glutTimerFunc (unsigned int millis, GLUTtimerCB func, int value)
106 {
107 int i;
108
109 if (millis > 0) {
110 for (i = 0; i < MAX_TIMER_CB; i++) {
111 GLUTSShotCB *cb = &_glut_timer_cb[i];
112 if (cb->func == NULL) {
113 cb->value = value;
114 cb->func = func;
115 cb->time = glutGet(GLUT_ELAPSED_TIME) + millis;
116 break;
117 }
118 }
119 }
120 }
121
122
123 void APIENTRY
124 glutSpecialFunc (GLUTspecialCB func)
125 {
126 _glut_current->special = func;
127 }
128
129
130 void APIENTRY
131 glutSpaceballMotionFunc (GLUTspaceMotionCB func)
132 {
133 _glut_current->spaceMotion = func;
134 }
135
136
137 void APIENTRY
138 glutSpaceballRotateFunc (GLUTspaceRotateCB func)
139 {
140 _glut_current->spaceRotate = func;
141 }
142
143
144 void APIENTRY
145 glutSpaceballButtonFunc (GLUTspaceButtonCB func)
146 {
147 _glut_current->spaceButton = func;
148 }
149
150
151 void APIENTRY
152 glutDialsFunc (GLUTdialsCB func)
153 {
154 _glut_current->dials = func;
155 }
156
157
158 void APIENTRY
159 glutButtonBoxFunc (GLUTbuttonBoxCB func)
160 {
161 _glut_current->buttonBox = func;
162 }
163
164
165 void APIENTRY
166 glutTabletMotionFunc (GLUTtabletMotionCB func)
167 {
168 _glut_current->tabletMotion = func;
169 }
170
171
172 void APIENTRY
173 glutTabletButtonFunc (GLUTtabletButtonCB func)
174 {
175 _glut_current->tabletButton = func;
176 }
177
178
179 void APIENTRY
180 glutJoystickFunc (GLUTjoystickCB func, int interval)
181 {
182 _glut_current->joystick = func;
183 }
184
185
186 void APIENTRY
187 glutKeyboardUpFunc (GLUTkeyboardCB func)
188 {
189 _glut_current->keyboardUp = func;
190 }
191
192
193 void APIENTRY
194 glutSpecialUpFunc (GLUTspecialCB func)
195 {
196 _glut_current->specialUp = func;
197 }
198
199
200 void APIENTRY
201 glutMouseWheelFunc (GLUTmouseWheelCB func)
202 {
203 _glut_current->mouseWheel = func;
204 }