DOS driver update
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
Mesa 4.0 DOS/DJGPP Port version 0.4
|
Mesa 4.0 DOS/DJGPP Port v1.0
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -20,11 +20,13 @@ MESA copyright applies.
|
|||||||
Installation:
|
Installation:
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
Type "make -f Makefile.DJ" to compile the libraries. Long filename support is
|
Type "make -f Makefile.DJ" to compile the libraries. Make accepts some options
|
||||||
required during compilation. Also, you must have the DXE2 package (available
|
which are passed to compiler: the target cpu (CPU=..., default=`pentium') and
|
||||||
on SimTel.Net, courtesy of Andrew Zabolotny) installed in order to build the
|
X86 specific options (HAVE_X86=1, HAVE_MMX=1, HAVE_SSE=1, HAVE_3DNOW=1). The
|
||||||
dynamic modules; if you encounter errors, you can fetch a patched version from
|
core library (libGL) requires LFN support during compilation. Also, you must
|
||||||
my web page.
|
have the DXE2 package (available on SimTel.Net, courtesy of Andrew Zabolotny)
|
||||||
|
installed in order to build the dynamic modules; if you encounter errors, you
|
||||||
|
can fetch a patched version from my web page.
|
||||||
The demos are not built automagically (see Pitfalls below). To make them, use
|
The demos are not built automagically (see Pitfalls below). To make them, use
|
||||||
one of the following rules:
|
one of the following rules:
|
||||||
Static:
|
Static:
|
||||||
@@ -72,7 +74,7 @@ Pitfalls:
|
|||||||
libGLU:
|
libGLU:
|
||||||
~~~~~~~
|
~~~~~~~
|
||||||
|
|
||||||
Mesa GLU sources are required. No comment!
|
Mesa GLU sources are required.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -118,20 +120,7 @@ However, the video mode is chosen in such a way that first window will fit.
|
|||||||
History:
|
History:
|
||||||
~~~~~~~~
|
~~~~~~~~
|
||||||
|
|
||||||
v0.1 feb-2002 initial release
|
v1.0 mar-2002 initial release
|
||||||
v0.2 feb-2002 + fast triangle rasterizers
|
|
||||||
+ enabled sw and 1.3 extensions
|
|
||||||
+ hardware acceleration: FreeBE/AF
|
|
||||||
+ single-buffer modes (15-, 16-, and 32-bit)
|
|
||||||
* video mode is set by CreateVisual, not MakeCurrent
|
|
||||||
* internal changes to support multi-buf (unfinished)
|
|
||||||
! fixed some alpha issues... (thanks, Brian)
|
|
||||||
+ glut has now an internal timer
|
|
||||||
* glut changed to support multi-window (unfinished)
|
|
||||||
! minor PC_HW corrections
|
|
||||||
v0.3 mar-2002 - removed FreeBE/AF code
|
|
||||||
- removed single-buffer modes
|
|
||||||
v0.4 mar-2002 + dynamic module support
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DOS/DJGPP device driver v0.2 for Mesa 4.0
|
* DOS/DJGPP device driver v1.0 for Mesa 4.0
|
||||||
*
|
*
|
||||||
* Copyright (C) 2002 - Borca Daniel
|
* Copyright (C) 2002 - Borca Daniel
|
||||||
* Email : dborca@yahoo.com
|
* Email : dborca@yahoo.com
|
||||||
@@ -62,6 +62,10 @@ DMesaContext DMesaCreateContext (DMesaVisual visual, DMesaContext share);
|
|||||||
|
|
||||||
void DMesaDestroyContext (DMesaContext c);
|
void DMesaDestroyContext (DMesaContext c);
|
||||||
|
|
||||||
|
GLboolean DMesaViewport (DMesaBuffer b,
|
||||||
|
GLint xpos, GLint ypos,
|
||||||
|
GLint width, GLint height);
|
||||||
|
|
||||||
GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b);
|
GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b);
|
||||||
|
|
||||||
void DMesaSwapBuffers (DMesaBuffer b);
|
void DMesaSwapBuffers (DMesaBuffer b);
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 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.
|
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
# DOS/DJGPP glu makefile v0.4 for Mesa 4.0
|
# DOS/DJGPP glu makefile v1.0 for Mesa 4.0
|
||||||
#
|
#
|
||||||
# Copyright (C) 2002 - Borca Daniel
|
# Copyright (C) 2002 - Borca Daniel
|
||||||
# Email : dborca@yahoo.com
|
# Email : dborca@yahoo.com
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
TOP = ..
|
TOP = ..
|
||||||
CC = gcc
|
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
|
AR = ar
|
||||||
ARFLAGS = ruv
|
ARFLAGS = ruv
|
||||||
LIBDIR = $(TOP)/lib
|
LIBDIR = $(TOP)/lib
|
||||||
@@ -73,10 +73,10 @@ $(LIBDIR)/$(GLU_LIB): $(OBJECTS)
|
|||||||
|
|
||||||
$(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP): $(OBJECTS)
|
$(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP): $(OBJECTS)
|
||||||
ifeq ($(DXE2GEN),)
|
ifeq ($(DXE2GEN),)
|
||||||
@echo Missing DXE2GEN and/or DXE2.LD! You must have DXE2GEN
|
$(warning Missing DXE2GEN and/or DXE2.LD! You must have DXE2GEN)
|
||||||
@echo somewhere in PATH, and DXE2.LD in DJGPP/LIB directory.
|
$(warning somewhere in PATH, and DXE2.LD in DJGPP/LIB directory.)
|
||||||
else
|
else
|
||||||
dxe2gen -o $(LIBDIR)/$(GLU_DXE) -I $(LIBDIR)/$(GLU_IMP) $(OBJECTS) -D "Glu" -U
|
dxe2gen -o $(LIBDIR)/$(GLU_DXE) -I $(LIBDIR)/$(GLU_IMP) $(OBJECTS) -D "Mesa DOS GLU" -U
|
||||||
endif
|
endif
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 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.
|
# 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
|
# Copyright (C) 2002 - Borca Daniel
|
||||||
# Email : dborca@yahoo.com
|
# Email : dborca@yahoo.com
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
TOP = ..
|
TOP = ..
|
||||||
CC = gcc
|
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
|
AR = ar
|
||||||
ARFLAGS = ruv
|
ARFLAGS = ruv
|
||||||
LIBDIR = $(TOP)/lib
|
LIBDIR = $(TOP)/lib
|
||||||
@@ -59,23 +59,23 @@ CORE_SOURCES = \
|
|||||||
teapot.c \
|
teapot.c \
|
||||||
window.c
|
window.c
|
||||||
|
|
||||||
PC_HW_OBJECTS = \
|
PC_HW_SOURCES = \
|
||||||
PC_HW/pc_hw.o \
|
PC_HW/pc_hw.c \
|
||||||
PC_HW/pc_keyb.o \
|
PC_HW/pc_keyb.c \
|
||||||
PC_HW/pc_mouse.o \
|
PC_HW/pc_mouse.c \
|
||||||
PC_HW/pc_timer.o \
|
PC_HW/pc_timer.c \
|
||||||
PC_HW/pc_irq.o
|
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:
|
.S.o:
|
||||||
gcc -o $@ -c $(CFLAGS) $<
|
gcc -o $@ -c $(CFLAGS) $<
|
||||||
.s.o:
|
.s.o:
|
||||||
gcc -o $@ -c $(CFLAGS) $(<:.s=.S)
|
gcc -o $@ -c $(CFLAGS) $(<:.s=.S)
|
||||||
.c.o:
|
|
||||||
gcc -o $@ -c $(CFLAGS) $<
|
|
||||||
|
|
||||||
all: $(LIBDIR)/$(GLUT_LIB) $(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP)
|
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)
|
$(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP): $(OBJECTS)
|
||||||
ifeq ($(DXE2GEN),)
|
ifeq ($(DXE2GEN),)
|
||||||
@echo Missing DXE2GEN and/or DXE2.LD! You must have DXE2GEN
|
$(warning Missing DXE2GEN and/or DXE2.LD! You must have DXE2GEN)
|
||||||
@echo somewhere in PATH, and DXE2.LD in DJGPP/LIB directory.
|
$(warning somewhere in PATH, and DXE2.LD in DJGPP/LIB directory.)
|
||||||
else
|
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
|
endif
|
||||||
|
|
||||||
clean:
|
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
|
menu.o: menu.c ../include/GL/glut.h
|
||||||
models.o: models.c ../include/GL/glut.h
|
models.o: models.c ../include/GL/glut.h
|
||||||
overlay.o: overlay.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
|
teapot.o: teapot.c ../include/GL/glut.h
|
||||||
window.o: window.c ../include/GL/glut.h ../include/GL/dmesa.h internal.h \
|
window.o: window.c ../include/GL/glut.h ../include/GL/dmesa.h internal.h \
|
||||||
PC_HW/pc_hw.h
|
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
|
* Copyright (C) 2002 - Borca Daniel
|
||||||
* Email : dborca@yahoo.com
|
* Email : dborca@yahoo.com
|
||||||
|
@@ -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
|
* Copyright (C) 2002 - Borca Daniel
|
||||||
* Email : dborca@yahoo.com
|
* Email : dborca@yahoo.com
|
||||||
@@ -189,12 +189,11 @@ extern int pc_remove_irq (int i);
|
|||||||
|
|
||||||
#define KEY_MAX 115
|
#define KEY_MAX 115
|
||||||
|
|
||||||
extern volatile char pc_key[KEY_MAX];
|
|
||||||
|
|
||||||
int pc_install_keyb (void);
|
int pc_install_keyb (void);
|
||||||
void pc_remove_keyb (void);
|
void pc_remove_keyb (void);
|
||||||
int pc_keypressed (void);
|
int pc_keypressed (void);
|
||||||
int pc_readkey (void);
|
int pc_readkey (void);
|
||||||
|
int pc_keydown (int code);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* timer
|
* timer
|
||||||
@@ -205,13 +204,12 @@ void pc_remove_timer (void);
|
|||||||
/*
|
/*
|
||||||
* mouse
|
* mouse
|
||||||
*/
|
*/
|
||||||
extern volatile int pc_mouse_x, pc_mouse_y, pc_mouse_b;
|
|
||||||
|
|
||||||
int pc_install_mouse (void);
|
int pc_install_mouse (void);
|
||||||
void pc_remove_mouse (void);
|
void pc_remove_mouse (void);
|
||||||
MFUNC pc_install_mouse_handler (MFUNC handler);
|
MFUNC pc_install_mouse_handler (MFUNC handler);
|
||||||
void pc_mouse_area (int x1, int y1, int x2, int y2);
|
void pc_mouse_area (int x1, int y1, int x2, int y2);
|
||||||
void pc_mouse_speed (int xspeed, int yspeed);
|
void pc_mouse_speed (int xspeed, int yspeed);
|
||||||
|
int pc_query_mouse (int *x, int *y);
|
||||||
void pc_show_mouse (void);
|
void pc_show_mouse (void);
|
||||||
void pc_scare_mouse (void);
|
void pc_scare_mouse (void);
|
||||||
void pc_unscare_mouse (void);
|
void pc_unscare_mouse (void);
|
||||||
|
@@ -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
|
* Copyright (C) 2002 - Borca Daniel
|
||||||
* Email : dborca@yahoo.com
|
* Email : dborca@yahoo.com
|
||||||
|
@@ -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
|
* Copyright (C) 2002 - Borca Daniel
|
||||||
* Email : dborca@yahoo.com
|
* Email : dborca@yahoo.com
|
||||||
|
@@ -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
|
* Copyright (C) 2002 - Borca Daniel
|
||||||
* Email : dborca@yahoo.com
|
* Email : dborca@yahoo.com
|
||||||
|
@@ -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
|
* Copyright (C) 2002 - Borca Daniel
|
||||||
* Email : dborca@yahoo.com
|
* Email : dborca@yahoo.com
|
||||||
|
@@ -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
|
* Copyright (C) 2002 - Borca Daniel
|
||||||
* Email : dborca@yahoo.com
|
* Email : dborca@yahoo.com
|
||||||
|
@@ -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
|
* Copyright (C) 2002 - Borca Daniel
|
||||||
* Email : dborca@yahoo.com
|
* Email : dborca@yahoo.com
|
||||||
|
@@ -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
|
* Copyright (C) 2002 - Borca Daniel
|
||||||
* Email : dborca@yahoo.com
|
* Email : dborca@yahoo.com
|
||||||
|
@@ -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
|
* Copyright (C) 2002 - Borca Daniel
|
||||||
* Email : dborca@yahoo.com
|
* Email : dborca@yahoo.com
|
||||||
|
@@ -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
|
* Copyright (C) 2002 - Borca Daniel
|
||||||
* Email : dborca@yahoo.com
|
* Email : dborca@yahoo.com
|
||||||
|
@@ -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
|
* Copyright (C) 2002 - Borca Daniel
|
||||||
* Email : dborca@yahoo.com
|
* Email : dborca@yahoo.com
|
||||||
|
@@ -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
|
* Copyright (C) 2002 - Borca Daniel
|
||||||
* Email : dborca@yahoo.com
|
* Email : dborca@yahoo.com
|
||||||
|
@@ -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
|
* Copyright (C) 2002 - Borca Daniel
|
||||||
* Email : dborca@yahoo.com
|
* Email : dborca@yahoo.com
|
||||||
|
@@ -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
|
* Copyright (C) 2002 - Borca Daniel
|
||||||
* Email : dborca@yahoo.com
|
* Email : dborca@yahoo.com
|
||||||
|
@@ -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
|
* Copyright (C) 2002 - Borca Daniel
|
||||||
* Email : dborca@yahoo.com
|
* Email : dborca@yahoo.com
|
||||||
@@ -171,11 +171,24 @@ void APIENTRY glutSetIconTitle (const char *title)
|
|||||||
|
|
||||||
void APIENTRY glutPositionWindow (int x, int y)
|
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)
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DOS/DJGPP device driver v0.3 for Mesa 4.0
|
* DOS/DJGPP device driver v1.0 for Mesa 4.0
|
||||||
*
|
*
|
||||||
* Copyright (C) 2002 - Borca Daniel
|
* Copyright (C) 2002 - Borca Daniel
|
||||||
* Email : dborca@yahoo.com
|
* Email : dborca@yahoo.com
|
||||||
@@ -76,9 +76,10 @@ struct dmesa_visual {
|
|||||||
* Add system-specific fields to it.
|
* Add system-specific fields to it.
|
||||||
*/
|
*/
|
||||||
struct dmesa_buffer {
|
struct dmesa_buffer {
|
||||||
GLframebuffer *gl_buffer; /* The depth, stencil, accum, etc buffers */
|
GLframebuffer gl_buffer; /* The depth, stencil, accum, etc buffers */
|
||||||
void *the_window; /* your window handle, etc */
|
void *the_window; /* your window handle, etc */
|
||||||
|
|
||||||
|
int bypp; /* bytes per pixel */
|
||||||
int xpos, ypos; /* position */
|
int xpos, ypos; /* position */
|
||||||
int width, height; /* size in pixels */
|
int width, height; /* size in pixels */
|
||||||
int bwidth, len; /* bytes in a line, then total */
|
int bwidth, len; /* bytes in a line, then total */
|
||||||
@@ -540,12 +541,12 @@ static GLboolean set_draw_buffer (GLcontext *ctx, GLenum mode)
|
|||||||
* If anything special has to been done when the buffer/window is
|
* If anything special has to been done when the buffer/window is
|
||||||
* resized, do it now.
|
* resized, do it now.
|
||||||
*/
|
*/
|
||||||
static void get_buffer_size (GLcontext *ctx, GLuint *width, GLuint *height)
|
static void get_buffer_size (GLframebuffer *buffer, GLuint *width, GLuint *height)
|
||||||
{
|
{
|
||||||
DMesaContext c = (DMesaContext)ctx->DriverCtx;
|
DMesaBuffer b = (DMesaBuffer)buffer;
|
||||||
|
|
||||||
*width = c->Buffer->width;
|
*width = b->width;
|
||||||
*height = c->Buffer->height;
|
*height = b->height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -554,7 +555,7 @@ static const GLubyte* get_string (GLcontext *ctx, GLenum name)
|
|||||||
{
|
{
|
||||||
switch (name) {
|
switch (name) {
|
||||||
case GL_RENDERER:
|
case GL_RENDERER:
|
||||||
return (const GLubyte *)"DOS Mesa";
|
return (const GLubyte *)"Mesa DOS\0DJGPP port (c) Borca Daniel 31-mar-2002";
|
||||||
default:
|
default:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -636,7 +637,7 @@ void dmesa_init_pointers (GLcontext *ctx)
|
|||||||
ctx->Driver.Accum = _swrast_Accum;
|
ctx->Driver.Accum = _swrast_Accum;
|
||||||
ctx->Driver.Bitmap = _swrast_Bitmap;
|
ctx->Driver.Bitmap = _swrast_Bitmap;
|
||||||
ctx->Driver.Clear = clear;
|
ctx->Driver.Clear = clear;
|
||||||
ctx->Driver.ResizeBuffersMESA = _swrast_alloc_buffers;
|
ctx->Driver.ResizeBuffers = _swrast_alloc_buffers;
|
||||||
ctx->Driver.CopyPixels = _swrast_CopyPixels;
|
ctx->Driver.CopyPixels = _swrast_CopyPixels;
|
||||||
ctx->Driver.DrawPixels = _swrast_DrawPixels;
|
ctx->Driver.DrawPixels = _swrast_DrawPixels;
|
||||||
ctx->Driver.ReadPixels = _swrast_ReadPixels;
|
ctx->Driver.ReadPixels = _swrast_ReadPixels;
|
||||||
@@ -804,17 +805,17 @@ DMesaBuffer DMesaCreateBuffer (DMesaVisual visual,
|
|||||||
|
|
||||||
if ((b=(DMesaBuffer)calloc(1, sizeof(struct dmesa_buffer)))!=NULL) {
|
if ((b=(DMesaBuffer)calloc(1, sizeof(struct dmesa_buffer)))!=NULL) {
|
||||||
|
|
||||||
b->gl_buffer = _mesa_create_framebuffer(visual->gl_visual,
|
_mesa_initialize_framebuffer(&b->gl_buffer,
|
||||||
visual->gl_visual->depthBits > 0,
|
visual->gl_visual,
|
||||||
visual->gl_visual->stencilBits > 0,
|
visual->gl_visual->depthBits > 0,
|
||||||
visual->gl_visual->accumRedBits > 0,
|
visual->gl_visual->stencilBits > 0,
|
||||||
visual->gl_visual->alphaBits > 0);
|
visual->gl_visual->accumRedBits > 0,
|
||||||
|
visual->gl_visual->alphaBits > 0);
|
||||||
b->xpos = xpos;
|
b->xpos = xpos;
|
||||||
b->ypos = ypos;
|
b->ypos = ypos;
|
||||||
b->width = width;
|
b->width = width;
|
||||||
b->bwidth = width * ((visual->depth+7)/8);
|
|
||||||
b->height = height;
|
b->height = height;
|
||||||
b->len = b->bwidth * b->height;
|
b->bypp = (visual->depth+7)/8;
|
||||||
}
|
}
|
||||||
|
|
||||||
return b;
|
return b;
|
||||||
@@ -825,7 +826,7 @@ DMesaBuffer DMesaCreateBuffer (DMesaVisual visual,
|
|||||||
void DMesaDestroyBuffer (DMesaBuffer b)
|
void DMesaDestroyBuffer (DMesaBuffer b)
|
||||||
{
|
{
|
||||||
free(b->the_window);
|
free(b->the_window);
|
||||||
_mesa_destroy_framebuffer(b->gl_buffer);
|
_mesa_free_framebuffer_data(&b->gl_buffer);
|
||||||
free(b);
|
free(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -871,23 +872,45 @@ void DMesaDestroyContext (DMesaContext c)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
GLboolean DMesaViewport (DMesaBuffer b,
|
||||||
|
GLint xpos, GLint ypos,
|
||||||
|
GLint width, GLint height)
|
||||||
|
{
|
||||||
|
void *new_window;
|
||||||
|
|
||||||
|
if ((new_window=vl_sync_buffer(b->the_window, xpos, ypos, width, height))==NULL) {
|
||||||
|
return GL_FALSE;
|
||||||
|
} else {
|
||||||
|
b->the_window = new_window;
|
||||||
|
b->xpos = xpos;
|
||||||
|
b->ypos = ypos;
|
||||||
|
b->width = width;
|
||||||
|
b->height = height;
|
||||||
|
b->bwidth = width * b->bypp;
|
||||||
|
b->len = b->bwidth * height;
|
||||||
|
return GL_TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Make the specified context and buffer the current one.
|
* Make the specified context and buffer the current one.
|
||||||
*/
|
*/
|
||||||
GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b)
|
GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b)
|
||||||
{
|
{
|
||||||
if (c&&b) {
|
if (c&&b) {
|
||||||
if ((b->the_window=vl_sync_buffer(b->the_window, b->xpos, b->ypos, b->width, b->height))==NULL) {
|
if (!DMesaViewport(b, b->xpos, b->ypos, b->width, b->height)) {
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
c->Buffer = b;
|
c->Buffer = b;
|
||||||
|
|
||||||
dmesa_update_state(c->gl_ctx, 0);
|
dmesa_update_state(c->gl_ctx, 0);
|
||||||
_mesa_make_current(c->gl_ctx, b->gl_buffer);
|
_mesa_make_current(c->gl_ctx, &b->gl_buffer);
|
||||||
if (c->gl_ctx->Viewport.Width==0) {
|
if (c->gl_ctx->Viewport.Width==0) {
|
||||||
/* initialize viewport to window size */
|
/* initialize viewport to window size */
|
||||||
_mesa_Viewport(0, 0, c->Buffer->width, c->Buffer->height);
|
_mesa_Viewport(0, 0, b->width, b->height);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Detach */
|
/* Detach */
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DOS/DJGPP device driver v0.3 for Mesa 4.0
|
* DOS/DJGPP device driver v1.0 for Mesa 4.0
|
||||||
*
|
*
|
||||||
* Copyright (C) 2002 - Borca Daniel
|
* Copyright (C) 2002 - Borca Daniel
|
||||||
* Email : dborca@yahoo.com
|
* Email : dborca@yahoo.com
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DOS/DJGPP device driver v0.3 for Mesa 4.0
|
* DOS/DJGPP device driver v1.0 for Mesa 4.0
|
||||||
*
|
*
|
||||||
* Copyright (C) 2002 - Borca Daniel
|
* Copyright (C) 2002 - Borca Daniel
|
||||||
* Email : dborca@yahoo.com
|
* Email : dborca@yahoo.com
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DOS/DJGPP device driver v0.4 for Mesa 4.0
|
* DOS/DJGPP device driver v1.0 for Mesa 4.0
|
||||||
*
|
*
|
||||||
* Copyright (C) 2002 - Borca Daniel
|
* Copyright (C) 2002 - Borca Daniel
|
||||||
* Email : dborca@yahoo.com
|
* Email : dborca@yahoo.com
|
||||||
@@ -416,14 +416,12 @@ void *vl_sync_buffer (void *buffer, int x, int y, int width, int height)
|
|||||||
if (width&3) {
|
if (width&3) {
|
||||||
return NULL;
|
return NULL;
|
||||||
} else {
|
} else {
|
||||||
current_offset = video_scanlen * y + video_bypp * x;
|
|
||||||
if ((newbuf=realloc(buffer, width*height*video_bypp))!=NULL) {
|
if ((newbuf=realloc(buffer, width*height*video_bypp))!=NULL) {
|
||||||
|
current_offset = video_scanlen * y + video_bypp * x;
|
||||||
current_width = width;
|
current_width = width;
|
||||||
current_delta = video_scanlen - video_bypp * width;
|
current_delta = video_scanlen - video_bypp * width;
|
||||||
return newbuf;
|
|
||||||
} else {
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
return newbuf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DOS/DJGPP device driver v0.4 for Mesa 4.0
|
* DOS/DJGPP device driver v1.0 for Mesa 4.0
|
||||||
*
|
*
|
||||||
* Copyright (C) 2002 - Borca Daniel
|
* Copyright (C) 2002 - Borca Daniel
|
||||||
* Email : dborca@yahoo.com
|
* Email : dborca@yahoo.com
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 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.
|
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
# DOS/DJGPP core makefile v0.4 for Mesa 4.0
|
# DOS/DJGPP core makefile v1.0 for Mesa 4.0
|
||||||
#
|
#
|
||||||
# Copyright (C) 2002 - Borca Daniel
|
# Copyright (C) 2002 - Borca Daniel
|
||||||
# Email : dborca@yahoo.com
|
# Email : dborca@yahoo.com
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
TOP = ..
|
TOP = ..
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -I$(TOP)/include -I. -Wall -W -Wno-unused -mcpu=pentium -ffast-math -O2
|
CFLAGS = -I$(TOP)/include -I. -Wall -W -Wno-unused -mcpu=$(CPU) -ffast-math -O2
|
||||||
AR = ar
|
AR = ar
|
||||||
ARFLAGS = ruv
|
ARFLAGS = ruv
|
||||||
LIBDIR = $(TOP)/lib
|
LIBDIR = $(TOP)/lib
|
||||||
@@ -165,14 +165,65 @@ CORE_SOURCES = \
|
|||||||
tnl/t_vb_texmat.c \
|
tnl/t_vb_texmat.c \
|
||||||
tnl/t_vb_vertex.c
|
tnl/t_vb_vertex.c
|
||||||
|
|
||||||
|
X86_SOURCES = \
|
||||||
|
X86/x86.c \
|
||||||
|
X86/glapi_x86.S \
|
||||||
|
X86/common_x86.c \
|
||||||
|
X86/common_x86_asm.S \
|
||||||
|
X86/x86_xform2.S \
|
||||||
|
X86/x86_xform3.S \
|
||||||
|
X86/x86_xform4.S \
|
||||||
|
X86/x86_vertex.S \
|
||||||
|
X86/x86_cliptest.S
|
||||||
|
|
||||||
|
MMX_SOURCES =
|
||||||
|
|
||||||
|
SSE_SOURCES = \
|
||||||
|
X86/sse.c \
|
||||||
|
X86/sse_xform2.S \
|
||||||
|
X86/sse_xform3.S \
|
||||||
|
X86/sse_xform4.S \
|
||||||
|
X86/sse_vertex.S \
|
||||||
|
X86/sse_normal.S
|
||||||
|
|
||||||
|
D3NOW_SOURCES = \
|
||||||
|
X86/3dnow.c \
|
||||||
|
X86/3dnow_xform2.S \
|
||||||
|
X86/3dnow_xform3.S \
|
||||||
|
X86/3dnow_xform4.S \
|
||||||
|
X86/3dnow_vertex.S
|
||||||
|
|
||||||
|
ifdef HAVE_MMX
|
||||||
|
X86_SOURCES += $(MMX_SOURCES)
|
||||||
|
CFLAGS += -DUSE_MMX_ASM
|
||||||
|
HAVE_X86 = 1
|
||||||
|
endif
|
||||||
|
ifdef HAVE_SSE
|
||||||
|
X86_SOURCES += $(SSE_SOURCES)
|
||||||
|
CFLAGS += -DUSE_SSE_ASM
|
||||||
|
HAVE_X86 = 1
|
||||||
|
endif
|
||||||
|
ifdef HAVE_3DNOW
|
||||||
|
X86_SOURCES += $(D3NOW_SOURCES)
|
||||||
|
CFLAGS += -DUSE_3DNOW_ASM
|
||||||
|
HAVE_X86 = 1
|
||||||
|
endif
|
||||||
|
ifdef HAVE_X86
|
||||||
|
CFLAGS += -DUSE_X86_ASM
|
||||||
|
else
|
||||||
|
X86_SOURCES =
|
||||||
|
endif
|
||||||
|
|
||||||
DRIVER_SOURCES = DOS/dmesa.c DOS/video.c DOS/dpmi.c
|
DRIVER_SOURCES = DOS/dmesa.c DOS/video.c DOS/dpmi.c
|
||||||
|
|
||||||
SOURCES = $(CORE_SOURCES) $(DRIVER_SOURCES)
|
SOURCES = $(CORE_SOURCES) $(X86_SOURCES) $(DRIVER_SOURCES)
|
||||||
|
|
||||||
OBJECTS = $(SOURCES:.c=.o)
|
OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
|
||||||
|
|
||||||
.c.o:
|
.c.o:
|
||||||
gcc -o $@ -c $(CFLAGS) $<
|
gcc -o $@ -c $(CFLAGS) $<
|
||||||
|
.S.o:
|
||||||
|
gcc -o $@ -c $(CFLAGS) $<
|
||||||
|
|
||||||
all: $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP)
|
all: $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP)
|
||||||
|
|
||||||
@@ -181,21 +232,24 @@ $(LIBDIR)/$(GL_LIB): $(OBJECTS)
|
|||||||
|
|
||||||
$(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP): $(OBJECTS)
|
$(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP): $(OBJECTS)
|
||||||
ifeq ($(DXE2GEN),)
|
ifeq ($(DXE2GEN),)
|
||||||
@echo Missing DXE2GEN and/or DXE2.LD! You must have DXE2GEN
|
$(warning Missing DXE2GEN and/or DXE2.LD! You must have DXE2GEN)
|
||||||
@echo somewhere in PATH, and DXE2.LD in DJGPP/LIB directory.
|
$(warning somewhere in PATH, and DXE2.LD in DJGPP/LIB directory.)
|
||||||
else
|
else
|
||||||
dxe2gen -o $(LIBDIR)/$(GL_DXE) -I $(LIBDIR)/$(GL_IMP) $(OBJECTS) -D "DOS Mesa" -U
|
dxe2gen -o $(LIBDIR)/$(GL_DXE) -I $(LIBDIR)/$(GL_IMP) $(OBJECTS) -D "Mesa DOS GL" -U
|
||||||
endif
|
endif
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-$(RM) *.o
|
-$(RM) *.o
|
||||||
|
ifdef HAVE_X86
|
||||||
|
-$(RM) X86\*.o
|
||||||
|
endif
|
||||||
-$(RM) DOS\*.o
|
-$(RM) DOS\*.o
|
||||||
|
|
||||||
include depend
|
include depend
|
||||||
|
|
||||||
DOS/dmesa.o: DOS/dmesa.c glheader.h ../include/GL/gl.h context.h glapi.h \
|
DOS/dmesa.o: DOS/dmesa.c glheader.h ../include/GL/gl.h context.h glapi.h \
|
||||||
mtypes.h config.h glapitable.h glthread.h math/m_matrix.h dd.h \
|
mtypes.h config.h glapitable.h glthread.h math/m_matrix.h dd.h macros.h \
|
||||||
../include/GL/dmesa.h extensions.h macros.h matrix.h mmath.h texformat.h \
|
../include/GL/dmesa.h extensions.h matrix.h mmath.h texformat.h \
|
||||||
texstore.h array_cache/acache.h swrast/s_context.h swrast/swrast.h \
|
texstore.h array_cache/acache.h swrast/s_context.h swrast/swrast.h \
|
||||||
swrast/s_depth.h swrast/s_lines.h swrast/s_triangle.h swrast/s_trispan.h \
|
swrast/s_depth.h swrast/s_lines.h swrast/s_triangle.h swrast/s_trispan.h \
|
||||||
swrast_setup/swrast_setup.h tnl/tnl.h tnl/t_context.h math/m_vector.h \
|
swrast_setup/swrast_setup.h tnl/tnl.h tnl/t_context.h math/m_vector.h \
|
||||||
|
Reference in New Issue
Block a user