summaryrefslogtreecommitdiff
path: root/src/glut/dos
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2002-04-01 17:01:33 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2002-04-01 17:01:33 +0000
commit6c921af034525fc28f006e447f62a31e00649f2c (patch)
treee6287c87d5aacd4980c1b1301aa548f67dfd5738 /src/glut/dos
parenta97d216adb6cd97926d760a4b5eadfaf1fda29f7 (diff)
DOS driver update
Diffstat (limited to 'src/glut/dos')
-rw-r--r--src/glut/dos/Makefile.DJ32
-rw-r--r--src/glut/dos/PC_HW/pc_hw.c2
-rw-r--r--src/glut/dos/PC_HW/pc_hw.h8
-rw-r--r--src/glut/dos/PC_HW/pc_irq.S2
-rw-r--r--src/glut/dos/PC_HW/pc_keyb.c2
-rw-r--r--src/glut/dos/PC_HW/pc_mouse.c2
-rw-r--r--src/glut/dos/PC_HW/pc_timer.c2
-rw-r--r--src/glut/dos/callback.c2
-rw-r--r--src/glut/dos/color.c2
-rw-r--r--src/glut/dos/font.c2
-rw-r--r--src/glut/dos/globals.c2
-rw-r--r--src/glut/dos/init.c2
-rw-r--r--src/glut/dos/internal.h2
-rw-r--r--src/glut/dos/menu.c2
-rw-r--r--src/glut/dos/overlay.c2
-rw-r--r--src/glut/dos/state.c2
-rw-r--r--src/glut/dos/window.c15
17 files changed, 47 insertions, 36 deletions
diff --git a/src/glut/dos/Makefile.DJ b/src/glut/dos/Makefile.DJ
index 7a26eb2d0c..02bc31b10c 100644
--- a/src/glut/dos/Makefile.DJ
+++ b/src/glut/dos/Makefile.DJ
@@ -20,7 +20,7 @@
# 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.
-# DOS/DJGPP glut makefile v0.4 for Mesa 4.0
+# DOS/DJGPP glut makefile v1.0 for Mesa 4.0
#
# Copyright (C) 2002 - Borca Daniel
# Email : dborca@yahoo.com
@@ -31,7 +31,7 @@
TOP = ..
CC = gcc
-CFLAGS = -I$(TOP)/include -Wall -W -Wno-unused -mcpu=pentium -ffast-math -O2
+CFLAGS = -I$(TOP)/include -Wall -W -Wno-unused -mcpu=$(CPU) -ffast-math -O2
AR = ar
ARFLAGS = ruv
LIBDIR = $(TOP)/lib
@@ -59,23 +59,23 @@ CORE_SOURCES = \
teapot.c \
window.c
-PC_HW_OBJECTS = \
- PC_HW/pc_hw.o \
- PC_HW/pc_keyb.o \
- PC_HW/pc_mouse.o \
- PC_HW/pc_timer.o \
- PC_HW/pc_irq.o
+PC_HW_SOURCES = \
+ PC_HW/pc_hw.c \
+ PC_HW/pc_keyb.c \
+ PC_HW/pc_mouse.c \
+ PC_HW/pc_timer.c \
+ PC_HW/pc_irq.S
-SOURCES = $(CORE_SOURCES)
+SOURCES = $(CORE_SOURCES) $(PC_HW_SOURCES)
-OBJECTS = $(SOURCES:.c=.o) $(PC_HW_OBJECTS)
+OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
+.c.o:
+ gcc -o $@ -c $(CFLAGS) $<
.S.o:
gcc -o $@ -c $(CFLAGS) $<
.s.o:
gcc -o $@ -c $(CFLAGS) $(<:.s=.S)
-.c.o:
- gcc -o $@ -c $(CFLAGS) $<
all: $(LIBDIR)/$(GLUT_LIB) $(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP)
@@ -84,10 +84,10 @@ $(LIBDIR)/$(GLUT_LIB): $(OBJECTS)
$(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP): $(OBJECTS)
ifeq ($(DXE2GEN),)
- @echo Missing DXE2GEN and/or DXE2.LD! You must have DXE2GEN
- @echo somewhere in PATH, and DXE2.LD in DJGPP/LIB directory.
+ $(warning Missing DXE2GEN and/or DXE2.LD! You must have DXE2GEN)
+ $(warning somewhere in PATH, and DXE2.LD in DJGPP/LIB directory.)
else
- dxe2gen -o $(LIBDIR)/$(GLUT_DXE) -I $(LIBDIR)/$(GLUT_IMP) $(OBJECTS) -D "DOS Glut" -U
+ dxe2gen -o $(LIBDIR)/$(GLUT_DXE) -I $(LIBDIR)/$(GLUT_IMP) $(OBJECTS) -D "Mesa DOS GLUT" -U
endif
clean:
@@ -102,7 +102,7 @@ init.o: init.c ../include/GL/glut.h internal.h PC_HW/pc_hw.h
menu.o: menu.c ../include/GL/glut.h
models.o: models.c ../include/GL/glut.h
overlay.o: overlay.c ../include/GL/glut.h
-state.o: state.c ../include/GL/glut.h internal.h pc_hw/pc_hw.h
+state.o: state.c ../include/GL/glut.h internal.h PC_HW/pc_hw.h
teapot.o: teapot.c ../include/GL/glut.h
window.o: window.c ../include/GL/glut.h ../include/GL/dmesa.h internal.h \
PC_HW/pc_hw.h
diff --git a/src/glut/dos/PC_HW/pc_hw.c b/src/glut/dos/PC_HW/pc_hw.c
index d6ffd5650f..09ab461404 100644
--- a/src/glut/dos/PC_HW/pc_hw.c
+++ b/src/glut/dos/PC_HW/pc_hw.c
@@ -1,5 +1,5 @@
/*
- * PC/HW routine collection v0.1 for DOS/DJGPP
+ * PC/HW routine collection v1.0 for DOS/DJGPP
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
diff --git a/src/glut/dos/PC_HW/pc_hw.h b/src/glut/dos/PC_HW/pc_hw.h
index 09fe8051bb..47fcf78d0c 100644
--- a/src/glut/dos/PC_HW/pc_hw.h
+++ b/src/glut/dos/PC_HW/pc_hw.h
@@ -1,5 +1,5 @@
/*
- * PC/HW routine collection v0.1 for DOS/DJGPP
+ * PC/HW routine collection v1.0 for DOS/DJGPP
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
@@ -189,12 +189,11 @@ extern int pc_remove_irq (int i);
#define KEY_MAX 115
-extern volatile char pc_key[KEY_MAX];
-
int pc_install_keyb (void);
void pc_remove_keyb (void);
int pc_keypressed (void);
int pc_readkey (void);
+int pc_keydown (int code);
/*
* timer
@@ -205,13 +204,12 @@ void pc_remove_timer (void);
/*
* mouse
*/
-extern volatile int pc_mouse_x, pc_mouse_y, pc_mouse_b;
-
int pc_install_mouse (void);
void pc_remove_mouse (void);
MFUNC pc_install_mouse_handler (MFUNC handler);
void pc_mouse_area (int x1, int y1, int x2, int y2);
void pc_mouse_speed (int xspeed, int yspeed);
+int pc_query_mouse (int *x, int *y);
void pc_show_mouse (void);
void pc_scare_mouse (void);
void pc_unscare_mouse (void);
diff --git a/src/glut/dos/PC_HW/pc_irq.S b/src/glut/dos/PC_HW/pc_irq.S
index 8f19f8eb9f..196546072c 100644
--- a/src/glut/dos/PC_HW/pc_irq.S
+++ b/src/glut/dos/PC_HW/pc_irq.S
@@ -1,5 +1,5 @@
/*
- * PC/HW routine collection v0.2 for DOS/DJGPP
+ * PC/HW routine collection v1.0 for DOS/DJGPP
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
diff --git a/src/glut/dos/PC_HW/pc_keyb.c b/src/glut/dos/PC_HW/pc_keyb.c
index d3987d8e34..50ef94b797 100644
--- a/src/glut/dos/PC_HW/pc_keyb.c
+++ b/src/glut/dos/PC_HW/pc_keyb.c
@@ -1,5 +1,5 @@
/*
- * PC/HW routine collection v0.4 for DOS/DJGPP
+ * PC/HW routine collection v1.0 for DOS/DJGPP
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
diff --git a/src/glut/dos/PC_HW/pc_mouse.c b/src/glut/dos/PC_HW/pc_mouse.c
index aa1fbe4da7..72d3886d5c 100644
--- a/src/glut/dos/PC_HW/pc_mouse.c
+++ b/src/glut/dos/PC_HW/pc_mouse.c
@@ -1,5 +1,5 @@
/*
- * PC/HW routine collection v0.4 for DOS/DJGPP
+ * PC/HW routine collection v1.0 for DOS/DJGPP
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
diff --git a/src/glut/dos/PC_HW/pc_timer.c b/src/glut/dos/PC_HW/pc_timer.c
index a8c58f6741..ec348e278b 100644
--- a/src/glut/dos/PC_HW/pc_timer.c
+++ b/src/glut/dos/PC_HW/pc_timer.c
@@ -1,5 +1,5 @@
/*
- * PC/HW routine collection v0.1 for DOS/DJGPP
+ * PC/HW routine collection v1.0 for DOS/DJGPP
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
diff --git a/src/glut/dos/callback.c b/src/glut/dos/callback.c
index 0e49c3adfe..a9260cbe7c 100644
--- a/src/glut/dos/callback.c
+++ b/src/glut/dos/callback.c
@@ -19,7 +19,7 @@
*/
/*
- * DOS/DJGPP glut driver v0.1 for Mesa 4.0
+ * DOS/DJGPP glut driver v1.0 for Mesa 4.0
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
diff --git a/src/glut/dos/color.c b/src/glut/dos/color.c
index b755459a3b..9a7754514c 100644
--- a/src/glut/dos/color.c
+++ b/src/glut/dos/color.c
@@ -19,7 +19,7 @@
*/
/*
- * DOS/DJGPP glut driver v0.1 for Mesa 4.0
+ * DOS/DJGPP glut driver v1.0 for Mesa 4.0
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
diff --git a/src/glut/dos/font.c b/src/glut/dos/font.c
index c1303ff6f4..1c31c15813 100644
--- a/src/glut/dos/font.c
+++ b/src/glut/dos/font.c
@@ -19,7 +19,7 @@
*/
/*
- * DOS/DJGPP glut driver v0.1 for Mesa 4.0
+ * DOS/DJGPP glut driver v1.0 for Mesa 4.0
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
diff --git a/src/glut/dos/globals.c b/src/glut/dos/globals.c
index 9bdfe8e0ce..342cf3d08f 100644
--- a/src/glut/dos/globals.c
+++ b/src/glut/dos/globals.c
@@ -19,7 +19,7 @@
*/
/*
- * DOS/DJGPP glut driver v0.1 for Mesa 4.0
+ * DOS/DJGPP glut driver v1.0 for Mesa 4.0
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
diff --git a/src/glut/dos/init.c b/src/glut/dos/init.c
index 9cda3a8b5b..a6d7e830b0 100644
--- a/src/glut/dos/init.c
+++ b/src/glut/dos/init.c
@@ -19,7 +19,7 @@
*/
/*
- * DOS/DJGPP glut driver v0.4 for Mesa 4.0
+ * DOS/DJGPP glut driver v1.0 for Mesa 4.0
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
diff --git a/src/glut/dos/internal.h b/src/glut/dos/internal.h
index 2822c2c5ab..e23d485b2e 100644
--- a/src/glut/dos/internal.h
+++ b/src/glut/dos/internal.h
@@ -19,7 +19,7 @@
*/
/*
- * DOS/DJGPP glut driver v0.2 for Mesa 4.0
+ * DOS/DJGPP glut driver v1.0 for Mesa 4.0
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
diff --git a/src/glut/dos/menu.c b/src/glut/dos/menu.c
index 48354edfe7..eccc51d2ea 100644
--- a/src/glut/dos/menu.c
+++ b/src/glut/dos/menu.c
@@ -19,7 +19,7 @@
*/
/*
- * DOS/DJGPP glut driver v0.1 for Mesa 4.0
+ * DOS/DJGPP glut driver v1.0 for Mesa 4.0
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
diff --git a/src/glut/dos/overlay.c b/src/glut/dos/overlay.c
index b2c392fcd4..ab4f561849 100644
--- a/src/glut/dos/overlay.c
+++ b/src/glut/dos/overlay.c
@@ -19,7 +19,7 @@
*/
/*
- * DOS/DJGPP glut driver v0.1 for Mesa 4.0
+ * DOS/DJGPP glut driver v1.0 for Mesa 4.0
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
diff --git a/src/glut/dos/state.c b/src/glut/dos/state.c
index 94ef0cac79..b463f4a109 100644
--- a/src/glut/dos/state.c
+++ b/src/glut/dos/state.c
@@ -19,7 +19,7 @@
*/
/*
- * DOS/DJGPP glut driver v0.2 for Mesa 4.0
+ * DOS/DJGPP glut driver v1.0 for Mesa 4.0
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
diff --git a/src/glut/dos/window.c b/src/glut/dos/window.c
index c110715ebb..f43533ce5f 100644
--- a/src/glut/dos/window.c
+++ b/src/glut/dos/window.c
@@ -19,7 +19,7 @@
*/
/*
- * DOS/DJGPP glut driver v0.2 for Mesa 4.0
+ * DOS/DJGPP glut driver v1.0 for Mesa 4.0
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
@@ -171,11 +171,24 @@ void APIENTRY glutSetIconTitle (const char *title)
void APIENTRY glutPositionWindow (int x, int y)
{
+ if (DMesaViewport(buffer[window], x, y, g_width, g_height)) {
+ g_xpos = x;
+ g_ypos = y;
+ }
}
void APIENTRY glutReshapeWindow (int width, int height)
{
+ if (DMesaViewport(buffer[window], g_xpos, g_ypos, width, height)) {
+ g_width = width;
+ g_height = height;
+ if (reshape_func) {
+ reshape_func(width, height);
+ } else {
+ glViewport(0, 0, width, height);
+ }
+ }
}