use tnl_emit_func, it's safer
[mesa.git] / src / glut / dos / glutint.h
1 /*
2 * Mesa 3-D graphics library
3 * Version: 4.0
4 * Copyright (C) 1995-1998 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 * DOS/DJGPP glut driver v1.6 for Mesa
23 *
24 * Copyright (C) 2002 - Borca Daniel
25 * Email : dborca@users.sourceforge.net
26 * Web : http://www.geocities.com/dborca
27 */
28
29
30 #ifndef __glutint_h__
31 #define __glutint_h__
32
33 #include <GL/glut.h>
34
35 #include "GL/dmesa.h"
36
37
38
39 /* GLUT function types */
40 typedef void (GLUTCALLBACK *GLUTdisplayCB) (void);
41 typedef void (GLUTCALLBACK *GLUTreshapeCB) (int, int);
42 typedef void (GLUTCALLBACK *GLUTkeyboardCB) (unsigned char, int, int);
43 typedef void (GLUTCALLBACK *GLUTmouseCB) (int, int, int, int);
44 typedef void (GLUTCALLBACK *GLUTmotionCB) (int, int);
45 typedef void (GLUTCALLBACK *GLUTpassiveCB) (int, int);
46 typedef void (GLUTCALLBACK *GLUTentryCB) (int);
47 typedef void (GLUTCALLBACK *GLUTvisibilityCB) (int);
48 typedef void (GLUTCALLBACK *GLUTwindowStatusCB) (int);
49 typedef void (GLUTCALLBACK *GLUTidleCB) (void);
50 typedef void (GLUTCALLBACK *GLUTtimerCB) (int);
51 typedef void (GLUTCALLBACK *GLUTmenuStateCB) (int); /* DEPRECATED. */
52 typedef void (GLUTCALLBACK *GLUTmenuStatusCB) (int, int, int);
53 typedef void (GLUTCALLBACK *GLUTselectCB) (int);
54 typedef void (GLUTCALLBACK *GLUTspecialCB) (int, int, int);
55 typedef void (GLUTCALLBACK *GLUTspaceMotionCB) (int, int, int);
56 typedef void (GLUTCALLBACK *GLUTspaceRotateCB) (int, int, int);
57 typedef void (GLUTCALLBACK *GLUTspaceButtonCB) (int, int);
58 typedef void (GLUTCALLBACK *GLUTdialsCB) (int, int);
59 typedef void (GLUTCALLBACK *GLUTbuttonBoxCB) (int, int);
60 typedef void (GLUTCALLBACK *GLUTtabletMotionCB) (int, int);
61 typedef void (GLUTCALLBACK *GLUTtabletButtonCB) (int, int, int, int);
62 typedef void (GLUTCALLBACK *GLUTjoystickCB) (unsigned int, int, int, int);
63
64 typedef struct GLUTwindow {
65 int num; /* window id */
66
67 DMesaContext context;
68 DMesaBuffer buffer;
69
70 int show_mouse;
71 GLboolean redisplay;
72
73 /* GLUT settable or visible window state. */
74 int xpos;
75 int ypos;
76 int width; /* window width in pixels */
77 int height; /* window height in pixels */
78
79 /* Per-window callbacks. */
80 GLUTdisplayCB display; /* redraw */
81 GLUTreshapeCB reshape; /* resize (width,height) */
82 GLUTmouseCB mouse; /* mouse (button,state,x,y) */
83 GLUTmotionCB motion; /* motion (x,y) */
84 GLUTpassiveCB passive; /* passive motion (x,y) */
85 GLUTentryCB entry; /* window entry/exit (state) */
86 GLUTkeyboardCB keyboard; /* keyboard (ASCII,x,y) */
87 GLUTkeyboardCB keyboardUp; /* keyboard up (ASCII,x,y) */
88 GLUTwindowStatusCB windowStatus; /* window status */
89 GLUTvisibilityCB visibility; /* visibility */
90 GLUTspecialCB special; /* special key */
91 GLUTspecialCB specialUp; /* special up key */
92 GLUTbuttonBoxCB buttonBox; /* button box */
93 GLUTdialsCB dials; /* dials */
94 GLUTspaceMotionCB spaceMotion; /* Spaceball motion */
95 GLUTspaceRotateCB spaceRotate; /* Spaceball rotate */
96 GLUTspaceButtonCB spaceButton; /* Spaceball button */
97 GLUTtabletMotionCB tabletMotion; /* tablet motion */
98 GLUTtabletButtonCB tabletButton; /* tablet button */
99 GLUTjoystickCB joystick; /* joystick */
100 } GLUTwindow;
101
102 extern GLUTidleCB g_idle_func;
103 extern GLUTmenuStatusCB g_menu_status_func;
104
105 extern GLuint g_bpp; /* HW: bits per pixel */
106 extern GLuint g_alpha; /* HW: alpha bits */
107 extern GLuint g_depth; /* HW: depth bits */
108 extern GLuint g_stencil; /* HW: stencil bits */
109 extern GLuint g_accum; /* HW: accum bits */
110 extern GLuint g_refresh; /* HW: vertical refresh rate */
111 extern GLuint g_screen_w, g_screen_h; /* HW: physical screen size */
112 extern GLint g_driver_caps;
113
114 extern GLuint g_fps;
115
116 extern GLuint g_display_mode; /* display bits */
117 extern int g_init_x, g_init_y; /* initial window position */
118 extern GLuint g_init_w, g_init_h; /* initial window size */
119
120 extern int g_mouse; /* non-zero if mouse installed */
121 extern int g_mouse_x, g_mouse_y; /* mouse coords, relative to current win */
122
123 extern GLUTwindow *g_curwin; /* current window */
124 extern GLUTwindow *g_windows[];
125
126 extern char *__glutProgramName; /* program name */
127
128 extern void __glutInitMouse (void);
129
130 /* private routines from glut_util.c */
131 extern char * __glutStrdup(const char *string);
132 extern void __glutWarning(char *format,...);
133 extern void __glutFatalError(char *format,...);
134 extern void __glutFatalUsage(char *format,...);
135 /* Private routines from util.c */
136 #ifdef GLUT_IMPORT_LIB
137 extern void *__glutFont(void *font);
138 #endif
139
140
141
142 /* hmmm... */
143 #include "pc_hw/pc_hw.h"
144
145
146
147 #define MAX_WINDOWS 2
148
149 #define MAX_SSHOT_CB 8
150
151 #define RESERVED_COLORS 0
152
153 #endif /* __glutint_h__ */