r200: fix multitexturing in dri2 path
[mesa.git] / src / glut / fbdev / callback.c
1 /*
2 * Mesa 3-D graphics library
3 * Version: 6.5
4 * Copyright (C) 1995-2006 Brian Paul
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the Free
18 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21 /*
22 * Library for glut using mesa fbdev driver
23 *
24 * Written by Sean D'Epagnier (c) 2006
25 */
26
27 #include <stdlib.h>
28
29 #include <GL/glut.h>
30
31 #include "internal.h"
32
33 void (*DisplayFunc)(void) = NULL;
34 void (*ReshapeFunc)(int width, int height) = NULL;
35 void (*KeyboardFunc)(unsigned char key, int x, int y) = NULL;
36 void (*KeyboardUpFunc)(unsigned char key, int x, int y) = NULL;
37 void (*MouseFunc)(int key, int state, int x, int y) = NULL;
38 void (*MotionFunc)(int x, int y) = NULL;
39 void (*PassiveMotionFunc)(int x, int y) = NULL;
40 void (*VisibilityFunc)(int state) = NULL;
41 void (*SpecialFunc)(int key, int x, int y) = NULL;
42 void (*SpecialUpFunc)(int key, int x, int y) = NULL;
43 void (*IdleFunc)(void) = NULL;
44 void (*MenuStatusFunc)(int state, int x, int y) = NULL;
45 void (*MenuStateFunc)(int state) = NULL;
46
47 void glutDisplayFunc(void (*func)(void))
48 {
49 DisplayFunc = func;
50 }
51
52 void glutOverlayDisplayFunc(void (*func)(void))
53 {
54 }
55
56 void glutWindowStatusFunc(void (*func)(int state))
57 {
58 }
59
60 void glutReshapeFunc(void (*func)(int width, int height))
61 {
62 ReshapeFunc = func;
63 }
64
65 void glutKeyboardFunc(void (*func)(unsigned char key, int x, int y))
66 {
67 KeyboardFunc = func;
68 }
69
70 void glutKeyboardUpFunc(void (*func)(unsigned char key, int x, int y))
71 {
72 KeyboardUpFunc = func;
73 }
74
75 void glutMouseFunc(void (*func)(int button, int state, int x, int y))
76 {
77 MouseFunc = func;
78 }
79
80 void glutMotionFunc(void (*func)(int x, int y))
81 {
82 MotionFunc = func;
83 }
84
85 void glutPassiveMotionFunc(void (*func)(int x, int y))
86 {
87 PassiveMotionFunc = func;
88 }
89
90 void glutJoystickFunc(void (*func)(unsigned int buttonMask,
91 int x, int y, int z), int pollInterval)
92 {
93 }
94
95 void glutVisibilityFunc(void (*func)(int state))
96 {
97 VisibilityFunc = func;
98 }
99
100 void glutEntryFunc(void (*func)(int state))
101 {
102 }
103
104 void glutSpecialFunc(void (*func)(int key, int x, int y))
105 {
106 SpecialFunc = func;
107 }
108
109 void glutSpecialUpFunc(void (*func)(int key, int x, int y))
110 {
111 SpecialUpFunc = func;
112 }
113
114 void glutSpaceballMotionFunc(void (*func)(int x, int y, int z))
115 {
116 }
117
118 void glutSpaceballRotateFunc(void (*func)(int x, int y, int z))
119 {
120 }
121
122 void glutSpaceballButtonFunc(void (*func)(int button, int state))
123 {
124 }
125
126 void glutButtonBoxFunc(void (*func)(int button, int state))
127 {
128 }
129
130 void glutDialsFunc(void (*func)(int dial, int value))
131 {
132 }
133
134 void glutTabletMotionFunc(void (*func)(int x, int y))
135 {
136 }
137
138 void glutTabletButtonFunc(void (*func)(int button, int state,
139 int x, int y))
140 {
141 }
142
143 void glutMenuStatusFunc(void (*func)(int status, int x, int y))
144 {
145 MenuStatusFunc = func;
146 }
147
148 void glutMenuStateFunc(void (*func)(int status))
149 {
150 MenuStateFunc = func;
151 }
152
153 void glutIdleFunc(void (*func)(void))
154 {
155 IdleFunc = func;
156 }
157
158 void glutTimerFunc(unsigned int msecs,
159 void (*func)(int value), int value)
160 {
161 struct GlutTimer **head = &GlutTimers, *timer = malloc(sizeof *timer);
162 timer->time = glutGet(GLUT_ELAPSED_TIME) + msecs;
163 timer->func = func;
164 timer->value = value;
165
166 while(*head && (*head)->time < timer->time)
167 head = &(*head)->next;
168
169 timer->next = *head;
170 *head = timer;
171 }