-/*\r
- * Mesa 3-D graphics library\r
- * Version: 4.0\r
- * Copyright (C) 1995-1998 Brian Paul\r
- *\r
- * This library is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU Library General Public\r
- * License as published by the Free Software Foundation; either\r
- * version 2 of the License, or (at your option) any later version.\r
- *\r
- * This library is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
- * Library General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU Library General Public\r
- * License along with this library; if not, write to the Free\r
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
- */\r
-\r
-/*\r
- * DOS/DJGPP glut driver v1.0 for Mesa 4.0\r
- *\r
- * Copyright (C) 2002 - Borca Daniel\r
- * Email : dborca@yahoo.com\r
- * Web : http://www.geocities.com/dborca\r
- */\r
-\r
- \r
-#ifndef INTERNAL_H_included\r
-#define INTERNAL_H_included\r
-\r
-\r
-#include "GL/glut.h"\r
-#include "pc_hw/pc_hw.h"\r
-\r
-\r
-#define MAX_WINDOWS 4\r
-\r
-#define DEFAULT_WIDTH 640\r
-#define DEFAULT_HEIGHT 480\r
-#define DEFAULT_BPP 16\r
-\r
-#define DEPTH_SIZE 16\r
-#define STENCIL_SIZE 8\r
-#define ACCUM_SIZE 16\r
-\r
-extern GLenum g_display_mode;\r
-extern GLuint g_width;\r
-extern GLuint g_height;\r
-extern GLint g_mouse;\r
-extern GLboolean g_redisplay;\r
-extern GLint g_xpos;\r
-extern GLint g_ypos;\r
-\r
-extern void (GLUTCALLBACK *display_func) (void);\r
-extern void (GLUTCALLBACK *reshape_func) (int width, int height);\r
-extern void (GLUTCALLBACK *keyboard_func) (unsigned char key, int x, int y);\r
-extern void (GLUTCALLBACK *mouse_func) (int button, int state, int x, int y);\r
-extern void (GLUTCALLBACK *motion_func) (int x, int y);\r
-extern void (GLUTCALLBACK *passive_motion_func) (int x, int y);\r
-extern void (GLUTCALLBACK *entry_func) (int state);\r
-extern void (GLUTCALLBACK *visibility_func) (int state);\r
-extern void (GLUTCALLBACK *idle_func) (void);\r
-extern void (GLUTCALLBACK *menu_state_func) (int state);\r
-extern void (GLUTCALLBACK *special_func) (int key, int x, int y);\r
-extern void (GLUTCALLBACK *spaceball_motion_func) (int x, int y, int z);\r
-extern void (GLUTCALLBACK *spaceball_rotate_func) (int x, int y, int z);\r
-extern void (GLUTCALLBACK *spaceball_button_func) (int button, int state);\r
-extern void (GLUTCALLBACK *button_box_func) (int button, int state);\r
-extern void (GLUTCALLBACK *dials_func) (int dial, int value);\r
-extern void (GLUTCALLBACK *tablet_motion_func) (int x, int y);\r
-extern void (GLUTCALLBACK *tabled_button_func) (int button, int state, int x, int y);\r
-extern void (GLUTCALLBACK *menu_status_func) (int status, int x, int y);\r
-extern void (GLUTCALLBACK *overlay_display_func) (void);\r
-extern void (GLUTCALLBACK *window_status_func) (int state);\r
-\r
-#endif\r
+/*
+ * DOS/DJGPP Mesa Utility Toolkit
+ * Version: 1.0
+ *
+ * Copyright (C) 2005 Daniel Borca All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * DANIEL BORCA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef INTERNAL_H_included
+#define INTERNAL_H_included
+
+#include <GL/glut.h>
+
+#include "GL/dmesa.h"
+
+
+#define MAX_WINDOWS 2
+#define MAX_TIMER_CB 8
+#define RESERVED_COLORS 0
+
+
+/* GLUT function types */
+typedef void (GLUTCALLBACK *GLUTdisplayCB) (void);
+typedef void (GLUTCALLBACK *GLUTreshapeCB) (int, int);
+typedef void (GLUTCALLBACK *GLUTkeyboardCB) (unsigned char, int, int);
+typedef void (GLUTCALLBACK *GLUTmouseCB) (int, int, int, int);
+typedef void (GLUTCALLBACK *GLUTmotionCB) (int, int);
+typedef void (GLUTCALLBACK *GLUTpassiveCB) (int, int);
+typedef void (GLUTCALLBACK *GLUTentryCB) (int);
+typedef void (GLUTCALLBACK *GLUTvisibilityCB) (int);
+typedef void (GLUTCALLBACK *GLUTwindowStatusCB) (int);
+typedef void (GLUTCALLBACK *GLUTidleCB) (void);
+typedef void (GLUTCALLBACK *GLUTtimerCB) (int);
+typedef void (GLUTCALLBACK *GLUTmenuStateCB) (int); /* DEPRECATED. */
+typedef void (GLUTCALLBACK *GLUTmenuStatusCB) (int, int, int);
+typedef void (GLUTCALLBACK *GLUTselectCB) (int);
+typedef void (GLUTCALLBACK *GLUTspecialCB) (int, int, int);
+typedef void (GLUTCALLBACK *GLUTspaceMotionCB) (int, int, int);
+typedef void (GLUTCALLBACK *GLUTspaceRotateCB) (int, int, int);
+typedef void (GLUTCALLBACK *GLUTspaceButtonCB) (int, int);
+typedef void (GLUTCALLBACK *GLUTdialsCB) (int, int);
+typedef void (GLUTCALLBACK *GLUTbuttonBoxCB) (int, int);
+typedef void (GLUTCALLBACK *GLUTtabletMotionCB) (int, int);
+typedef void (GLUTCALLBACK *GLUTtabletButtonCB) (int, int, int, int);
+typedef void (GLUTCALLBACK *GLUTjoystickCB) (unsigned int, int, int, int);
+
+typedef void (GLUTCALLBACK *GLUTdestroyCB) (void);
+typedef void (GLUTCALLBACK *GLUTmouseWheelCB) (int, int, int, int);
+typedef void (GLUTCALLBACK *GLUTmenuDestroyCB) (void);
+
+
+typedef struct {
+ GLuint bpp, alpha;
+ GLuint depth, stencil;
+ GLuint accum;
+
+ GLint geometry[2];
+ GLuint refresh;
+
+ GLint flags;
+} GLUTvisual;
+
+typedef struct {
+ GLint x, y;
+ GLint width, height;
+ GLuint mode;
+} GLUTdefault;
+
+typedef struct {
+ void (*func) (int);
+ int value;
+ int time;
+} GLUTSShotCB;
+
+typedef struct GLUTwindow {
+ int num; /* window id */
+
+ DMesaContext context;
+ DMesaBuffer buffer;
+
+ int show_mouse;
+ GLboolean redisplay;
+
+ /* GLUT settable or visible window state. */
+ int xpos;
+ int ypos;
+ int width; /* window width in pixels */
+ int height; /* window height in pixels */
+
+ /* Per-window callbacks. */
+ GLUTdisplayCB display; /* redraw */
+ GLUTreshapeCB reshape; /* resize (width,height) */
+ GLUTmouseCB mouse; /* mouse (button,state,x,y) */
+ GLUTmotionCB motion; /* motion (x,y) */
+ GLUTpassiveCB passive; /* passive motion (x,y) */
+ GLUTentryCB entry; /* window entry/exit (state) */
+ GLUTkeyboardCB keyboard; /* keyboard (ASCII,x,y) */
+ GLUTkeyboardCB keyboardUp; /* keyboard up (ASCII,x,y) */
+ GLUTwindowStatusCB windowStatus; /* window status */
+ GLUTvisibilityCB visibility; /* visibility */
+ GLUTspecialCB special; /* special key */
+ GLUTspecialCB specialUp; /* special up key */
+ GLUTbuttonBoxCB buttonBox; /* button box */
+ GLUTdialsCB dials; /* dials */
+ GLUTspaceMotionCB spaceMotion; /* Spaceball motion */
+ GLUTspaceRotateCB spaceRotate; /* Spaceball rotate */
+ GLUTspaceButtonCB spaceButton; /* Spaceball button */
+ GLUTtabletMotionCB tabletMotion; /* tablet motion */
+ GLUTtabletButtonCB tabletButton; /* tablet button */
+ GLUTjoystickCB joystick; /* joystick */
+
+ GLUTdestroyCB destroy; /* destroy */
+ GLUTmouseWheelCB mouseWheel; /* mouse wheel */
+
+ /* specific data */
+ void *data;
+} GLUTwindow;
+
+typedef struct {
+ int width, height;
+ int xorig, yorig;
+ int xmove;
+ const unsigned char *bitmap;
+} GLUTBitmapChar;
+
+typedef struct {
+ const char *name;
+ int height;
+ int num;
+ const GLUTBitmapChar *const *table;
+} GLUTBitmapFont;
+
+typedef struct {
+ const GLfloat x, y;
+} GLUTStrokeVertex;
+
+typedef struct {
+ const unsigned num;
+ const GLUTStrokeVertex *vertex;
+} GLUTStrokeStrip;
+
+typedef struct {
+ const GLfloat right;
+ const unsigned num;
+ const GLUTStrokeStrip *strip;
+} GLUTStrokeChar;
+
+typedef struct {
+ const char *name;
+ const unsigned num;
+ const GLUTStrokeChar *const *table;
+ const GLfloat height;
+ const GLfloat descent;
+} GLUTStrokeFont;
+
+
+extern char *__glutProgramName;
+
+extern GLUTvisual _glut_visual;
+extern GLUTdefault _glut_default;
+
+extern GLuint _glut_fps;
+extern GLUTidleCB _glut_idle_func;
+extern GLUTmenuStatusCB _glut_menu_status_func;
+extern GLUTSShotCB _glut_timer_cb[];
+
+extern GLUTwindow *_glut_current, *_glut_windows[];
+
+extern int _glut_mouse; /* number of buttons, if mouse installed */
+extern int _glut_mouse_x, _glut_mouse_y; /* mouse coords, relative to current win */
+
+
+extern void _glut_mouse_init (void);
+extern void _glut_fatal(char *format,...);
+extern void *_glut_font (void *font);
+
+
+#include "pc_hw/pc_hw.h"
+
+#endif