summaryrefslogtreecommitdiff
path: root/src/glut/dos/PC_HW
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2002-03-23 02:34:07 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2002-03-23 02:34:07 +0000
commite69bfe74d7f887fb516f300f575d43b9903d9ab3 (patch)
tree87e79df2f9aaaba93074607a084a67ea4c872c05 /src/glut/dos/PC_HW
parent6211144e056954f5b7a2d5c29f5a337154895217 (diff)
DOS/Mesa driver updates (Daniel Borca)
Diffstat (limited to 'src/glut/dos/PC_HW')
-rw-r--r--src/glut/dos/PC_HW/pc_keyb.c13
-rw-r--r--src/glut/dos/PC_HW/pc_mouse.c11
2 files changed, 20 insertions, 4 deletions
diff --git a/src/glut/dos/PC_HW/pc_keyb.c b/src/glut/dos/PC_HW/pc_keyb.c
index f5f4bd8e76..d3987d8e34 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.1 for DOS/DJGPP
+ * PC/HW routine collection v0.4 for DOS/DJGPP
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
@@ -32,7 +32,7 @@ static volatile struct {
static volatile int key_enhanced, key_pause_loop, key_shifts;
static int leds_ok = TRUE;
static int in_a_terrupt = FALSE;
-volatile char pc_key[KEY_MAX];
+static volatile char pc_key[KEY_MAX];
@@ -400,6 +400,10 @@ static int keyboard ()
}
if (((temp==0x4F)||(temp==0x53))&&(key_shifts&KB_CTRL_FLAG)&&(key_shifts&KB_ALT_FLAG)) {
+ /* Hack alert:
+ only SIGINT (but not Ctrl-Break)
+ calls the destructors and will safely clean up
+ */
__asm__("\n\
movb $0x79, %%al \n\
call ___djgpp_hw_exception \n\
@@ -436,6 +440,11 @@ int pc_readkey (void)
}
}
+int pc_keydown (int code)
+{
+ return pc_key[code];
+}
+
void pc_remove_keyb (void)
{
if (keyboard_installed) {
diff --git a/src/glut/dos/PC_HW/pc_mouse.c b/src/glut/dos/PC_HW/pc_mouse.c
index 2a692eceb6..aa1fbe4da7 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.2 for DOS/DJGPP
+ * PC/HW routine collection v0.4 for DOS/DJGPP
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
@@ -29,7 +29,7 @@ static void *mouse_stack;
static long mouse_callback;
static __dpmi_regs mouse_regs;
-volatile int pc_mouse_x, pc_mouse_y, pc_mouse_b;
+static volatile int pc_mouse_x, pc_mouse_y, pc_mouse_b;
static int minx = 0;
static int maxx = 319;
@@ -205,6 +205,13 @@ void pc_mouse_speed (int xspeed, int yspeed)
ENABLE();
}
+int pc_query_mouse (int *x, int *y)
+{
+ *x = pc_mouse_x;
+ *y = pc_mouse_y;
+ return pc_mouse_b;
+}
+
void pc_show_mouse (void)
{
/* not implemented */