# DOS/DJGPP makefile v1.4 for Mesa
#
# Copyright (C) 2002 - Borca Daniel
-# Email : dborca@yahoo.com
+# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
# Environment variables:
# CPU optimize for the given processor.
-# default = k6
+# default = pentium
# GLU=[mesa|sgi] specify GLU directory; can be `sgi' (requires GNU/C++)
# or `mesa'.
# default = mesa
-# GLIDE path to Glide3 SDK include files; used with FX.
-# default = $(TOP)/include/glide3
+# GLIDE path to Glide3 SDK; used with FX.
+# default = $(TOP)/glide3
# FX=1 build for 3dfx Glide3. Note that this disables
# compilation of most DMesa code and requires fxMesa.
# As a consequence, you'll need the DJGPP Glide3
.PHONY : all libgl libglu libglut clean realclean
-CPU ?= k6
+CPU ?= pentium
GLU ?= mesa
#
# Environment variables:
# CPU optimize for the given processor.
-# default = k6
+# default = pentium
# GLIDE path to Glide3 SDK; used with FX.
# default = $(TOP)/glide3
# FX=1 build for 3dfx Glide3. Note that this disables
.PHONY : all libgl clean realclean
-CPU ?= k6
+CPU ?= pentium
CFLAGS = -Wall -W -pedantic
CFLAGS += -O2 -ffast-math -mcpu=$(CPU)
Environment variables:
CPU optimize for the given processor.
- default = k6
+ default = pentium
GLU=[mesa|sgi] specify GLU directory; can be `sgi' (requires GNU/C++)
or `mesa'.
default = mesa
- GLIDE path to Glide3 SDK include files; used with FX.
- default = $(TOP)/include/glide3
+ GLIDE path to Glide3 SDK; used with FX.
+ default = $(TOP)/glide3
FX=1 build for 3dfx Glide3. Note that this disables
compilation of most DMesa code and requires fxMesa.
As a consequence, you'll need the DJGPP Glide3
CPU: AMD Athlon XP 1800+
Mainboard: EP-8KTA3 w/ 128 MB SDRAM
Video card: Voodoo5 5500 AGP w/ 64 MB SDRAM
- DJGPP: djdev 2.04 + gcc v3.2.2 + make v3.79.1
+ DJGPP: djdev 2.04 + gcc v3.2.2 + make v3.80
OS: DOS and Win98SE
lazy programmer and I found that the easiest way to keep buffer handling
at peak performance ;-).
- Q) My demo doesn't display text. I know I used the GLUT font routines!
- A) Then you probably use GLUT as a DXE. Well, there is no direct access to
- variables due to the way DXE works. Read the documentation. The author of
- GLUT took this into account for _WIN32 DLL's only; I don't want to modify
- his headers. The only workaround is to link GLUT the old way :-(
-
Q) The GLUT is incomplete.
A) See below.
position right before the main loop.
The following environment variables can customize GLUT behaviour:
+ GLUT_FPS - print frames/second statistics to stderr
DMESA_GLUT_REFRESH - set vertical screen refresh rate (VESA3)
DMESA_GLUT_BPP - set default bits per pixel (VGA needs 8)
- GLUT_FPS - print frames/second statistics to stderr
+ DMESA_GLUT_DEPTH - set default depth bits
+ DMESA_GLUT_STENCIL - set default stencil bits
+ DMESA_GLUT_ACCUM - set default accum bits
* revamped GLUT
* switched to DXE3
-v1.4 (jun-2003)
+v1.4 (aug-2003)
+ + enabled fonts with DXE
+ + truly added multi-window support in GLUT
* accomodated makefiles with the new sourcetree
+ * hacked and slashed the 3dfx driver (w/ help from Hiroshi Morii)
~~~~~~~~
Name: Borca Daniel
-E-mail: dborca@yahoo.com
+E-mail: dborca@users.sourceforge.net
WWW: http://www.geocities.com/dborca/
*/
/*
- * DOS/DJGPP device driver v1.3 for Mesa
+ * DOS/DJGPP device driver v1.4 for Mesa
*
* Copyright (C) 2002 - Borca Daniel
- * Email : dborca@yahoo.com
+ * Email : dborca@users.sourceforge.net
* Web : http://www.geocities.com/dborca
*/
/*
* Return a handle to the current context.
*/
-DMesaContext DMesaGetCurrentContext (void);
+void *DMesaGetCurrentContext (void);
GLAPI void GLAPIENTRY fxMesaMakeCurrent(fxMesaContext ctx);
-GLAPI fxMesaContext GLAPIENTRY fxMesaGetCurrentContext(void);
+GLAPI void * GLAPIENTRY fxMesaGetCurrentContext(void);
GLAPI void GLAPIENTRY fxMesaSwapBuffers(void);
GLAPI void GLAPIENTRY fxCloseHardware(void);
+GLAPI void GLAPIENTRY fxGetScreenGeometry (GLint *w, GLint *h);
+
#if defined (__BEOS__)
#pragma export off
#define GLUT_NORMAL 0
#define GLUT_OVERLAY 1
-#if defined(_WIN32)
+#if defined(_WIN32) || defined (GLUT_IMPORT_LIB)
/* Stroke font constants (use these in GLUT program). */
#define GLUT_STROKE_ROMAN ((void*)0)
#define GLUT_STROKE_MONO_ROMAN ((void*)1)
# DOS/DJGPP samples makefile v1.4 for Mesa
#
# Copyright (C) 2002 - Borca Daniel
-# Email : dborca@yahoo.com
+# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
# Environment variables:
# CPU optimize for the given processor.
-# default = k6
-# GLIDE path to Glide3 SDK library files; used with FX.
-# default = $(TOP)/lib/glide3
+# default = pentium
+# GLIDE path to Glide3 SDK; used with FX.
+# default = $(TOP)/glide3
# FX=1 build for 3dfx Glide3. Note that this disables
# compilation of most DMesa code and requires fxMesa.
# As a consequence, you'll need the DJGPP Glide3
.SUFFIXES : .c .o .exe
TOP = ../..
-CPU ?= k6
-GLIDE ?= $(TOP)/lib/glide3
+CPU ?= pentium
+GLIDE ?= $(TOP)/glide3
CC = gcc
CFLAGS = -Wall -W -pedantic
CFLAGS += -O2 -ffast-math -mcpu=$(CPU)
CFLAGS += -I$(TOP)/include -I../util
+CFLAGS += -DGLUT_IMPORT_LIB
LD = gxx
LDFLAGS = -s -L$(TOP)/lib
else
LDLIBS = -lglut -lglu -lgl
ifeq ($(FX),1)
-LDFLAGS += -L$(GLIDE)
+LDFLAGS += -L$(GLIDE)/lib
LDLIBS += -lglid3
endif
endif
# DOS/DJGPP glu makefile v1.4 for Mesa
#
# Copyright (C) 2002 - Borca Daniel
-# Email : dborca@yahoo.com
+# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
GLU_DXE = glu.dxe
GLU_IMP = libiglu.a
-export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR)
+export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR);$(GLIDE)/lib
CC = gcc
CFLAGS += -I$(TOP)/include
all: $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP)
$(LIBDIR)/$(GLU_LIB): $(OBJECTS)
- $(AR) $(ARFLAGS) $(LIBDIR)/$(GLU_LIB) $(OBJECTS)
+ $(AR) $(ARFLAGS) $@ $^
$(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP): $(OBJECTS)
ifeq ($(HAVEDXE3),)
$(warning Missing DXE3 package... Skipping $(GLU_DXE))
else
- -dxe3gen -o $(LIBDIR)/$(GLU_DXE) -Y $(LIBDIR)/$(GLU_IMP) -D "MesaGLU DJGPP" -E _glu -P gl.dxe -U $(OBJECTS)
+ -dxe3gen -o $(LIBDIR)/$(GLU_DXE) -Y $(LIBDIR)/$(GLU_IMP) -D "MesaGLU DJGPP" -E _glu -P gl.dxe -U $^
endif
clean:
-$(call UNLINK,*.o)
-
--include depend
# DOS/DJGPP glu makefile v1.4 for Mesa
#
# Copyright (C) 2002 - Borca Daniel
-# Email : dborca@yahoo.com
+# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
GLU_DXE = glu.dxe
GLU_IMP = libiglu.a
-export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR)
+export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR);$(GLIDE)/lib
CC = gcc
CFLAGS += -DNDEBUG -DLIBRARYBUILD -I$(TOP)/include -Iinclude
all: $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP)
$(LIBDIR)/$(GLU_LIB): $(OBJECTS)
- $(AR) $(ARFLAGS) $(LIBDIR)/$(GLU_LIB) $(OBJECTS)
+ $(AR) $(ARFLAGS) $@ $^
$(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP): $(OBJECTS)
ifeq ($(HAVEDXE3),)
$(warning Missing DXE3 package... Skipping $(GLU_DXE))
else
- -dxe3gen -o $(LIBDIR)/$(GLU_DXE) -Y $(LIBDIR)/$(GLU_IMP) -D "MesaGLU/SGI DJGPP" -E _glu -P gl.dxe -U $(OBJECTS)
+ -dxe3gen -o $(LIBDIR)/$(GLU_DXE) -Y $(LIBDIR)/$(GLU_IMP) -D "MesaGLU/SGI DJGPP" -E _glu -P gl.dxe -U $^
endif
clean:
-$(call UNLINK,libnurbs/interface/*.o)
-$(call UNLINK,libnurbs/internals/*.o)
-$(call UNLINK,libnurbs/nurbtess/*.o)
-
--include depend
# DOS/DJGPP glut makefile v1.4 for Mesa
#
# Copyright (C) 2002 - Borca Daniel
-# Email : dborca@yahoo.com
+# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
GLUT_DXE = glut.dxe
GLUT_IMP = libiglut.a
-export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR)
+export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR);$(GLIDE)/lib
CC = gcc
CFLAGS += -I- -I$(TOP)/include -I. -I$(MKGLUT) -IPC_HW
+CFLAGS += -DGLUT_IMPORT_LIB
AR = ar
ARFLAGS = rus
mouse.c \
overlay.c \
state.c \
+ util.c \
window.c
PC_HW_SOURCES = \
all: $(LIBDIR)/$(GLUT_LIB) $(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP)
$(LIBDIR)/$(GLUT_LIB): $(OBJECTS)
- $(AR) $(ARFLAGS) $(LIBDIR)/$(GLUT_LIB) $(OBJECTS)
+ $(AR) $(ARFLAGS) $@ $^
$(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP): $(OBJECTS)
ifeq ($(HAVEDXE3),)
$(warning Missing DXE3 package... Skipping $(GLUT_DXE))
else
- -dxe3gen -o $(LIBDIR)/$(GLUT_DXE) -Y $(LIBDIR)/$(GLUT_IMP) -D "MesaGLUT DJGPP" -E _glut -P gl.dxe -P glu.dxe -U $(OBJECTS)
+ -dxe3gen -o $(LIBDIR)/$(GLUT_DXE) -Y $(LIBDIR)/$(GLUT_IMP) -D "MesaGLUT DJGPP" -E _glut -P gl.dxe -P glu.dxe -U $^
endif
clean:
*/
/*
- * DOS/DJGPP glut driver v1.3 for Mesa
+ * DOS/DJGPP glut driver v1.4 for Mesa
*
* Copyright (C) 2002 - Borca Daniel
- * Email : dborca@yahoo.com
+ * Email : dborca@users.sourceforge.net
* Web : http://www.geocities.com/dborca
*/
typedef struct GLUTwindow {
int num; /* window id */
+ DMesaContext context;
DMesaBuffer buffer;
int show_mouse;
+ GLboolean redisplay;
/* GLUT settable or visible window state. */
int xpos;
extern GLUTidleCB g_idle_func;
extern GLUTmenuStatusCB g_menu_status_func;
-extern GLboolean g_redisplay;
-
extern GLuint g_bpp; /* HW: bits per pixel */
+extern GLuint g_depth; /* HW: depth bits */
+extern GLuint g_stencil; /* HW: stencil bits */
+extern GLuint g_accum; /* HW: accum bits */
extern GLuint g_refresh; /* HW: vertical refresh rate */
extern GLuint g_screen_w, g_screen_h; /* HW: physical screen size */
extern GLint g_driver_caps;
extern int g_mouse_x, g_mouse_y; /* mouse coords, relative to current win */
extern GLUTwindow *g_curwin; /* current window */
+extern GLUTwindow *g_windows[];
extern char *__glutProgramName; /* program name */
extern void __glutWarning(char *format,...);
extern void __glutFatalError(char *format,...);
extern void __glutFatalUsage(char *format,...);
+/* Private routines from util.c */
+#ifdef GLUT_IMPORT_LIB
+extern void *__glutFont(void *font);
+#endif
#define MAX_WINDOWS 2
-#define DEFAULT_WIDTH 300
-#define DEFAULT_HEIGHT 300
-#define DEFAULT_BPP 16
-
-#define DEPTH_SIZE 16
-#define STENCIL_SIZE 8
-#define ACCUM_SIZE 16
-
#define RESERVED_COLORS 0
#endif /* __glutint_h__ */
*/
/*
- * DOS/DJGPP glut driver v1.3 for Mesa
+ * DOS/DJGPP glut driver v1.4 for Mesa
*
* Copyright (C) 2002 - Borca Daniel
- * Email : dborca@yahoo.com
+ * Email : dborca@users.sourceforge.net
* Web : http://www.geocities.com/dborca
*/
#include "glutint.h"
+#define DEFAULT_WIDTH 300
+#define DEFAULT_HEIGHT 300
+#define DEFAULT_BPP 16
+
+#define DEPTH_SIZE 16
+#define STENCIL_SIZE 8
+#define ACCUM_SIZE 16
-GLboolean g_redisplay = GL_FALSE;
GLuint g_bpp = DEFAULT_BPP;
+GLuint g_depth = DEPTH_SIZE;
+GLuint g_stencil = STENCIL_SIZE;
+GLuint g_accum = ACCUM_SIZE;
GLuint g_refresh = 0;
GLuint g_screen_w, g_screen_h;
GLint g_driver_caps;
if ((env = getenv("DMESA_GLUT_BPP")) != NULL) {
g_bpp = atoi(env);
}
+ if ((env = getenv("DMESA_GLUT_DEPTH")) != NULL) {
+ g_depth = atoi(env);
+ }
+ if ((env = getenv("DMESA_GLUT_STENCIL")) != NULL) {
+ g_stencil = atoi(env);
+ }
+ if ((env = getenv("DMESA_GLUT_ACCUM")) != NULL) {
+ g_accum = atoi(env);
+ }
if ((env = getenv("DMESA_GLUT_REFRESH")) != NULL) {
g_refresh = atoi(env);
}
void APIENTRY glutMainLoop (void)
{
+ int i;
GLboolean idle;
static int old_mouse_x = 0;
static int old_mouse_y = 0;
pc_install_keyb();
__glutInitMouse();
- glutPostRedisplay();
- if (g_curwin->reshape) {
- g_curwin->reshape(g_curwin->width, g_curwin->height);
- }
- if (g_curwin->visibility) {
- g_curwin->visibility(GLUT_VISIBLE);
+ for (i = 0; i < MAX_WINDOWS; i++) {
+ if (g_windows[i] != NULL) {
+ GLUTwindow *w = g_windows[i];
+ glutSetWindow(w->num);
+ glutPostRedisplay();
+ if (w->reshape) {
+ w->reshape(w->width, w->height);
+ }
+ if (w->visibility) {
+ w->visibility(GLUT_VISIBLE);
+ }
+ }
}
while (GL_TRUE) {
idle = GL_TRUE;
- if (g_redisplay && g_curwin->display) {
- idle = GL_FALSE;
- g_redisplay = GL_FALSE;
-
- if (g_curwin->show_mouse && !(g_display_mode & GLUT_DOUBLE)) {
- /* XXX scare mouse */
- g_curwin->display();
- /* XXX unscare mouse */
- } else {
- g_curwin->display();
- }
+ for (i = 0; i < MAX_WINDOWS; i++) {
+ if (g_windows[i] != NULL) {
+ GLUTwindow *w = g_windows[i];
+ if (w->redisplay && w->display) {
+ idle = GL_FALSE;
+ w->redisplay = GL_FALSE;
+
+ if (DMesaMakeCurrent(w->context, w->buffer)) {
+ if (w->show_mouse && !(g_display_mode & GLUT_DOUBLE)) {
+ /* XXX scare mouse */
+ w->display();
+ /* XXX unscare mouse */
+ } else {
+ w->display();
+ }
+ }
+ }
+ }
}
+ DMesaMakeCurrent(g_curwin->context, g_curwin->buffer);
if (g_mouse) {
int mouse_x;
*/
/*
- * DOS/DJGPP glut driver v1.3 for Mesa
+ * DOS/DJGPP glut driver v1.4 for Mesa
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
case GLUT_WINDOW_HEIGHT:
return g_curwin->height;
case GLUT_WINDOW_STENCIL_SIZE:
- return STENCIL_SIZE;
+ return g_stencil;
case GLUT_WINDOW_DEPTH_SIZE:
- return DEPTH_SIZE;
+ return g_depth;
case GLUT_WINDOW_RGBA:
return !(g_display_mode & GLUT_INDEX);
case GLUT_WINDOW_COLORMAP_SIZE:
*/
/*
- * DOS/DJGPP glut driver v1.3 for Mesa
+ * DOS/DJGPP glut driver v1.4 for Mesa
*
* Copyright (C) 2002 - Borca Daniel
- * Email : dborca@yahoo.com
+ * Email : dborca@users.sourceforge.net
* Web : http://www.geocities.com/dborca
*/
static GLuint swaptime, swapcount;
static DMesaVisual visual = NULL;
-static DMesaContext context = NULL;
-static GLUTwindow *windows[MAX_WINDOWS];
+GLUTwindow *g_windows[MAX_WINDOWS];
for (i=1; i<=MAX_WINDOWS; i++) {
glutDestroyWindow(i);
}
- if (context) DMesaDestroyContext(context);
if (visual) DMesaDestroyVisual(visual);
pc_close_stdout();
int i;
int m8width = (g_init_w + 7) & ~7;
+ /* We set the Visual once. This will be our desktop (graphic mode).
+ * We should do this in the `glutInit' code, but we don't have any idea
+ * about its geometry. Supposedly, when we are about to create one
+ * window, we have a slight idea about resolution.
+ */
if (!visual) {
if ((visual=DMesaCreateVisual(g_init_x + m8width, g_init_y + g_init_h, g_bpp, g_refresh,
g_display_mode & GLUT_DOUBLE,
!(g_display_mode & GLUT_INDEX),
g_display_mode & GLUT_ALPHA,
- g_display_mode & GLUT_DEPTH ?DEPTH_SIZE :0,
- g_display_mode & GLUT_STENCIL?STENCIL_SIZE:0,
- g_display_mode & GLUT_ACCUM ?ACCUM_SIZE :0))==NULL) {
- return 0;
- }
-
- if ((context=DMesaCreateContext(visual, NULL))==NULL) {
- DMesaDestroyVisual(visual);
+ g_display_mode & GLUT_DEPTH ? g_depth :0,
+ g_display_mode & GLUT_STENCIL ? g_stencil:0,
+ g_display_mode & GLUT_ACCUM ? g_accum :0))==NULL) {
return 0;
}
+ /* Also hook stdio/stderr once */
pc_open_stdout();
pc_open_stderr();
pc_atexit(clean);
}
+ /* Search for an empty slot.
+ * Each window has its own rendering Context and its own Buffer.
+ */
for (i=0; i<MAX_WINDOWS; i++) {
- if (windows[i] == NULL) {
+ if (g_windows[i] == NULL) {
+ DMesaContext c;
DMesaBuffer b;
GLUTwindow *w;
- if ((w=(GLUTwindow *)calloc(1, sizeof(GLUTwindow))) == NULL) {
+ if ((w = (GLUTwindow *)calloc(1, sizeof(GLUTwindow))) == NULL) {
+ return 0;
+ }
+
+ /* Allocate the rendering Context. */
+ if ((c = DMesaCreateContext(visual, NULL)) == NULL) {
+ free(w);
return 0;
}
- if ((b=DMesaCreateBuffer(visual, g_init_x, g_init_y, m8width, g_init_h))==NULL) {
+ /* Allocate the Buffer (displayable area).
+ * We have to specify buffer size and position (inside the desktop).
+ */
+ if ((b = DMesaCreateBuffer(visual, g_init_x, g_init_y, m8width, g_init_h)) == NULL) {
+ DMesaDestroyContext(c);
free(w);
return 0;
}
- if (!DMesaMakeCurrent(context, b)) {
+
+ /* Bind Buffer to Context and make the Context the current one. */
+ if (!DMesaMakeCurrent(c, b)) {
DMesaDestroyBuffer(b);
+ DMesaDestroyContext(c);
free(w);
return 0;
}
- g_curwin = windows[i] = w;
+ g_curwin = g_windows[i] = w;
w->num = ++i;
w->xpos = g_init_x;
w->ypos = g_init_y;
w->width = m8width;
w->height = g_init_h;
+ w->context = c;
w->buffer = b;
return i;
void APIENTRY glutDestroyWindow (int win)
{
- if (windows[--win]) {
- DMesaDestroyBuffer(windows[win]->buffer);
- free(windows[win]);
- windows[win] = NULL;
+ if (g_windows[--win]) {
+ GLUTwindow *w = g_windows[win];
+ DMesaMakeCurrent(NULL, NULL);
+ DMesaDestroyBuffer(w->buffer);
+ DMesaDestroyContext(w->context);
+ free(w);
+ g_windows[win] = NULL;
}
}
void APIENTRY glutPostRedisplay (void)
{
- g_redisplay = GL_TRUE;
+ g_curwin->redisplay = GL_TRUE;
}
void APIENTRY glutSetWindow (int win)
{
- g_curwin = windows[win - 1];
+ g_curwin = g_windows[win - 1];
+ DMesaMakeCurrent(g_curwin->context, g_curwin->buffer);
}
GLint swapbytes, lsbfirst, rowlength;
GLint skiprows, skippixels, alignment;
-#if defined(_WIN32)
+#if defined(_WIN32) || defined(GLUT_IMPORT_LIB)
fontinfo = (BitmapFontPtr) __glutFont(font);
#else
fontinfo = (BitmapFontPtr) font;
BitmapFontPtr fontinfo;
const BitmapCharRec *ch;
-#ifdef _WIN32
+#if defined(_WIN32) || defined(GLUT_IMPORT_LIB)
fontinfo = (BitmapFontPtr) __glutFont(font);
#else
fontinfo = (BitmapFontPtr) font;
BitmapFontPtr fontinfo;
const BitmapCharRec *ch;
-#ifdef _WIN32
+#if defined(_WIN32) || defined(GLUT_IMPORT_LIB)
fontinfo = (BitmapFontPtr) __glutFont(font);
#else
fontinfo = (BitmapFontPtr) font;
int i, j;
-#if defined(_WIN32)
+#if defined(_WIN32) || defined(GLUT_IMPORT_LIB)
fontinfo = (StrokeFontPtr) __glutFont(font);
#else
fontinfo = (StrokeFontPtr) font;
StrokeFontPtr fontinfo;
const StrokeCharRec *ch;
-#if defined(_WIN32)
+#if defined(_WIN32) || defined(GLUT_IMPORT_LIB)
fontinfo = (StrokeFontPtr) __glutFont(font);
#else
fontinfo = (StrokeFontPtr) font;
StrokeFontPtr fontinfo;
const StrokeCharRec *ch;
-#if defined(_WIN32)
+#if defined(_WIN32) || defined(GLUT_IMPORT_LIB)
fontinfo = (StrokeFontPtr) __glutFont(font);
#else
fontinfo = (StrokeFontPtr) font;
# DOS/DJGPP core makefile v1.4 for Mesa
#
# Copyright (C) 2002 - Borca Daniel
-# Email : dborca@yahoo.com
+# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
# Environment variables:
# CFLAGS
#
-# GLIDE path to Glide3 SDK include files; used with FX.
-# default = $(TOP)/include/glide3
+# GLIDE path to Glide3 SDK; used with FX.
+# default = $(TOP)/glide3
# FX=1 build for 3dfx Glide3. Note that this disables
# compilation of most DMesa code and requires fxMesa.
# As a consequence, you'll need the DJGPP Glide3
.INTERMEDIATE: x86/gen_matypes.exe
TOP = ../..
-GLIDE ?= $(TOP)/include/glide3
+GLIDE ?= $(TOP)/glide3
LIBDIR = $(TOP)/lib
GL_LIB = libgl.a
GL_DXE = gl.dxe
GL_IMP = libigl.a
-export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR)
+export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR);$(GLIDE)/lib
CC = gcc
CFLAGS += -I$(TOP)/include -I. -Imain -Iglapi
ifeq ($(FX),1)
CFLAGS += -D__DOS__ -DH3
-CFLAGS += -I$(GLIDE) -DFX -DFX_GLIDE3 -DFXMESA_USE_ARGB
+CFLAGS += -I$(GLIDE)/include -DFX
LIBNAME = "MesaGL/FX DJGPP"
else
ifeq ($(MATROX),1)
x86/3dnow_normal.S
CORE_SOURCES = \
- $(MAIN_SOURCES) \
- $(GLAPI_SOURCES) \
- $(MATH_SOURCES) \
- $(ARRAY_CACHE_SOURCES) \
- $(SWRAST_SOURCES) \
- $(SWRAST_SETUP_SOURCES) \
+ $(MAIN_SOURCES) \
+ $(GLAPI_SOURCES) \
+ $(MATH_SOURCES) \
+ $(ARRAY_CACHE_SOURCES) \
+ $(SWRAST_SOURCES) \
+ $(SWRAST_SETUP_SOURCES) \
$(TNL_SOURCES)
ifeq ($(HAVE_MMX),1)
all: $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP)
$(LIBDIR)/$(GL_LIB): $(OBJECTS)
- $(AR) $(ARFLAGS) $(LIBDIR)/$(GL_LIB) $(OBJECTS)
+ $(AR) $(ARFLAGS) $@ $^
$(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP): $(OBJECTS)
ifeq ($(HAVEDXE3),)
$(warning Missing DXE3 package... Skipping $(GL_DXE))
else
ifeq ($(FX),1)
- -dxe3gen -o $(LIBDIR)/$(GL_DXE) -Y $(LIBDIR)/$(GL_IMP) -D $(LIBNAME) -E _gl -E _DMesa -P glid3.dxe -U $(OBJECTS)
+ -dxe3gen -o $(LIBDIR)/$(GL_DXE) -Y $(LIBDIR)/$(GL_IMP) -D $(LIBNAME) -E _gl -E _DMesa -P glid3.dxe -U $^
else
- -dxe3gen -o $(LIBDIR)/$(GL_DXE) -Y $(LIBDIR)/$(GL_IMP) -D $(LIBNAME) -E _gl -E _DMesa -U $(OBJECTS)
+ -dxe3gen -o $(LIBDIR)/$(GL_DXE) -Y $(LIBDIR)/$(GL_IMP) -D $(LIBNAME) -E _gl -E _DMesa -U $^
endif
endif
-$(call UNLINK,drivers/dos/*.o)
-$(call UNLINK,drivers/dos/mga/*.o)
-$(call UNLINK,drivers/glide/*.o)
-
--include depend
* DOS/DJGPP device driver v1.4 for Mesa
*
* Copyright (c) 2003 - Borca Daniel
- * Email : dborca@yahoo.com
+ * Email : dborca@users.sourceforge.net
* Web : http://www.geocities.com/dborca
*/
-#ifndef FX
#include "glheader.h"
#include "context.h"
+#ifndef FX
#include "extensions.h"
#include "macros.h"
#include "matrix.h"
#include "mga/mga.h"
#endif /* MATROX */
#else /* FX */
-#include "../glide/fxdrv.h"
+#include "GL/fxmesa.h"
#endif /* FX */
#include "GL/dmesa.h"
#ifdef MATROX
" (MGA)"
#endif
- "\0port (c) Borca Daniel mar-2003";
+ "\0port (c) Borca Daniel aug-2003";
default:
return NULL;
}
#endif
#else
- fxMesaDestroyContext((fxMesaContext)v);
+ fxMesaDestroyContext((tdfxContextPtr)v);
#endif
}
_mesa_enable_sw_extensions((GLcontext *)c);
_mesa_enable_1_3_extensions((GLcontext *)c);
_mesa_enable_1_4_extensions((GLcontext *)c);
- _mesa_enable_1_5_extensions((GLcontext *)c);\r
+ _mesa_enable_1_5_extensions((GLcontext *)c);
/* you probably have to do a bunch of other initializations here. */
c->visual = visual;
}
#else
- fxMesaMakeCurrent((fxMesaContext)c);
+ fxMesaMakeCurrent((tdfxContextPtr)c);
#endif
return GL_TRUE;
-DMesaContext DMesaGetCurrentContext (void)
+void *DMesaGetCurrentContext (void)
{
#ifndef FX
GET_CURRENT_CONTEXT(ctx);
- return (DMesaContext)ctx;
+ return ctx;
#else
- return (DMesaContext)fxMesaGetCurrentContext();
+ return fxMesaGetCurrentContext();
#endif
}
int DMesaGetIntegerv (GLenum pname, GLint *params)
{
-#ifndef FX
- GET_CURRENT_CONTEXT(ctx);
- const DMesaContext c = (DMesaContext)ctx;
-#else
- const fxMesaContext c = fxMesaGetCurrentContext();
-#endif
-
- if (c == NULL) {
+ if (DMesaGetCurrentContext() == NULL) {
return -1;
}
mga_get(MGA_GET_SCREEN_SIZE, params);
#endif
#else
- params[0] = c->screen_width;
- params[1] = c->screen_height;
+ fxGetScreenGeometry(¶ms[0], ¶ms[1]);
#endif
break;
case DMESA_GET_DRIVER_CAPS:
-/* $Id: fxapi.c,v 1.36 2003/07/17 14:50:12 brianp Exp $ */
+/* $Id: fxapi.c,v 1.37 2003/08/19 15:52:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Brian Paul
* Daryll Strauss
* Keith Whitwell
+ * Daniel Borca
+ * Hiroshi Morii
*/
}
-fxMesaContext GLAPIENTRY
-fxMesaGetCurrentContext(void)
+void * GLAPIENTRY fxMesaGetCurrentContext (void)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ return ctx;
+}
+
+
+void GLAPIENTRY fxGetScreenGeometry (GLint *w, GLint *h)
{
- return fxMesaCurrentCtx;
+ GLint width = 0;
+ GLint height = 0;
+
+ if (fxMesaCurrentCtx != NULL) {
+ width = fxMesaCurrentCtx->screen_width;
+ height = fxMesaCurrentCtx->screen_height;
+ }
+
+ if (w != NULL) {
+ *w = width;
+ }
+ if (h != NULL) {
+ *h = height;
+ }
}
if (fxMesa) {
fxMesa->haveGlobalPaletteTexture = 1;
- FX_grTexDownloadTable(GR_TMU0, GR_TEXTABLE_PALETTE,
- (GuTexPalette *) pal);
- if (fxMesa->haveTwoTMUs)
- FX_grTexDownloadTable(GR_TMU1, GR_TEXTABLE_PALETTE,
- (GuTexPalette *) pal);
+ grTexDownloadTable(GR_TEXTABLE_PALETTE, (GuTexPalette *) pal);
}
}
fxQueryHardware();
- if (glbHWConfig.SSTs[glbCurrentBoard].type == GR_SSTTYPE_VOODOO) {
- fbmem = glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.fbRam;
-
- if (glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.sliDetect)
- fbmem *= 2;
- }
- else if (glbHWConfig.SSTs[glbCurrentBoard].type == GR_SSTTYPE_SST96)
- fbmem = glbHWConfig.SSTs[glbCurrentBoard].sstBoard.SST96Config.fbRam;
- else
- fbmem = 2;
+ fbmem = glbHWConfig.SSTs[glbCurrentBoard].VoodooConfig.fbRam
+ * glbHWConfig.SSTs[glbCurrentBoard].VoodooConfig.numChips;
/* A work around for BZFlag */
height = 480;
}
- for (i = 0; i < NUM_RESOLUTIONS; i++)
+ for (i = 0; i < NUM_RESOLUTIONS; i++) {
if (resolutions[i][4 - aux] <= fbmem) {
- if ((width <= resolutions[i][0]) && (height <= resolutions[i][1]))
+ if ((width <= resolutions[i][0]) && (height <= resolutions[i][1])) {
return resolutions[i][2];
-
+ }
lastvalidres = resolutions[i][2];
}
+ }
return lastvalidres;
}
/*FX_GrContext_t glideContext = 0; */
char *errorstr;
GLboolean useBGR;
- char *system = NULL;
GLuint pixFmt, colDepth = 16;
GLint redBits, greenBits, blueBits, alphaBits;
case FXMESA_ALPHA_SIZE:
i++;
alphaBuffer = attribList[i] > 0;
- if (alphaBuffer)
+ if (alphaBuffer) {
aux = 1;
+ }
break;
case FXMESA_DEPTH_SIZE:
i++;
depthSize = attribList[i];
if (depthSize) {
aux = 1;
- depthSize = 16;
}
break;
case FXMESA_STENCIL_SIZE:
break;
default:
if (MESA_VERBOSE & VERBOSE_DRIVER) {
- fprintf(stderr, "fxmesa: fxMesaCreateContext() End (defualt)\n");
+ fprintf(stderr, "fxmesa: bad FXMESA_* switch\n");
}
return NULL;
}
i++;
}
+ if (depthSize) {
+ depthSize = (colDepth == 32) ? 24 : 16;
+ }
+
/* A workaround for Linux GLQuake */
if (depthSize && alphaBuffer)
alphaBuffer = 0;
if ((type = fxQueryHardware()) < 0) {
- fprintf(stderr,
- "fx Driver: ERROR no Voodoo1/2 Graphics or Voodoo Rush !\n");
+ fprintf(stderr, "fxmesa: ERROR no Voodoo hardware!\n");
return NULL;
}
- if (type == GR_SSTTYPE_VOODOO)
- win = 0;
-
grSstSelect(glbCurrentBoard);
fxMesa = (fxMesaContext) calloc(1, sizeof(struct tfxMesaContext));
goto errorhandler;
}
- if (glbHWConfig.SSTs[glbCurrentBoard].type == GR_SSTTYPE_VOODOO)
- fxMesa->haveTwoTMUs =
- (glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.nTexelfx >
- 1);
- else if (glbHWConfig.SSTs[glbCurrentBoard].type == GR_SSTTYPE_SST96)
- fxMesa->haveTwoTMUs =
- (glbHWConfig.SSTs[glbCurrentBoard].sstBoard.SST96Config.nTexelfx >
- 1);
- else
- fxMesa->haveTwoTMUs = GL_FALSE;
-
+ fxMesa->haveTwoTMUs = (glbHWConfig.SSTs[glbCurrentBoard].VoodooConfig.nTexelfx > 1);
fxMesa->haveDoubleBuffer = doubleBuffer;
fxMesa->haveAlphaBuffer = alphaBuffer;
fxMesa->haveGlobalPaletteTexture = GL_FALSE;
fxMesa->haveZBuffer = depthSize ? 1 : 0;
fxMesa->verbose = verbose;
fxMesa->board = glbCurrentBoard;
+ fxMesa->maxTextureSize = glbHWConfig.SSTs[glbCurrentBoard].VoodooConfig.maxTextureSize; /* [koolsmoky] */
switch (fxMesa->colDepth = colDepth) {
greenBits = 5;
blueBits = 5;
alphaBits = 1;
- pixFmt = 4; /* GR_PIXFMT_ARGB_1555 */
+ pixFmt = GR_PIXFMT_ARGB_1555;
break;
case 16:
redBits = 5;
greenBits = 6;
blueBits = 5;
alphaBits = 0;
- pixFmt = 3; /* GR_PIXFMT_ARGB_565 */
+ pixFmt = GR_PIXFMT_RGB_565;
break;
case 32:
redBits = 8;
greenBits = 8;
blueBits = 8;
alphaBits = 8;
- pixFmt = 5; /* GR_PIXFMT_ARGB_8888 */
+ pixFmt = GR_PIXFMT_ARGB_8888;
break;
default:
errorstr = "pixelFormat";
fxMesa->glideContext = FX_grSstWinOpen(&glbHWConfig.SSTs[glbCurrentBoard],
(FxU32)win, res, ref,
-#ifdef FXMESA_USE_ARGB
- GR_COLORFORMAT_ARGB,
-#else
GR_COLORFORMAT_ABGR,
-#endif
pixFmt,
GR_ORIGIN_LOWER_LEFT, 2, aux);
if (!fxMesa->glideContext) {
/*
* Pixel tables are used during pixel read-back
- * Either initialize them for RGB or BGR order.
+ * Either initialize them for RGB or BGR order;
+ * However, 32bit capable cards have the right order.
+ * As a consequence, 32bit read-back is not swizzled!
* Also determine if we need vertex snapping.
*/
-
- fxMesa->snapVertices = GL_TRUE; /* play it safe */
-
-#ifdef FXMESA_USE_ARGB
- useBGR = GL_FALSE; /* Force RGB pixel order */
- system = "FXMESA_USE_ARGB";
-#else
- if (glbHWConfig.SSTs[glbCurrentBoard].type == GR_SSTTYPE_VOODOO) {
- /* jk991130 - Voodoo 3s don't use BGR. Query the # of TMUs
- * as Voodoo3s have 2 TMUs on board, Banshee has only 1
- * bk000413 - another suggestion from Joseph Kain is using
- * VendorID 0x121a for all 3dfx boards
- * DeviceID VG 1/V2 2/VB 3/V3 5
- * For now we cehck for known BGR devices, and presume
- * everything else to be a V3/RGB.
- */
- GrVoodooConfig_t *voodoo;
- voodoo = &glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig;
-
- if (voodoo->nTexelfx == 1) {
- /* Voodoo1 or Banshee */
- useBGR = GL_TRUE;
- system = "Voodoo1";
- }
- else if (voodoo->nTexelfx == 2 &&
- voodoo->fbiRev == 260 &&
- voodoo->tmuConfig[0].tmuRev == 4 &&
- (voodoo->tmuConfig[0].tmuRam == 2 ||
- voodoo->tmuConfig[0].tmuRam == 4)) {
- /* Voodoo 2 */
- useBGR = GL_TRUE;
- system = "Voodoo2";
- fxMesa->snapVertices = GL_FALSE;
- }
- else if (voodoo->nTexelfx == 2 &&
- voodoo->fbiRev == 2 &&
- voodoo->tmuConfig[0].tmuRev == 1 &&
- voodoo->tmuConfig[0].tmuRam == 4) {
- /* Quantum3D Obsidian 50/100 */
- useBGR = GL_TRUE;
- system = "Quantum3D Obsidian";
- }
- else
- /* Brian
- * (voodoo->nTexelfx == 2 &&
- * voodoo->fbiRev == 0 &&
- * voodoo->tmuConfig[0].tmuRev == 148441048 &&
- * voodoo->tmuConfig[0].tmuRam == 3)
- * Bernd
- * (voodoo->nTexelfx == 2 &&
- * voodoo->fbiRev == 69634 &&
- * voodoo->tmuConfig[0].tmuRev == 69634 &&
- * voodoo->tmuConfig[0].tmuRam == 2 )
- */
- {
- /* Presumed Voodoo3 */
- useBGR = GL_FALSE;
- system = "Voodoo3";
- fxMesa->snapVertices = GL_FALSE;
- }
- if (verbose) {
- fprintf(stderr,
- "Voodoo: Texelfx: %d / FBI Rev.: %d / TMU Rev.: %d / TMU RAM: %d\n",
- voodoo->nTexelfx, voodoo->fbiRev, voodoo->tmuConfig[0].tmuRev,
- voodoo->tmuConfig[0].tmuRam);
- }
- }
- else {
- useBGR = GL_FALSE; /* use RGB pixel order otherwise */
- system = "non-voodoo";
- fxMesa->snapVertices = GL_FALSE;
+ switch (glbHWConfig.SSTs[glbCurrentBoard].type) {
+ case GR_SSTTYPE_VOODOO:
+ case GR_SSTTYPE_Banshee:
+ useBGR = GL_TRUE;
+ fxMesa->snapVertices = GL_TRUE;
+ break;
+ case GR_SSTTYPE_Voodoo2:
+ useBGR = GL_TRUE;
+ fxMesa->snapVertices = GL_FALSE;
+ break;
+ case GR_SSTTYPE_Voodoo3:
+ case GR_SSTTYPE_Voodoo4:
+ case GR_SSTTYPE_Voodoo5:
+ default:
+ useBGR = GL_FALSE;
+ fxMesa->snapVertices = GL_FALSE;
+ break;
}
-#endif /*FXMESA_USE_ARGB */
if (verbose) {
- fprintf(stderr, "Voodoo pixel order: %s (%s)\n",
- useBGR ? "BGR" : "RGB", system);
- fprintf(stderr, "Vertex snapping: %d\n", fxMesa->snapVertices);
+ fprintf(stderr, "Voodoo pixel order = %s, vertex snapping = %d\n",
+ useBGR ? "BGR" : "RGB",
+ fxMesa->snapVertices);
}
fxInitPixelTables(fxMesa, useBGR);
fxMesa->new_state = ~0;
if (verbose)
- fprintf(stderr, "Voodoo Glide screen size: %dx%d\n",
- (int) FX_grSstScreenWidth(), (int) FX_grSstScreenHeight());
+ fprintf(stderr, "Voodoo screen: %dx%dx%d\n",
+ (int)FX_grSstScreenWidth(), (int)FX_grSstScreenHeight(), colDepth);
fxMesa->glVis = _mesa_create_visual(GL_TRUE, /* RGB mode */
doubleBuffer, GL_FALSE, /* stereo */
errorhandler:
if (fxMesa) {
if (fxMesa->glideContext)
- FX_grSstWinClose(fxMesa->glideContext);
+ grSstWinClose(fxMesa->glideContext);
fxMesa->glideContext = 0;
if (fxMesa->state)
}
if (MESA_VERBOSE & VERBOSE_DRIVER) {
- fprintf(stderr, "fxmesa: fxMesaCreateContext() End (%s)\n", errorstr);
+ fprintf(stderr, "fxmesa: ERROR (%s)\n", errorstr);
}
return NULL;
}
_mesa_destroy_framebuffer(fxMesa->glBuffer);
fxCloseHardware();
- FX_grSstWinClose(fxMesa->glideContext);
+ grSstWinClose(fxMesa->glideContext);
free(fxMesa);
/*
* Don't allow swap buffer commands to build up!
*/
- while (FX_grGetInteger(FX_PENDING_BUFFERSWAPS) >
+ while (FX_grGetInteger(GR_PENDING_BUFFERSWAPS) >
fxMesaCurrentCtx->maxPendingSwapBuffers)
/* The driver is able to sleep when waiting for the completation
of multiple swapbuffer operations instead of wasting
if (getenv("MESA_FX_INFO")) {
char buf[80];
-
- FX_grGlideGetVersion(buf);
- fprintf(stderr, "Voodoo Using Glide V%s\n", buf);
- fprintf(stderr, "Voodoo Number of boards: %d\n",
- glbHWConfig.num_sst);
-
- if (glbHWConfig.SSTs[glbCurrentBoard].type == GR_SSTTYPE_VOODOO) {
- GrVoodooConfig_t *voodoo;
- voodoo =
- &glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig;
-
- fprintf(stderr, "Voodoo Framebuffer RAM: %d\n",
- voodoo->sliDetect ? (voodoo->fbRam *
- 2) : voodoo->fbRam);
- fprintf(stderr, "Voodoo Number of TMUs: %d\n",
- voodoo->nTexelfx);
- fprintf(stderr, "Voodoo fbRam: %d\n", voodoo->fbRam);
- fprintf(stderr, "Voodoo fbiRev: %d\n", voodoo->fbiRev);
-
- fprintf(stderr, "Voodoo SLI detected: %d\n",
- voodoo->sliDetect);
- }
- else if (glbHWConfig.SSTs[glbCurrentBoard].type ==
- GR_SSTTYPE_SST96) {
- GrSst96Config_t *sst96;
- sst96 =
- &glbHWConfig.SSTs[glbCurrentBoard].sstBoard.SST96Config;
- fprintf(stderr, "Voodoo Framebuffer RAM: %d\n", sst96->fbRam);
- fprintf(stderr, "Voodoo Number of TMUs: %d\n",
- sst96->nTexelfx);
- }
-
+ GrVoodooConfig_t *voodoo = &glbHWConfig.SSTs[glbCurrentBoard].VoodooConfig;
+
+ strcpy(buf, grGetString(GR_VERSION));
+ fprintf(stderr, "Voodoo Using Glide %s\n", buf);
+ fprintf(stderr, "Voodoo Number of boards: %d\n", glbHWConfig.num_sst);
+ fprintf(stderr, "Voodoo Number of TMUs: %d\n", voodoo->nTexelfx);
+ fprintf(stderr, "Voodoo fbRam: %d\n", voodoo->fbRam);
+ fprintf(stderr, "Voodoo fbiRev: %d\n", voodoo->fbiRev);
+ fprintf(stderr, "Voodoo chips detected: %d\n", voodoo->numChips);
}
}
else {
glbGlideInitialized = 1;
#if defined(__WIN32__)
- onexit((_onexit_t) cleangraphics);
+ _onexit((_onexit_t) cleangraphics);
#elif defined(__linux__)
/* Only register handler if environment variable is not defined. */
if (!getenv("MESA_FX_NO_SIGNALS")) {
* fxDDReadPixels888 does not convert 8A8R8G8B into 5R5G5B
*/
-/* $Id: fxdd.c,v 1.98 2003/07/17 14:50:12 brianp Exp $ */
+/* $Id: fxdd.c,v 1.99 2003/08/19 15:52:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Brian Paul
* Daryll Strauss
* Keith Whitwell
+ * Daniel Borca
+ * Hiroshi Morii
*/
/* fxdd.c - 3Dfx VooDoo Mesa device driver functions */
{
fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx;
const GLuint colorMask = *((GLuint *) & ctx->Color.ColorMask);
- const FxU16 clearD = (FxU16) (ctx->Depth.Clear * 0xffff);
+ /* [dBorca] should use an adequate scaler for 16 vs 32bit (GR_ZDEPTH_MIN_MAX) */
+ const FxU32 clearD = (FxU32) (ctx->Depth.Clear * 0x00ffffff);
GLbitfield softwareMask = mask & (DD_STENCIL_BIT | DD_ACCUM_BIT);
/* we can't clear stencil or accum buffers */
switch (mask) {
case DD_BACK_LEFT_BIT | DD_DEPTH_BIT:
/* back buffer & depth */
- FX_grDepthMask(FXTRUE);
- FX_grRenderBuffer(GR_BUFFER_BACKBUFFER);
+ grDepthMask(FXTRUE);
+ grRenderBuffer(GR_BUFFER_BACKBUFFER);
FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD);
if (!ctx->Depth.Mask) {
- FX_grDepthMask(FXFALSE);
+ grDepthMask(FXFALSE);
}
break;
case DD_FRONT_LEFT_BIT | DD_DEPTH_BIT:
* This is a work-around/
*/
/* clear depth */
- FX_grDepthMask(FXTRUE);
- FX_grRenderBuffer(GR_BUFFER_BACKBUFFER);
- FX_grColorMask(FXFALSE, FXFALSE);
+ grDepthMask(FXTRUE);
+ grRenderBuffer(GR_BUFFER_BACKBUFFER);
+ grColorMask(FXFALSE, FXFALSE);
FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD);
/* clear front */
- FX_grColorMask(FXTRUE, ctx->Color.ColorMask[ACOMP]
- && fxMesa->haveAlphaBuffer);
- FX_grRenderBuffer(GR_BUFFER_FRONTBUFFER);
+ grColorMask(FXTRUE, ctx->Color.ColorMask[ACOMP] && fxMesa->haveAlphaBuffer);
+ grRenderBuffer(GR_BUFFER_FRONTBUFFER);
FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD);
break;
case DD_BACK_LEFT_BIT:
/* back buffer only */
- FX_grDepthMask(FXFALSE);
- FX_grRenderBuffer(GR_BUFFER_BACKBUFFER);
+ grDepthMask(FXFALSE);
+ grRenderBuffer(GR_BUFFER_BACKBUFFER);
FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD);
if (ctx->Depth.Mask) {
- FX_grDepthMask(FXTRUE);
+ grDepthMask(FXTRUE);
}
break;
case DD_FRONT_LEFT_BIT:
/* front buffer only */
- FX_grDepthMask(FXFALSE);
- FX_grRenderBuffer(GR_BUFFER_FRONTBUFFER);
+ grDepthMask(FXFALSE);
+ grRenderBuffer(GR_BUFFER_FRONTBUFFER);
FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD);
if (ctx->Depth.Mask) {
- FX_grDepthMask(FXTRUE);
+ grDepthMask(FXTRUE);
}
break;
case DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT:
/* front and back */
- FX_grDepthMask(FXFALSE);
- FX_grRenderBuffer(GR_BUFFER_BACKBUFFER);
+ grDepthMask(FXFALSE);
+ grRenderBuffer(GR_BUFFER_BACKBUFFER);
FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD);
- FX_grRenderBuffer(GR_BUFFER_FRONTBUFFER);
+ grRenderBuffer(GR_BUFFER_FRONTBUFFER);
FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD);
if (ctx->Depth.Mask) {
- FX_grDepthMask(FXTRUE);
+ grDepthMask(FXTRUE);
}
break;
case DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT | DD_DEPTH_BIT:
/* clear front */
- FX_grDepthMask(FXFALSE);
- FX_grRenderBuffer(GR_BUFFER_FRONTBUFFER);
+ grDepthMask(FXFALSE);
+ grRenderBuffer(GR_BUFFER_FRONTBUFFER);
FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD);
/* clear back and depth */
- FX_grDepthMask(FXTRUE);
- FX_grRenderBuffer(GR_BUFFER_BACKBUFFER);
+ grDepthMask(FXTRUE);
+ grRenderBuffer(GR_BUFFER_BACKBUFFER);
FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD);
if (!ctx->Depth.Mask) {
- FX_grDepthMask(FXFALSE);
+ grDepthMask(FXFALSE);
}
break;
case DD_DEPTH_BIT:
/* just the depth buffer */
- FX_grRenderBuffer(GR_BUFFER_BACKBUFFER);
- FX_grColorMask(FXFALSE, FXFALSE);
- FX_grDepthMask(FXTRUE);
+ grRenderBuffer(GR_BUFFER_BACKBUFFER);
+ grColorMask(FXFALSE, FXFALSE);
+ grDepthMask(FXTRUE);
FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD);
- FX_grColorMask(FXTRUE, ctx->Color.ColorMask[ACOMP]
- && fxMesa->haveAlphaBuffer);
+ grColorMask(FXTRUE, ctx->Color.ColorMask[ACOMP] && fxMesa->haveAlphaBuffer);
if (ctx->Color._DrawDestMask & FRONT_LEFT_BIT)
- FX_grRenderBuffer(GR_BUFFER_FRONTBUFFER);
+ grRenderBuffer(GR_BUFFER_FRONTBUFFER);
if (!ctx->Depth.Test || !ctx->Depth.Mask)
- FX_grDepthMask(FXFALSE);
+ grDepthMask(FXFALSE);
break;
default:
/* error */
if (mode == GL_FRONT_LEFT) {
fxMesa->currentFB = GR_BUFFER_FRONTBUFFER;
- FX_grRenderBuffer(fxMesa->currentFB);
+ grRenderBuffer(fxMesa->currentFB);
}
else if (mode == GL_BACK_LEFT) {
fxMesa->currentFB = GR_BUFFER_BACKBUFFER;
- FX_grRenderBuffer(fxMesa->currentFB);
+ grRenderBuffer(fxMesa->currentFB);
}
else if (mode == GL_NONE) {
- FX_grColorMask(FXFALSE, FXFALSE);
+ grColorMask(FXFALSE, FXFALSE);
}
else {
/* we'll need a software fallback */
}
info.size = sizeof(info);
- if (!FX_grLfbLock(GR_LFB_WRITE_ONLY,
- fxMesa->currentFB,
- GR_LFBWRITEMODE_565,
- GR_ORIGIN_UPPER_LEFT, FXFALSE, &info)) {
+ if (!grLfbLock(GR_LFB_WRITE_ONLY,
+ fxMesa->currentFB,
+ GR_LFBWRITEMODE_565,
+ GR_ORIGIN_UPPER_LEFT, FXFALSE, &info)) {
#ifndef FX_SILENT
fprintf(stderr, "fx Driver: error locking the linear frame buffer\n");
#endif
}
}
- FX_grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB);
+ grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB);
}
static void
fxDDFinish(GLcontext * ctx)
{
- FX_grFlush();
+ grFlush();
}
static const GLubyte *
fxDDGetString(GLcontext * ctx, GLenum name)
{
- switch (name) {
- case GL_RENDERER:
- {
- static char buf[80];
-
- if (glbHWConfig.SSTs[glbCurrentBoard].type == GR_SSTTYPE_VOODOO) {
- GrVoodooConfig_t *vc =
- &glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig;
-
- sprintf(buf,
- "Mesa Glide v0.30 Voodoo_Graphics %d "
- "CARD/%d FB/%d TM/%d TMU/%s",
- glbCurrentBoard,
- (vc->sliDetect ? (vc->fbRam * 2) : vc->fbRam),
- (vc->tmuConfig[GR_TMU0].tmuRam +
- ((vc->nTexelfx > 1) ? vc->tmuConfig[GR_TMU1].
- tmuRam : 0)), vc->nTexelfx,
- (vc->sliDetect ? "SLI" : "NOSLI"));
- }
- else if (glbHWConfig.SSTs[glbCurrentBoard].type == GR_SSTTYPE_SST96) {
- GrSst96Config_t *sc =
- &glbHWConfig.SSTs[glbCurrentBoard].sstBoard.SST96Config;
-
- sprintf(buf,
- "Glide v0.30 Voodoo_Rush %d "
- "CARD/%d FB/%d TM/%d TMU/NOSLI",
- glbCurrentBoard,
- sc->fbRam, sc->tmuConfig.tmuRam, sc->nTexelfx);
- }
- else {
- strcpy(buf, "Glide v0.30 UNKNOWN");
- }
- return (GLubyte *) buf;
- }
- default:
- return NULL;
- }
+ switch (name) {
+ case GL_RENDERER:
+ {
+ static char buf[80];
+ GrVoodooConfig_t *vc = &glbHWConfig.SSTs[glbCurrentBoard].VoodooConfig;
+ sprintf(buf, "Mesa %s v0.31 %s %dMB FB, %dMB TM, %d TMU, %s",
+ grGetString(GR_RENDERER),
+ grGetString(GR_HARDWARE),
+ vc->fbRam,
+ (vc->tmuConfig[GR_TMU0].tmuRam + ((vc->nTexelfx > 1) ? vc->tmuConfig[GR_TMU1].tmuRam : 0)),
+ (vc->nTexelfx * vc->numChips),
+ (vc->numChips > 1) ? "SLI" : "NOSLI");
+ return (GLubyte *)buf;
+ }
+ default:
+ return NULL;
+ }
}
static const struct gl_pipeline_stage *fx_pipeline[] = {
fxMesa->unitsState.depthMask = GL_TRUE;
fxMesa->unitsState.depthTestFunc = GR_CMP_LESS;
- FX_grColorMask(FXTRUE, fxMesa->haveAlphaBuffer ? FXTRUE : FXFALSE);
+ grColorMask(FXTRUE, fxMesa->haveAlphaBuffer ? FXTRUE : FXFALSE);
if (fxMesa->haveDoubleBuffer) {
fxMesa->currentFB = GR_BUFFER_BACKBUFFER;
- FX_grRenderBuffer(GR_BUFFER_BACKBUFFER);
+ grRenderBuffer(GR_BUFFER_BACKBUFFER);
}
else {
fxMesa->currentFB = GR_BUFFER_FRONTBUFFER;
- FX_grRenderBuffer(GR_BUFFER_FRONTBUFFER);
+ grRenderBuffer(GR_BUFFER_FRONTBUFFER);
}
- fxMesa->state = malloc(FX_grGetInteger(FX_GLIDE_STATE_SIZE));
- fxMesa->fogTable = (GrFog_t *) malloc(FX_grGetInteger(FX_FOG_TABLE_ENTRIES) *
+ fxMesa->state = malloc(FX_grGetInteger(GR_GLIDE_STATE_SIZE));
+ fxMesa->fogTable = (GrFog_t *) malloc(FX_grGetInteger(GR_FOG_TABLE_ENTRIES) *
sizeof(GrFog_t));
if (!fxMesa->state || !fxMesa->fogTable) {
}
if (fxMesa->haveZBuffer)
- FX_grDepthBufferMode(GR_DEPTHBUFFER_ZBUFFER);
+ grDepthBufferMode(GR_DEPTHBUFFER_ZBUFFER);
-#ifndef FXMESA_USE_ARGB
- FX_grLfbWriteColorFormat(GR_COLORFORMAT_ABGR); /* Not every Glide has this */
-#endif
+ grLfbWriteColorFormat(GR_COLORFORMAT_ABGR);
- fxMesa->textureAlign = FX_grGetInteger(FX_TEXTURE_ALIGN);
- fxMesa->glCtx->Const.MaxTextureLevels = 9;
+ fxMesa->textureAlign = FX_grGetInteger(GR_TEXTURE_ALIGN);
+ /* [koolsmoky] */
+ {
+ int textureSize = ((fxMesa->maxTextureSize > 2048) ? 2048 : fxMesa->maxTextureSize);
+ fxMesa->glCtx->Const.MaxTextureLevels = 0;
+ do {
+ fxMesa->glCtx->Const.MaxTextureLevels++;
+ } while ((textureSize >>= 0x1) & 0x7ff);
+ }
fxMesa->glCtx->Const.MaxTextureUnits = fxMesa->haveTwoTMUs ? 2 : 1;
fxMesa->new_state = _NEW_ALL;
_tnl_CreateContext(fxMesa->glCtx);
_swsetup_CreateContext(fxMesa->glCtx);
+ /* Install customized pipeline */
_tnl_destroy_pipeline(fxMesa->glCtx);
_tnl_install_pipeline(fxMesa->glCtx, fx_pipeline);
fxDDInitExtensions(fxMesa->glCtx);
- FX_grGlideGetState((GrState *) fxMesa->state);
+ grGlideGetState((GrState *) fxMesa->state);
return 1;
}
/* Hack alert:
- * Depth32 functions won't compile with Glide2
+ * The performance hit is disastruous for SPAN functions.
+ * Should we use SpanRenderStart / SpanRenderFinish in `swrast.h'
+ * for locking / unlocking the LFB?
* Optimize and check endianess for `read_R8G8B8_pixels'
*/
-/* $Id: fxddspan.c,v 1.23 2003/07/17 14:50:12 brianp Exp $ */
+/* $Id: fxddspan.c,v 1.24 2003/08/19 15:52:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Brian Paul
* Daryll Strauss
* Keith Whitwell
+ * Daniel Borca
+ * Hiroshi Morii
*/
#endif
-#if !defined(FXMESA_USE_ARGB)
-
-
#define writeRegionClipped(fxm,dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \
FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data)
src_data) \
-#else /* !defined(FXMESA_USE_RGBA) */
-
-#define writeRegionClipped(fxm,dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \
- FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data)
-
-
-#define MESACOLOR_TO_ARGB(c) ( \
- ( ((unsigned int)(c[ACOMP]))<<24 ) | \
- ( ((unsigned int)(c[RCOMP]))<<16 ) | \
- ( ((unsigned int)(c[GCOMP]))<<8 ) | \
- ( (unsigned int)(c[BCOMP])) )
-
-inline void
-LFB_WRITE_SPAN_MESA(GrBuffer_t dst_buffer,
- FxU32 dst_x,
- FxU32 dst_y,
- FxU32 src_width, FxI32 src_stride, void *src_data)
-{
- /* Covert to ARGB */
- GLubyte(*rgba)[4] = src_data;
- GLuint argb[MAX_WIDTH];
- int i;
-
- for (i = 0; i < src_width; i++) {
- argb[i] = MESACOLOR_TO_ARGB(rgba[i]);
- }
- writeRegionClipped( /*fxMesa, */ NULL, dst_buffer,
- dst_x,
- dst_y,
- GR_LFB_SRC_FMT_8888,
- src_width, 1, src_stride, (void *) argb);
-}
-
-#endif /* !defined(FXMESA_USE_RGBA) */
-
-
/************************************************************************/
/***** Span functions *****/
/************************************************************************/
{
fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx;
BEGIN_BOARD_LOCK();
- FX_grLfbReadRegion(fxMesa->currentFB, x, fxMesa->height - 1 - y, n, 1, n * 4, rgba);
+ grLfbReadRegion(fxMesa->currentFB, x, fxMesa->height - 1 - y, n, 1, n * 4, rgba);
END_BOARD_LOCK();
}
{
fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx;
GLint bottom = fxMesa->height - 1;
+ GLint i;
if (MESA_VERBOSE & VERBOSE_DRIVER) {
fprintf(stderr, "fxmesa: fxDDWriteDepth32Span(...)\n");
if (mask) {
- GLint i;
for (i = 0; i < n; i++) {
if (mask[i]) {
+ GLuint d = depth[i] << 8;
writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER, x + i, bottom - y,
- GR_LFBWRITEMODE_Z32, 1, 1, 0, (void *) &depth[i]);
+ GR_LFBWRITEMODE_Z32, 1, 1, 0, (void *) &d);
}
}
}
else {
+ GLuint depth32[MAX_WIDTH];
+ for (i = 0; i < n; i++) {
+ depth32[i] = depth[i] << 8;
+ }
writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER, x, bottom - y,
- GR_LFBWRITEMODE_Z32, n, 1, 0, (void *) depth);
+ GR_LFBWRITEMODE_Z32, n, 1, 0, (void *) depth32);
}
}
fprintf(stderr, "fxmesa: fxDDReadDepthSpan(...)\n");
}
- FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER, x, bottom - y, n, 1, 0, depth16);
+ grLfbReadRegion(GR_BUFFER_AUXBUFFER, x, bottom - y, n, 1, 0, depth16);
for (i = 0; i < n; i++) {
depth[i] = depth16[i];
}
fprintf(stderr, "fxmesa: fxDDReadDepth32Span(...)\n");
}
- FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER, x, bottom - y, n, 1, 0, depth);
+ grLfbReadRegion(GR_BUFFER_AUXBUFFER, x, bottom - y, n, 1, 0, depth);
}
if (mask[i]) {
int xpos = x[i];
int ypos = bottom - y[i];
+ GLuint d = depth[i] << 8;
writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER, xpos, ypos,
- GR_LFBWRITEMODE_Z32, 1, 1, 0, (void *) &depth[i]);
+ GR_LFBWRITEMODE_Z32, 1, 1, 0, (void *) &d);
}
}
}
int xpos = x[i];
int ypos = bottom - y[i];
GLushort d;
- FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER, xpos, ypos, 1, 1, 0, &d);
+ grLfbReadRegion(GR_BUFFER_AUXBUFFER, xpos, ypos, 1, 1, 0, &d);
depth[i] = d;
}
}
for (i = 0; i < n; i++) {
int xpos = x[i];
int ypos = bottom - y[i];
- FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER, xpos, ypos, 1, 1, 0, &depth[i]);
+ grLfbReadRegion(GR_BUFFER_AUXBUFFER, xpos, ypos, 1, 1, 0, &depth[i]);
}
}
if (bufferBit == FRONT_LEFT_BIT) {
fxMesa->currentFB = GR_BUFFER_FRONTBUFFER;
- FX_grRenderBuffer(fxMesa->currentFB);
+ grRenderBuffer(fxMesa->currentFB);
}
else if (bufferBit == BACK_LEFT_BIT) {
fxMesa->currentFB = GR_BUFFER_BACKBUFFER;
- FX_grRenderBuffer(fxMesa->currentFB);
+ grRenderBuffer(fxMesa->currentFB);
}
}
-/* $Id: fxddtex.c,v 1.46 2001/11/06 16:01:19 brianp Exp $ */
+/* $Id: fxddtex.c,v 1.47 2003/08/19 15:52:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Brian Paul
* Daryll Strauss
* Keith Whitwell
+ * Daniel Borca
+ * Hiroshi Morii
*/
/* apply any lod biasing right now */
if (pname == GL_TEXTURE_LOD_BIAS_EXT) {
- FX_grTexLodBiasValue(GR_TMU0, *param);
+ grTexLodBiasValue(GR_TMU0, *param);
if (fxMesa->haveTwoTMUs) {
- FX_grTexLodBiasValue(GR_TMU1, *param);
+ grTexLodBiasValue(GR_TMU1, *param);
}
}
if (state) {
fxMesa->haveGlobalPaletteTexture = 1;
- FX_grTexDownloadTable(GR_TMU0, GR_TEXTABLE_PALETTE,
- &(fxMesa->glbPalette));
- if (fxMesa->haveTwoTMUs)
- FX_grTexDownloadTable(GR_TMU1, GR_TEXTABLE_PALETTE,
- &(fxMesa->glbPalette));
+ grTexDownloadTable(GR_TEXTABLE_PALETTE, &(fxMesa->glbPalette));
}
else {
fxMesa->haveGlobalPaletteTexture = 0;
float *sscale, float *tscale,
int *i_sscale, int *i_tscale, int *wscale, int *hscale)
{
-
- static GrLOD_t lod[9] = { GR_LOD_256, GR_LOD_128, GR_LOD_64, GR_LOD_32,
+ /* [koolsmoky] */
+ static GrLOD_t lod[12] = { GR_LOD_2048, GR_LOD_1024, GR_LOD_512, GR_LOD_256, GR_LOD_128, GR_LOD_64, GR_LOD_32,
GR_LOD_16, GR_LOD_8, GR_LOD_4, GR_LOD_2, GR_LOD_1
};
switch (logw - logh) {
case 0:
aspectratio = GR_ASPECT_1x1;
- l = lod[8 - logw];
+ l = lod[11 - logw];
s = t = 256.0f;
is = it = INT_TRICK(8);
ws = hs = 1;
break;
case 1:
aspectratio = GR_ASPECT_2x1;
- l = lod[8 - logw];
+ l = lod[11 - logw];
s = 256.0f;
t = 128.0f;
is = INT_TRICK(8);
break;
case 2:
aspectratio = GR_ASPECT_4x1;
- l = lod[8 - logw];
+ l = lod[11 - logw];
s = 256.0f;
t = 64.0f;
is = INT_TRICK(8);
break;
case 3:
aspectratio = GR_ASPECT_8x1;
- l = lod[8 - logw];
+ l = lod[11 - logw];
s = 256.0f;
t = 32.0f;
is = INT_TRICK(8);
break;
case 4:
aspectratio = GR_ASPECT_8x1;
- l = lod[8 - logw];
+ l = lod[11 - logw];
s = 256.0f;
t = 32.0f;
is = INT_TRICK(8);
break;
case 5:
aspectratio = GR_ASPECT_8x1;
- l = lod[8 - logw];
+ l = lod[11 - logw];
s = 256.0f;
t = 32.0f;
is = INT_TRICK(8);
break;
case 6:
aspectratio = GR_ASPECT_8x1;
- l = lod[8 - logw];
+ l = lod[11 - logw];
s = 256.0f;
t = 32.0f;
is = INT_TRICK(8);
break;
case 7:
aspectratio = GR_ASPECT_8x1;
- l = lod[8 - logw];
+ l = lod[11 - logw];
s = 256.0f;
t = 32.0f;
is = INT_TRICK(8);
break;
case 8:
aspectratio = GR_ASPECT_8x1;
- l = lod[8 - logw];
+ l = lod[11 - logw];
s = 256.0f;
t = 32.0f;
is = INT_TRICK(8);
ws = 1;
hs = 32;
break;
+ case 9:
+ aspectratio = GR_ASPECT_8x1;
+ l = lod[11 - logw];
+ s = 256.0f;
+ t = 32.0f;
+ is = INT_TRICK(8);
+ it = INT_TRICK(5);
+ ws = 1;
+ hs = 64;
+ break;
+ case 10:
+ aspectratio = GR_ASPECT_8x1;
+ l = lod[11 - logw];
+ s = 256.0f;
+ t = 32.0f;
+ is = INT_TRICK(8);
+ it = INT_TRICK(5);
+ ws = 1;
+ hs = 128;
+ break;
+ case 11:
+ aspectratio = GR_ASPECT_8x1;
+ l = lod[11 - logw];
+ s = 256.0f;
+ t = 32.0f;
+ is = INT_TRICK(8);
+ it = INT_TRICK(5);
+ ws = 1;
+ hs = 256;
+ break;
case -1:
aspectratio = GR_ASPECT_1x2;
- l = lod[8 - logh];
+ l = lod[11 - logh];
s = 128.0f;
t = 256.0f;
is = INT_TRICK(7);
break;
case -2:
aspectratio = GR_ASPECT_1x4;
- l = lod[8 - logh];
+ l = lod[11 - logh];
s = 64.0f;
t = 256.0f;
is = INT_TRICK(6);
break;
case -3:
aspectratio = GR_ASPECT_1x8;
- l = lod[8 - logh];
+ l = lod[11 - logh];
s = 32.0f;
t = 256.0f;
is = INT_TRICK(5);
break;
case -4:
aspectratio = GR_ASPECT_1x8;
- l = lod[8 - logh];
+ l = lod[11 - logh];
s = 32.0f;
t = 256.0f;
is = INT_TRICK(5);
break;
case -5:
aspectratio = GR_ASPECT_1x8;
- l = lod[8 - logh];
+ l = lod[11 - logh];
s = 32.0f;
t = 256.0f;
is = INT_TRICK(5);
break;
case -6:
aspectratio = GR_ASPECT_1x8;
- l = lod[8 - logh];
+ l = lod[11 - logh];
s = 32.0f;
t = 256.0f;
is = INT_TRICK(5);
break;
case -7:
aspectratio = GR_ASPECT_1x8;
- l = lod[8 - logh];
+ l = lod[11 - logh];
s = 32.0f;
t = 256.0f;
is = INT_TRICK(5);
break;
case -8:
aspectratio = GR_ASPECT_1x8;
- l = lod[8 - logh];
+ l = lod[11 - logh];
s = 32.0f;
t = 256.0f;
is = INT_TRICK(5);
ws = 32;
hs = 1;
break;
+ case -9:
+ aspectratio = GR_ASPECT_1x8;
+ l = lod[11 - logh];
+ s = 32.0f;
+ t = 256.0f;
+ is = INT_TRICK(5);
+ it = INT_TRICK(8);
+ ws = 64;
+ hs = 1;
+ break;
+ case -10:
+ aspectratio = GR_ASPECT_1x8;
+ l = lod[11 - logh];
+ s = 32.0f;
+ t = 256.0f;
+ is = INT_TRICK(5);
+ it = INT_TRICK(8);
+ ws = 128;
+ hs = 1;
+ break;
+ case -11:
+ aspectratio = GR_ASPECT_1x8;
+ l = lod[11 - logh];
+ s = 32.0f;
+ t = 256.0f;
+ is = INT_TRICK(5);
+ it = INT_TRICK(8);
+ ws = 256;
+ hs = 1;
+ break;
default:
return 0;
break;
* Glide internal texture format and base texture format.
*/
void
-fxTexGetFormat(GLenum glformat, GrTextureFormat_t * tfmt, GLint * ifmt)
+fxTexGetFormat(GLcontext *ctx, GLenum glformat, GrTextureFormat_t * tfmt, GLint * ifmt) /* [koolsmoky] */
{
+ fxMesaContext fxMesa = FX_CONTEXT(ctx);
+
switch (glformat) {
case 1:
case GL_LUMINANCE:
if (ifmt)
(*ifmt) = GL_ALPHA;
break;
- case 3:
- case GL_RGB:
case GL_R3_G3_B2:
case GL_RGB4:
case GL_RGB5:
+ if (tfmt)
+ (*tfmt) = GR_TEXFMT_RGB_565;
+ if (ifmt)
+ (*ifmt) = GL_RGB;
+ break;
+ case 3:
+ case GL_RGB:
case GL_RGB8:
case GL_RGB10:
case GL_RGB12:
case GL_RGB16:
+#if 0 /* [koolsmoky] getting ready for 32bpp textures */
+ if (fxMesa->colDepth == 32) {
+ if (tfmt) (*tfmt) = GR_TEXFMT_ARGB_8888;
+ } else {
+ if (tfmt) (*tfmt) = GR_TEXFMT_RGB_565;
+ }
+ if (ifmt) (*ifmt) = GL_RGB;
+#else
if (tfmt)
(*tfmt) = GR_TEXFMT_RGB_565;
if (ifmt)
(*ifmt) = GL_RGB;
+#endif
break;
- case 4:
- case GL_RGBA:
case GL_RGBA2:
case GL_RGBA4:
+ if (tfmt)
+ (*tfmt) = GR_TEXFMT_ARGB_4444;
+ if (ifmt)
+ (*ifmt) = GL_RGBA;
+ break;
+ case 4:
+ case GL_RGBA:
case GL_RGBA8:
case GL_RGB10_A2:
case GL_RGBA12:
case GL_RGBA16:
+#if 0 /* [koolsmoky] getting ready for 32bpp textures */
+ if (fxMesa->colDepth == 32) {
+ if (tfmt) (*tfmt) = GR_TEXFMT_ARGB_8888;
+ } else {
+ if (tfmt) (*tfmt) = GR_TEXFMT_ARGB_4444;
+ }
+ if (ifmt) (*ifmt) = GL_RGBA;
+#else
if (tfmt)
(*tfmt) = GR_TEXFMT_ARGB_4444;
if (ifmt)
(*ifmt) = GL_RGBA;
- break;
+#endif
+ break;
case GL_RGB5_A1:
if (tfmt)
(*tfmt) = GR_TEXFMT_ARGB_1555;
}
+#if 0 /* [koolsmoky] getting ready for 32bpp textures */
+static void
+fetch_a8r8g8b8(const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLvoid * texelOut)
+{
+ GLchan *rgba = (GLchan *) texelOut;
+ const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage);
+ const GLuint *texel;
+
+ i = i * mml->wScale;
+ j = j * mml->hScale;
+
+ texel = ((GLuint *) texImage->Data) + j * mml->width + i;
+ rgba[RCOMP] = (((*texel) >> 16) & 0xff);
+ rgba[GCOMP] = (((*texel) >> 8) & 0xff);
+ rgba[BCOMP] = (((*texel)) & 0xff);
+ rgba[ACOMP] = (((*texel) >> 24) & 0xff);
+}
+#endif
+
+
static void
PrintTexture(int w, int h, int c, const GLubyte * data)
{
fxDDChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
GLenum srcFormat, GLenum srcType )
{
+ fxMesaContext fxMesa = FX_CONTEXT(ctx);
+
switch (internalFormat) {
case GL_INTENSITY:
case GL_INTENSITY4:
case GL_LUMINANCE12_ALPHA12:
case GL_LUMINANCE16_ALPHA16:
return &_mesa_texformat_al88;
- case 3:
- case GL_RGB:
case GL_R3_G3_B2:
case GL_RGB4:
case GL_RGB5:
+ return &_mesa_texformat_rgb565;
+ case 3:
+ case GL_RGB:
case GL_RGB8:
case GL_RGB10:
case GL_RGB12:
case GL_RGB16:
+#if 0 /* [koolsmoky] getting ready for 32bpp textures */
+ return (fxMesa->colDepth == 32) ? &_mesa_texformat_argb8888
+ : &_mesa_texformat_rgb565;
+#else
return &_mesa_texformat_rgb565;
- case 4:
- case GL_RGBA:
+#endif
case GL_RGBA2:
case GL_RGBA4:
+ return &_mesa_texformat_argb4444;
+ case 4:
+ case GL_RGBA:
case GL_RGBA8:
case GL_RGB10_A2:
case GL_RGBA12:
case GL_RGBA16:
+#if 0 /* [koolsmoky] getting ready for 32bpp textures */
+ return (fxMesa->colDepth == 32) ? &_mesa_texformat_argb8888
+ : &_mesa_texformat_argb4444;
+#else
return &_mesa_texformat_argb4444;
+#endif
case GL_RGB5_A1:
return &_mesa_texformat_argb1555;
default:
return GR_TEXFMT_ARGB_4444;
case MESA_FORMAT_ARGB1555:
return GR_TEXFMT_ARGB_1555;
+#if 0 /* [koolsmoky] getting ready for 32bpp textures */
+ case MESA_FORMAT_ARGB8888:
+ return GR_TEXFMT_ARGB_8888;
+#endif
default:
_mesa_problem(NULL, "Unexpected format in fxGlideFormat");
return 0;
return fetch_r4g4b4a4;
case MESA_FORMAT_ARGB1555:
return fetch_r5g5b5a1;
+#if 0 /* [koolsmoky] getting ready for 32bpp textures */
+ case MESA_FORMAT_ARGB8888:
+ return fetch_a8r8g8b8;
+#endif
default:
_mesa_problem(NULL, "Unexpected format in fxGlideFormat");
return NULL;
-/* $Id: fxdrv.h,v 1.57 2003/07/17 14:50:12 brianp Exp $ */
+/* $Id: fxdrv.h,v 1.58 2003/08/19 15:52:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Brian Paul
* Daryll Strauss
* Keith Whitwell
+ * Daniel Borca
+ * Hiroshi Morii
*/
/* fxsetup.c - 3Dfx VooDoo rendering mode setup functions */
-#if defined(FXMESA_USE_ARGB)
-#define FXCOLOR4( c ) ( \
- ( ((unsigned int)(c[3]))<<24 ) | \
- ( ((unsigned int)(c[0]))<<16 ) | \
- ( ((unsigned int)(c[1]))<<8 ) | \
- ( (unsigned int)(c[2])) )
-
-#else
#ifdef __i386__
#define FXCOLOR4( c ) (* (int *)c)
#else
( ((unsigned int)(c[1]))<<8 ) | \
( (unsigned int)(c[0])) )
#endif
-#endif
GLint swapInterval;
GLint maxPendingSwapBuffers;
- FX_GrContext_t glideContext;
+ GrContext_t glideContext;
int screen_width;
int screen_height;
int clipMaxY;
int colDepth;
+ int maxTextureSize; /* [koolsmoky] */
};
struct gl_texture_object *, GLint, GLint,
GLint);
-extern void fxTexGetFormat(GLenum, GrTextureFormat_t *, GLint *);
+extern void fxTexGetFormat(GLcontext *, GLenum, GrTextureFormat_t *, GLint *); /* [koolsmoky] */
+
extern int fxTexGetInfo(int, int, GrLOD_t *, GrAspectRatio_t *,
float *, float *, int *, int *, int *, int *);
-/* $Id: fxglidew.c,v 1.20 2003/07/17 14:50:12 brianp Exp $ */
+/* $Id: fxglidew.c,v 1.21 2003/08/19 15:52:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Brian Paul
* Daryll Strauss
* Keith Whitwell
+ * Daniel Borca
+ * Hiroshi Morii
*/
/* fxsetup.c - 3Dfx VooDoo rendering mode setup functions */
FxI32
FX_grGetInteger_NoLock(FxU32 pname)
{
-#if !defined(FX_GLIDE3)
- switch (pname) {
- case FX_FOG_TABLE_ENTRIES:
- return GR_FOG_TABLE_SIZE;
- case FX_GLIDE_STATE_SIZE:
- return sizeof(GrState);
- case FX_LFB_PIXEL_PIPE:
- return FXFALSE;
- case FX_PENDING_BUFFERSWAPS:
- return grBufferNumPending();
- case FX_TEXTURE_ALIGN:
- /* This is a guess from reading the glide3 docs */
- return 8;
- default:
- if (MESA_VERBOSE & VERBOSE_DRIVER) {
- fprintf(stderr, "Wrong parameter in FX_grGetInteger!\n");
- }
- return -1;
- }
-#else
- FxU32 grname;
- FxI32 result;
-
- switch (pname) {
- case FX_FOG_TABLE_ENTRIES:
- case FX_GLIDE_STATE_SIZE:
- case FX_LFB_PIXEL_PIPE:
- case FX_PENDING_BUFFERSWAPS:
- case FX_TEXTURE_ALIGN:
- grname = pname;
- break;
- default:
- if (MESA_VERBOSE & VERBOSE_DRIVER) {
- fprintf(stderr, "Wrong parameter in FX_grGetInteger!\n");
- }
- return -1;
- }
+ FxI32 result;
- grGet(grname, 4, &result);
- return result;
-#endif
-}
+ if (grGet(pname, 4, &result)) {
+ return result;
+ }
-FxI32
-FX_grGetInteger(FxU32 pname)
-{
- int result;
-
- BEGIN_BOARD_LOCK();
- result = FX_grGetInteger_NoLock(pname);
- END_BOARD_LOCK();
- return result;
-}
-
-
-FxBool
-FX_grLfbLock(GrLock_t type, GrBuffer_t buffer,
- GrLfbWriteMode_t writeMode, GrOriginLocation_t origin,
- FxBool pixelPipeline, GrLfbInfo_t * info)
-{
- FxBool result;
-
- BEGIN_BOARD_LOCK();
- result = grLfbLock(type, buffer, writeMode, origin, pixelPipeline, info);
- END_BOARD_LOCK();
- return result;
-}
-
-FxU32
-FX_grTexTextureMemRequired(FxU32 evenOdd, GrTexInfo * info)
-{
- FxU32 result;
-
- BEGIN_BOARD_LOCK();
- result = grTexTextureMemRequired(evenOdd, info);
- END_BOARD_LOCK();
- return result;
-}
-
-FxU32
-FX_grTexMinAddress(GrChipID_t tmu)
-{
- FxU32 result;
-
- BEGIN_BOARD_LOCK();
- result = grTexMinAddress(tmu);
- END_BOARD_LOCK();
- return result;
-}
-
-extern FxU32
-FX_grTexMaxAddress(GrChipID_t tmu)
-{
- FxU32 result;
-
- BEGIN_BOARD_LOCK();
- result = grTexMaxAddress(tmu);
- END_BOARD_LOCK();
- return result;
+ if (MESA_VERBOSE & VERBOSE_DRIVER) {
+ fprintf(stderr, "Wrong parameter in FX_grGetInteger!\n");
+ }
+ return -1;
}
FxBool
FX_grSstControl(FxU32 code)
{
-#if defined(FX_GLIDE3)
/* The glide 3 sources call for grEnable/grDisable to be called in exchange
* for grSstControl. */
switch (code) {
}
/* Appearently GR_CONTROL_RESIZE can be ignored. */
return 1; /* OK? */
-#else
- FxU32 result;
- BEGIN_BOARD_LOCK();
- result = grSstControl(code);
- END_BOARD_LOCK();
- return result;
-#endif
}
-#if defined(FX_GLIDE3)
-
-void
-FX_grGammaCorrectionValue(float val)
-{
- (void) val;
-/* ToDo */
-}
-
-int
-FX_getFogTableSize(void)
-{
- int result;
- BEGIN_BOARD_LOCK();
- grGet(GR_FOG_TABLE_ENTRIES, sizeof(int), (void *) &result);
- END_BOARD_LOCK();
- return result;
-}
-
-int
-FX_getGrStateSize(void)
-{
- int result;
- BEGIN_BOARD_LOCK();
- grGet(GR_GLIDE_STATE_SIZE, sizeof(int), (void *) &result);
- END_BOARD_LOCK();
-
- return result;
-
-}
-
int
FX_grSstScreenWidth()
{
return result[3];
}
-void
-FX_grGlideGetVersion(char *buf)
-{
- BEGIN_BOARD_LOCK();
- strcpy(buf, grGetString(GR_VERSION));
- END_BOARD_LOCK();
-}
-
void
FX_grSstPerfStats(GrSstPerfStats_t * st)
{
END_CLIP_LOOP();
}
-void
-FX_grDrawPolygonVertexList(int n, GrVertex * verts)
-{
- BEGIN_CLIP_LOOP();
- grDrawVertexArrayContiguous(GR_POLYGON, n, verts, sizeof(GrVertex));
- END_CLIP_LOOP();
-}
-
void
FX_setupGrVertexLayout(void)
{
}
}
-void
-FX_grHints(GrHint_t hintType, FxU32 hintMask)
-{
- BEGIN_BOARD_LOCK();
- FX_grHints_NoLock(hintType, hintMask);
- END_BOARD_LOCK();
-}
-
/*
* Glide3 doesn't have the grSstQueryHardware function anymore.
* Instead, we call grGet() and fill in the data structures ourselves.
for (i = 0; i < config->num_sst; i++) {
FxI32 result;
+ const char *extension;
- config->SSTs[i].type = GR_SSTTYPE_VOODOO;
grSstSelect(i);
+ extension = grGetString(GR_HARDWARE);
+ if (strstr(extension, "Voodoo Banshee")) {
+ config->SSTs[i].type = GR_SSTTYPE_Banshee;
+ } else if (strstr(extension, "Voodoo3")) {
+ config->SSTs[i].type = GR_SSTTYPE_Voodoo3;
+ } else if (strstr(extension, "Voodoo4")) {
+ config->SSTs[i].type = GR_SSTTYPE_Voodoo4;
+ } else if (strstr(extension, "Voodoo5")) {
+ config->SSTs[i].type = GR_SSTTYPE_Voodoo5;
+ } else { /* Voodoo1,2,rush */
+ /* ZZZ TO DO */
+ config->SSTs[i].type = GR_SSTTYPE_VOODOO;
+ }
+
grGet(GR_MEMORY_FB, 4, &result);
- config->SSTs[i].sstBoard.VoodooConfig.fbRam = result / (1024 * 1024);
+ config->SSTs[i].VoodooConfig.fbRam = result / (1024 * 1024);
grGet(GR_NUM_TMU, 4, &result);
- config->SSTs[i].sstBoard.VoodooConfig.nTexelfx = result;
+ config->SSTs[i].VoodooConfig.nTexelfx = result;
grGet(GR_REVISION_FB, 4, &result);
- config->SSTs[i].sstBoard.VoodooConfig.fbiRev = result;
+ config->SSTs[i].VoodooConfig.fbiRev = result;
- grGet(GR_NUM_FB, 4, (void *) &numFB);
- if (numFB > 1)
- config->SSTs[i].sstBoard.VoodooConfig.sliDetect = FXTRUE;
- else
- config->SSTs[i].sstBoard.VoodooConfig.sliDetect = FXFALSE;
-
- for (j = 0; j < config->SSTs[i].sstBoard.VoodooConfig.nTexelfx; j++) {
+ for (j = 0; j < config->SSTs[i].VoodooConfig.nTexelfx; j++) {
grGet(GR_MEMORY_TMU, 4, &result);
- config->SSTs[i].sstBoard.VoodooConfig.tmuConfig[j].tmuRam =
- result / (1024 * 1024);
+ config->SSTs[i].VoodooConfig.tmuConfig[j].tmuRam = result / (1024 * 1024);
grGet(GR_REVISION_TMU, 4, &result);
- config->SSTs[i].sstBoard.VoodooConfig.tmuConfig[j].tmuRev = result;
+ config->SSTs[i].VoodooConfig.tmuConfig[j].tmuRev = result;
}
- {
- const char *extension = grGetString(GR_EXTENSION);
- if (strstr(extension, " PIXEXT ")) {
- config->SSTs[i].sstBoard.VoodooConfig.gExt.grSstWinOpen = grGetProcAddress("grSstWinOpenExt");
- }
+ extension = grGetString(GR_EXTENSION);
+ if (strstr(extension, " PIXEXT ")) {
+ config->SSTs[i].VoodooConfig.grSstWinOpenExt = grGetProcAddress("grSstWinOpenExt");
}
- }
- END_BOARD_LOCK();
- return 1;
-}
-
-#else
-
-int
-FX_grSstScreenWidth()
-{
- int i;
- BEGIN_BOARD_LOCK();
- i = grSstScreenWidth();
- END_BOARD_LOCK();
- return i;
-}
-int
-FX_grSstScreenHeight()
-{
- int i;
- BEGIN_BOARD_LOCK();
- i = grSstScreenHeight();
- END_BOARD_LOCK();
- return i;
-}
+ /* [koolsmoky] */
+ grGet(GR_MAX_TEXTURE_SIZE, 4, &result);
+ config->SSTs[i].VoodooConfig.maxTextureSize = result;
-int
-FX_grSstQueryHardware(GrHwConfiguration * c)
-{
- int i;
- BEGIN_BOARD_LOCK();
- i = grSstQueryHardware(c);
+ /* need to get the number of SLI units for napalm */
+ grGet(GR_NUM_FB, 4, (void *) &numFB);
+ config->SSTs[i].VoodooConfig.numChips = numFB;
+ /* this can only be useful for Voodoo2:
+ * sliDetect = ((config->SSTs[i].type == GR_SSTTYPE_Voodoo2) && (numFB > 1));
+ */
+ }
END_BOARD_LOCK();
- return i;
+ return 1;
}
-#endif /* FX_GLIDE3 */
-
/* It appears to me that this function is needed either way. */
-FX_GrContext_t
+GrContext_t
FX_grSstWinOpen(struct SstCard_St *c,
FxU32 hWnd,
GrScreenResolution_t screen_resolution,
GrOriginLocation_t origin_location,
int nColBuffers, int nAuxBuffers)
{
- FX_GrContext_t i;
+ GrContext_t i;
BEGIN_BOARD_LOCK();
- if ((c->type == GR_SSTTYPE_VOODOO) && c->sstBoard.VoodooConfig.gExt.grSstWinOpen) {
- i = c->sstBoard.VoodooConfig.gExt.grSstWinOpen(hWnd,
- screen_resolution,
- refresh_rate,
- color_format, origin_location,
- pixel_format,
- nColBuffers, nAuxBuffers);
+ if (c->VoodooConfig.grSstWinOpenExt) {
+ i = c->VoodooConfig.grSstWinOpenExt(hWnd,
+ screen_resolution,
+ refresh_rate,
+ color_format, origin_location,
+ pixel_format,
+ nColBuffers, nAuxBuffers);
} else
i = grSstWinOpen(hWnd,
screen_resolution,
-/* $Id: fxglidew.h,v 1.14 2003/07/17 14:50:12 brianp Exp $ */
+/* $Id: fxglidew.h,v 1.15 2003/08/19 15:52:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Brian Paul
* Daryll Strauss
* Keith Whitwell
+ * Daniel Borca
+ * Hiroshi Morii
*/
#ifndef __FX_GLIDE_WARPER__
#define __FX_GLIDE_WARPER__
-#include <glide.h>
-/*
- * General context:
- */
-#if !defined(FX_GLIDE3)
-typedef FxU32 FX_GrContext_t; /* Not used in Glide2 */
-typedef FxU32 GrPixelFormat_t;
-#else
+#include <glide.h>
#include <g3ext.h>
-typedef GrContext_t FX_GrContext_t;
-#endif
-/*
- * Glide3 emulation on Glide2:
- */
-#if !defined(FX_GLIDE3)
- /* Constanst for FX_grGetInteger( ) */
-#define FX_FOG_TABLE_ENTRIES 0x0004 /* The number of entries in the hardware fog table. */
-#define FX_GLIDE_STATE_SIZE 0x0006 /* Size of buffer, in bytes, needed to save Glide state. */
-#define FX_LFB_PIXEL_PIPE 0x0009 /* 1 if LFB writes can go through the 3D pixel pipe. */
-#define FX_PENDING_BUFFERSWAPS 0x0014 /* The number of buffer swaps pending. */
-#define FX_TEXTURE_ALIGN 0x0024 /* The required alignment for textures */
-#else
-#define FX_FOG_TABLE_ENTRIES GR_FOG_TABLE_ENTRIES
-#define FX_GLIDE_STATE_SIZE GR_GLIDE_STATE_SIZE
-#define FX_LFB_PIXEL_PIPE GR_LFB_PIXEL_PIPE
-#define FX_PENDING_BUFFERSWAPS GR_PENDING_BUFFERSWAPS
-#define FX_TEXTURE_ALIGN GR_TEXTURE_ALIGN
-#endif
-/*
- * Genral warper functions for Glide2/Glide3:
- */
-extern FxI32 FX_grGetInteger(FxU32 pname);
+
+#define FX_grGetInteger FX_grGetInteger_NoLock
extern FxI32 FX_grGetInteger_NoLock(FxU32 pname);
-/*
- * Glide2 emulation on Glide3:
- */
-#if defined(FX_GLIDE3)
-
-#define GR_ASPECT_1x1 GR_ASPECT_LOG2_1x1
-#define GR_ASPECT_2x1 GR_ASPECT_LOG2_2x1
-#define GR_ASPECT_4x1 GR_ASPECT_LOG2_4x1
-#define GR_ASPECT_8x1 GR_ASPECT_LOG2_8x1
-#define GR_ASPECT_1x2 GR_ASPECT_LOG2_1x2
-#define GR_ASPECT_1x4 GR_ASPECT_LOG2_1x4
-#define GR_ASPECT_1x8 GR_ASPECT_LOG2_1x8
-
-#define GR_LOD_256 GR_LOD_LOG2_256
-#define GR_LOD_128 GR_LOD_LOG2_128
-#define GR_LOD_64 GR_LOD_LOG2_64
-#define GR_LOD_32 GR_LOD_LOG2_32
-#define GR_LOD_16 GR_LOD_LOG2_16
-#define GR_LOD_8 GR_LOD_LOG2_8
-#define GR_LOD_4 GR_LOD_LOG2_4
-#define GR_LOD_2 GR_LOD_LOG2_2
-#define GR_LOD_1 GR_LOD_LOG2_1
-
-#define GR_FOG_WITH_TABLE GR_FOG_WITH_TABLE_ON_Q
+
+
+#define GR_ASPECT_1x1 GR_ASPECT_LOG2_1x1
+#define GR_ASPECT_2x1 GR_ASPECT_LOG2_2x1
+#define GR_ASPECT_4x1 GR_ASPECT_LOG2_4x1
+#define GR_ASPECT_8x1 GR_ASPECT_LOG2_8x1
+#define GR_ASPECT_1x2 GR_ASPECT_LOG2_1x2
+#define GR_ASPECT_1x4 GR_ASPECT_LOG2_1x4
+#define GR_ASPECT_1x8 GR_ASPECT_LOG2_1x8
+
+#define GR_LOD_2048 GR_LOD_LOG2_2048 /* [koolsmoky] big texture support for napalm */
+#define GR_LOD_1024 GR_LOD_LOG2_1024
+#define GR_LOD_512 GR_LOD_LOG2_512
+#define GR_LOD_256 GR_LOD_LOG2_256
+#define GR_LOD_128 GR_LOD_LOG2_128
+#define GR_LOD_64 GR_LOD_LOG2_64
+#define GR_LOD_32 GR_LOD_LOG2_32
+#define GR_LOD_16 GR_LOD_LOG2_16
+#define GR_LOD_8 GR_LOD_LOG2_8
+#define GR_LOD_4 GR_LOD_LOG2_4
+#define GR_LOD_2 GR_LOD_LOG2_2
+#define GR_LOD_1 GR_LOD_LOG2_1
+
+#define GR_FOG_WITH_TABLE GR_FOG_WITH_TABLE_ON_Q
+
+
typedef int GrSstType;
-#define MAX_NUM_SST 4
-
-#define GR_SSTTYPE_VOODOO 0
-#define GR_SSTTYPE_SST96 1
-#define GR_SSTTYPE_AT3D 2
-#define GR_SSTTYPE_Voodoo2 3
-
-typedef struct GrTMUConfig_St
-{
- int tmuRev; /* Rev of Texelfx chip */
- int tmuRam; /* 1, 2, or 4 MB */
-}
-GrTMUConfig_t;
-
-typedef struct GrVoodooConfig_St
-{
- int fbRam; /* 1, 2, or 4 MB */
- int fbiRev; /* Rev of Pixelfx chip */
- int nTexelfx; /* How many texelFX chips are there? */
- FxBool sliDetect; /* Is it a scan-line interleaved board? */
- struct { /* Glide extensions */
- GrProc grSstWinOpen;
- } gExt;
- GrTMUConfig_t tmuConfig[GLIDE_NUM_TMU]; /* Configuration of the Texelfx chips */
-}
-GrVoodooConfig_t;
-
-typedef struct GrSst96Config_St
-{
- int fbRam; /* How much? */
- int nTexelfx;
- GrTMUConfig_t tmuConfig;
-}
-GrSst96Config_t;
-
-typedef GrVoodooConfig_t GrVoodoo2Config_t;
-
-typedef struct GrAT3DConfig_St
-{
- int rev;
-}
-GrAT3DConfig_t;
-
-typedef struct
-{
- int num_sst; /* # of HW units in the system */
- struct SstCard_St
- {
- GrSstType type; /* Which hardware is it? */
- union SstBoard_u
- {
- GrVoodooConfig_t VoodooConfig;
- GrSst96Config_t SST96Config;
- GrAT3DConfig_t AT3DConfig;
- GrVoodoo2Config_t Voodoo2Config;
- }
- sstBoard;
- }
- SSTs[MAX_NUM_SST]; /* configuration for each board */
-}
-GrHwConfiguration;
+#define MAX_NUM_SST 4
+
+enum {
+ GR_SSTTYPE_VOODOO = 0,
+ GR_SSTTYPE_SST96 = 1,
+ GR_SSTTYPE_AT3D = 2,
+ GR_SSTTYPE_Voodoo2 = 3,
+ GR_SSTTYPE_Banshee = 4,
+ GR_SSTTYPE_Voodoo3 = 5,
+ GR_SSTTYPE_Voodoo4 = 6,
+ GR_SSTTYPE_Voodoo5 = 7
+};
+
+typedef struct GrTMUConfig_St {
+ int tmuRev; /* Rev of Texelfx chip */
+ int tmuRam; /* 1, 2, or 4 MB */
+} GrTMUConfig_t;
+
+typedef struct GrVoodooConfig_St {
+ int fbRam; /* 1, 2, or 4 MB */
+ int fbiRev; /* Rev of Pixelfx chip */
+ int nTexelfx; /* How many texelFX chips are there? */
+ GrTMUConfig_t tmuConfig[GLIDE_NUM_TMU]; /* Configuration of the Texelfx chips */
+ int maxTextureSize;
+ int numChips; /* Number of Voodoo chips [koolsmoky] */
+ /* Glide3 extensions */
+ GrProc grSstWinOpenExt;
+} GrVoodooConfig_t;
+
+typedef struct {
+ int num_sst; /* # of HW units in the system */
+ struct SstCard_St {
+ GrSstType type; /* Which hardware is it? */
+ GrVoodooConfig_t VoodooConfig;
+ }
+ SSTs[MAX_NUM_SST]; /* configuration for each board */
+} GrHwConfiguration;
+
+
typedef FxU32 GrHint_t;
-#define GR_HINTTYPE_MIN 0
-#define GR_HINT_STWHINT 0
+#define GR_HINTTYPE_MIN 0
+#define GR_HINT_STWHINT 0
typedef FxU32 GrSTWHint_t;
#define GR_STWHINT_W_DIFF_FBI FXBIT(0)
#define GR_STWHINT_W_DIFF_TMU2 FXBIT(5)
#define GR_STWHINT_ST_DIFF_TMU2 FXBIT(6)
-#define GR_CONTROL_ACTIVATE 1
-#define GR_CONTROL_DEACTIVATE 0
+#define GR_CONTROL_ACTIVATE 1
+#define GR_CONTROL_DEACTIVATE 0
+
+
+
+#define GrState void
+
-#define GrState void
/*
** move the vertex layout defintion to application
*/
-typedef struct
-{
- float sow; /* s texture ordinate (s over w) */
- float tow; /* t texture ordinate (t over w) */
- float oow; /* 1/w (used mipmapping - really 0xfff/w) */
-}
-GrTmuVertex;
-
-
-typedef struct
-{
- float x, y, z; /* X, Y, and Z of scrn space -- Z is ignored */
- float r, g, b; /* R, G, B, ([0..255.0]) */
- float ooz; /* 65535/Z (used for Z-buffering) */
- float a; /* Alpha [0..255.0] */
- float oow; /* 1/W (used for W-buffering, texturing) */
- GrTmuVertex tmuvtx[GLIDE_NUM_TMU];
-}
-GrVertex;
+typedef struct {
+ float sow; /* s texture ordinate (s over w) */
+ float tow; /* t texture ordinate (t over w) */
+ float oow; /* 1/w (used mipmapping - really 0xfff/w) */
+} GrTmuVertex;
+
+typedef struct {
+ float x, y, z; /* X, Y, and Z of scrn space -- Z is ignored */
+ float r, g, b; /* R, G, B, ([0..255.0]) */
+ float ooz; /* 65535/Z (used for Z-buffering) */
+ float a; /* Alpha [0..255.0] */
+ float oow; /* 1/W (used for W-buffering, texturing) */
+ GrTmuVertex tmuvtx[GLIDE_NUM_TMU];
+} GrVertex;
#define GR_VERTEX_X_OFFSET 0
#define GR_VERTEX_Y_OFFSET 1
#define GR_VERTEX_TOW_TMU1_OFFSET 13
#define GR_VERTEX_OOW_TMU1_OFFSET 14
-#endif
/*
- * Glide2 functions for Glide3
+ * Write region: ToDo possible exploit the PixelPipe parameter.
*/
-#if defined(FX_GLIDE3)
-#define FX_grTexDownloadTable(TMU,type,data) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grTexDownloadTable(type,data); \
- END_BOARD_LOCK(); \
- } while (0);
-#define FX_grTexDownloadTable_NoLock(TMU,type,data) \
- grTexDownloadTable(type, data)
-#else
-#define FX_grTexDownloadTable(TMU,type,data) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grTexDownloadTable(TMU,type,data); \
- END_BOARD_LOCK(); \
- } while (0);
-#define FX_grTexDownloadTable_NoLock grTexDownloadTable
-#endif
+#define FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \
+ do { \
+ BEGIN_BOARD_LOCK(); \
+ grLfbWriteRegion(dst_buffer,\
+ dst_x, \
+ dst_y, \
+ src_format,\
+ src_width, \
+ src_height,\
+ FXFALSE, \
+ src_stride,\
+ src_data); \
+ END_BOARD_LOCK(); \
+ } while(0)
-/*
- * Flush
- */
-#if defined(FX_GLIDE3)
-#define FX_grFlush() \
- do { \
- BEGIN_BOARD_LOCK(); \
- grFlush(); \
- END_BOARD_LOCK(); \
- } while (0)
-#else
-#define FX_grFlush() \
- do { \
- BEGIN_BOARD_LOCK(); \
- grSstIdle(); \
- END_BOARD_LOCK(); \
- } while (0)
-#endif
-#define FX_grFinish() \
- do { \
- BEGIN_BOARD_LOCK(); \
- grFinish(); \
- END_BOARD_LOCK(); \
- } while (0)
/*
- * Write region: ToDo possible exploit the PixelPipe parameter.
+ * Draw triangle
*/
-#if defined(FX_GLIDE3)
-#define FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,FXFALSE,src_stride,src_data); \
- END_BOARD_LOCK(); \
- } while(0)
-#else
-#define FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \
+#define FX_grDrawTriangle(a,b,c)\
do { \
- BEGIN_BOARD_LOCK(); \
- grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data); \
- END_BOARD_LOCK(); \
+ BEGIN_CLIP_LOOP(); \
+ grDrawTriangle(a,b,c); \
+ END_CLIP_LOOP(); \
} while (0)
-#endif
-/*
- * Read region
- */
-#define FX_grLfbReadRegion(src_buffer,src_x,src_y,src_width,src_height,dst_stride,dst_data) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grLfbReadRegion(src_buffer,src_x,src_y,src_width,src_height,dst_stride,dst_data); \
- END_BOARD_LOCK(); \
- } while (0);
-/*
- * Draw triangle
- */
-#define FX_grDrawTriangle(a,b,c) \
- do { \
- BEGIN_CLIP_LOOP(); \
- grDrawTriangle(a,b,c); \
- END_CLIP_LOOP(); \
- } while (0)
/*
* For Lod/LodLog2 conversion.
*/
-#if defined(FX_GLIDE3)
#define FX_largeLodLog2(info) (info).largeLodLog2
-#else
-#define FX_largeLodLog2(info) (info).largeLod
-#endif
-
-#if defined(FX_GLIDE3)
-#define FX_aspectRatioLog2(info) (info).aspectRatioLog2
-#else
-#define FX_aspectRatioLog2(info) (info).aspectRatio
-#endif
-
-#if defined(FX_GLIDE3)
+#define FX_aspectRatioLog2(info) (info).aspectRatioLog2
#define FX_smallLodLog2(info) (info).smallLodLog2
-#else
-#define FX_smallLodLog2(info) (info).smallLod
-#endif
-
-#if defined(FX_GLIDE3)
#define FX_lodToValue(val) ((int)(GR_LOD_256-val))
-#else
-#define FX_lodToValue(val) ((int)(val))
-#endif
-
-#if defined(FX_GLIDE3)
#define FX_largeLodValue(info) ((int)(GR_LOD_256-(info).largeLodLog2))
-#else
-#define FX_largeLodValue(info) ((int)(info).largeLod)
-#endif
-#define FX_largeLodValue_NoLock FX_largeLodValue
-
-#if defined(FX_GLIDE3)
#define FX_smallLodValue(info) ((int)(GR_LOD_256-(info).smallLodLog2))
-#else
-#define FX_smallLodValue(info) ((int)(info).smallLod)
-#endif
-#define FX_smallLodValue_NoLock FX_smallLodValue
-
-#if defined(FX_GLIDE3)
#define FX_valueToLod(val) ((GrLOD_t)(GR_LOD_256-val))
-#else
-#define FX_valueToLod(val) ((GrLOD_t)(val))
-#endif
+
+
/*
* ScreenWidth/Height stuff.
/*
- * Version string.
- */
-#if defined(FX_GLIDE3)
-extern void FX_grGlideGetVersion(char *buf);
-#else
-#define FX_grGlideGetVersion(b) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grGlideGetVersion(b); \
- END_BOARD_LOCK(); \
- } while (0)
-#endif
-/*
- * Performance statistics
+ * Query
*/
-#if defined(FX_GLIDE3)
-extern void FX_grSstPerfStats(GrSstPerfStats_t * st);
-#else
-#define FX_grSstPerfStats(s) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grSstPerfStats(s); \
- END_BOARD_LOCK(); \
- } while (0)
-#endif
+extern void FX_grSstPerfStats(GrSstPerfStats_t *st);
+extern int FX_grSstQueryHardware(GrHwConfiguration *config);
+
-/*
- * Hardware Query
- */
-extern int FX_grSstQueryHardware(GrHwConfiguration * config);
/*
* GrHints
*/
-#if defined(FX_GLIDE3)
+#define FX_grHints FX_grHints_NoLock
extern void FX_grHints_NoLock(GrHint_t hintType, FxU32 hintMask);
-extern void FX_grHints(GrHint_t hintType, FxU32 hintMask);
-#else
-#define FX_grHints(t,m) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grHints(t, m); \
- END_BOARD_LOCK(); \
- } while(0)
-#define FX_grHints_NoLock grHints
-#endif
+
+
+
/*
* Antialiashed line+point drawing.
*/
-#if defined(FX_GLIDE3)
-extern void FX_grAADrawLine(GrVertex * a, GrVertex * b);
-#else
-#define FX_grAADrawLine(a,b) \
- do { \
- BEGIN_CLIP_LOOP(); \
- grAADrawLine(a,b); \
- END_CLIP_LOOP(); \
- } while (0)
-#endif
-
-#if defined(FX_GLIDE3)
-extern void FX_grAADrawPoint(GrVertex * a);
-#else
-#define FX_grAADrawPoint(a) \
- do { \
- BEGIN_CLIP_LOOP(); \
- grAADrawPoint(a); \
- END_CLIP_LOOP(); \
- } while (0)
-#endif
+extern void FX_grAADrawLine(GrVertex *a, GrVertex *b);
+extern void FX_grAADrawPoint(GrVertex *a);
+
+
/*
* Needed for Glide3 only, to set up Glide2 compatible vertex layout.
*/
-#if defined(FX_GLIDE3)
extern void FX_setupGrVertexLayout(void);
-#else
-#define FX_setupGrVertexLayout() do {} while (0)
-#endif
+
+
+
/*
* grSstControl stuff
*/
extern FxBool FX_grSstControl(FxU32 code);
-/*
- * grGammaCorrectionValue
- */
-#if defined(FX_GLIDE3)
-extern void FX_grGammaCorrectionValue(float val);
-#else
-#define FX_grGammaCorrectionValue(v) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grGammaCorrectionValue(v) \
- END_BOARD_LOCK(); \
- } while (0)
-#endif
-
-#if defined(FX_GLIDE3)
-#define FX_grSstWinClose(w) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grSstWinClose(w); \
- END_BOARD_LOCK(); \
- } while (0)
-#else
-#define FX_grSstWinClose(w) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grSstWinClose(); \
- END_BOARD_LOCK(); \
- } while (0)
-#endif
-extern FX_GrContext_t FX_grSstWinOpen(struct SstCard_St *c,
- FxU32 hWnd,
- GrScreenResolution_t screen_resolution,
- GrScreenRefresh_t refresh_rate,
- GrColorFormat_t color_format,
- GrPixelFormat_t pixel_format,
- GrOriginLocation_t origin_location,
- int nColBuffers, int nAuxBuffers);
+extern GrContext_t FX_grSstWinOpen(struct SstCard_St *c,
+ FxU32 hWnd,
+ GrScreenResolution_t screen_resolution,
+ GrScreenRefresh_t refresh_rate,
+ GrColorFormat_t color_format,
+ GrPixelFormat_t pixel_format,
+ GrOriginLocation_t origin_location,
+ int nColBuffers, int nAuxBuffers);
#define FX_grDrawLine(v1, v2) \
END_CLIP_LOOP(); \
} while (0)
-#if defined(FX_GLIDE3)
-extern void FX_grDrawPolygonVertexList(int n, GrVertex * v);
-#else
-#define FX_grDrawPolygonVertexList(n, v) \
- do { \
- BEGIN_CLIP_LOOP(); \
- grDrawPolygonVertexList(n, v); \
- END_CLIP_LOOP(); \
- } while (0)
-#endif
-
-#define FX_grDitherMode(m) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grDitherMode(m); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grRenderBuffer(b) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grRenderBuffer(b); \
- END_BOARD_LOCK(); \
- } while (0)
+#define FX_grDrawPolygonVertexList(n, v) \
+ do { \
+ BEGIN_CLIP_LOOP(); \
+ grDrawVertexArrayContiguous(GR_POLYGON, n, v, sizeof(GrVertex)); \
+ END_CLIP_LOOP(); \
+ } while (0)
#define FX_grBufferClear(c, a, d) \
do { \
END_CLIP_LOOP(); \
} while (0)
-#define FX_grDepthMask(m) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grDepthMask(m); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grColorMask(c, a) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grColorMask(c, a); \
- END_BOARD_LOCK(); \
- } while (0)
-
-extern FxBool FX_grLfbLock(GrLock_t type, GrBuffer_t buffer,
- GrLfbWriteMode_t writeMode,
- GrOriginLocation_t origin, FxBool pixelPipeline,
- GrLfbInfo_t * info);
-
-#define FX_grLfbUnlock(t, b) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grLfbUnlock(t, b); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grConstantColorValue(v) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grConstantColorValue(v); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grConstantColorValue_NoLock grConstantColorValue
#define FX_grAADrawTriangle(a, b, c, ab, bc, ca) \
do { \
END_CLIP_LOOP(); \
} while (0)
-#define FX_grAlphaBlendFunction(rs, rd, as, ad) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grAlphaBlendFunction(rs, rd, as, ad); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grAlphaCombine(func, fact, loc, oth, inv) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grAlphaCombine(func, fact, loc, oth, inv); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grAlphaCombine_NoLock grAlphaCombine
-
-#define FX_grAlphaTestFunction(f) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grAlphaTestFunction(f); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grAlphaTestReferenceValue(v) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grAlphaTestReferenceValue(v); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grClipWindow(minx, miny, maxx, maxy) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grClipWindow(minx, miny, maxx, maxy); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grClipWindow_NoLock grClipWindow
-
-#define FX_grColorCombine(func, fact, loc, oth, inv) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grColorCombine(func, fact, loc, oth, inv); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grColorCombine_NoLock grColorCombine
-
-#define FX_grCullMode(m) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grCullMode(m); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grDepthBiasLevel(lev) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grDepthBiasLevel(lev); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grDepthBufferFunction(func) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grDepthBufferFunction(func); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grFogColorValue(c) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grFogColorValue(c); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grFogMode(m) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grFogMode(m); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grFogTable(t) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grFogTable(t); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grTexClampMode(t, sc, tc) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grTexClampMode(t, sc, tc); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grTexClampMode_NoLock grTexClampMode
-
-#define FX_grTexCombine(t, rfunc, rfact, afunc, afact, rinv, ainv) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grTexCombine(t, rfunc, rfact, afunc, afact, rinv, ainv); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grTexCombine_NoLock grTexCombine
-#define FX_grTexDownloadMipMapLevel(t, sa, tlod, llod, ar, f, eo, d) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grTexDownloadMipMapLevel(t, sa, tlod, llod, ar, f, eo, d); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grTexDownloadMipMapLevel_NoLock grTexDownloadMipMapLevel
-
-#define FX_grTexDownloadMipMapLevelPartial(t, sa, tlod, llod, ar, f, eo, d, s, e); \
- do { \
- BEGIN_BOARD_LOCK(); \
- grTexDownloadMipMapLevelPartial(t, sa, tlod, llod, ar, f, eo, d, s, e); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grTexFilterMode(t, minf, magf) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grTexFilterMode(t, minf, magf); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grTexFilterMode_NoLock grTexFilterMode
-
-extern FxU32 FX_grTexMinAddress(GrChipID_t tmu);
-extern FxU32 FX_grTexMaxAddress(GrChipID_t tmu);
-
-#define FX_grTexMipMapMode(t, m, lod) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grTexMipMapMode(t, m, lod); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grTexMipMapMode_NoLock grTexMipMapMode
-
-#define FX_grTexSource(t, sa, eo, i) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grTexSource(t, sa, eo, i); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grTexSource_NoLock grTexSource
-
-extern FxU32 FX_grTexTextureMemRequired(FxU32 evenOdd, GrTexInfo * info);
-#define FX_grTexTextureMemRequired_NoLock grTexTextureMemRequired
-
-#define FX_grGlideGetState(s) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grGlideGetState(s); \
- END_BOARD_LOCK(); \
- } while (0)
-#define FX_grGlideGetState_NoLock(s) grGlideGetState(s);
-
-#define FX_grDRIBufferSwap(i) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grDRIBufferSwap(i); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grSstSelect(b) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grSstSelect(b); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grSstSelect_NoLock grSstSelect
-
-#define FX_grGlideSetState(s) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grGlideSetState(s); \
- END_BOARD_LOCK(); \
- } while (0)
-#define FX_grGlideSetState_NoLock(s) grGlideSetState(s);
-
-#define FX_grDepthBufferMode(m) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grDepthBufferMode(m); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grLfbWriteColorFormat(f) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grLfbWriteColorFormat(f); \
- END_BOARD_LOCK(); \
- } while (0)
#define FX_grDrawVertexArray(m, c, p) \
do { \
END_CLIP_LOOP(); \
} while (0)
-#define FX_grGlideShutdown() \
- do { \
- BEGIN_BOARD_LOCK(); \
- grGlideShutdown(); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grTexLodBiasValue_NoLock(t, v) grTexLodBiasValue(t, v)
-
-#define FX_grTexLodBiasValue(t, v) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grTexLodBiasValue(t, v); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grGlideInit_NoLock grGlideInit
-#define FX_grSstWinOpen_NoLock grSstWinOpen
-extern int FX_getFogTableSize(void);
-extern int FX_getGrStateSize(void);
#endif /* __FX_GLIDE_WARPER__ */
-EXPORTS\r
- glAccum\r
- glAlphaFunc\r
- glAreTexturesResident\r
- glArrayElement\r
- glBegin\r
- glBindTexture\r
- glBitmap\r
- glBlendFunc\r
- glCallList\r
- glCallLists\r
- glClear\r
- glClearAccum\r
- glClearIndex\r
- glClearColor\r
- glClearDepth\r
- glClearStencil\r
- glClipPlane\r
- glColor3b\r
- glColor3d\r
- glColor3f\r
- glColor3i\r
- glColor3s\r
- glColor3ub\r
- glColor3ui\r
- glColor3us\r
- glColor4b\r
- glColor4d\r
- glColor4f\r
- glColor4i\r
- glColor4s\r
- glColor4ub\r
- glColor4ui\r
- glColor4us\r
- glColor3bv\r
- glColor3dv\r
- glColor3fv\r
- glColor3iv\r
- glColor3sv\r
- glColor3ubv\r
- glColor3uiv\r
- glColor3usv\r
- glColor4bv\r
- glColor4dv\r
- glColor4fv\r
- glColor4iv\r
- glColor4sv\r
- glColor4ubv\r
- glColor4uiv\r
- glColor4usv\r
- glColorMask\r
- glColorMaterial\r
- glColorPointer\r
- glColorTableEXT\r
- glColorSubTableEXT\r
- glCopyPixels\r
- glCopyTexImage1D\r
- glCopyTexImage2D\r
- glCopyTexSubImage1D\r
- glCopyTexSubImage2D\r
- glCullFace\r
- glDepthFunc\r
- glDepthMask\r
- glDepthRange\r
- glDeleteLists\r
- glDeleteTextures\r
- glDisable\r
- glDisableClientState\r
- glDrawArrays\r
- glDrawBuffer\r
- glDrawElements\r
- glDrawPixels\r
- glEnable\r
- glEnableClientState\r
- glEnd\r
- glEndList\r
- glEvalCoord1d\r
- glEvalCoord1f\r
- glEvalCoord1dv\r
- glEvalCoord1fv\r
- glEvalCoord2d\r
- glEvalCoord2f\r
- glEvalCoord2dv\r
- glEvalCoord2fv\r
- glEvalPoint1\r
- glEvalPoint2\r
- glEvalMesh1\r
- glEdgeFlag\r
- glEdgeFlagv\r
- glEdgeFlagPointer\r
- glEvalMesh2\r
- glFeedbackBuffer\r
- glFinish\r
- glFlush\r
- glFogf\r
- glFogi\r
- glFogfv\r
- glFogiv\r
- glFrontFace\r
- glFrustum\r
- glGenLists\r
- glGenTextures\r
- glGetBooleanv\r
- glGetClipPlane\r
- glGetColorTableEXT\r
- glGetColorTableParameterivEXT\r
- glGetColorTableParameterfvEXT\r
- glGetDoublev\r
- glGetError\r
- glGetFloatv\r
- glGetIntegerv\r
- glGetLightfv\r
- glGetLightiv\r
- glGetMapdv\r
- glGetMapfv\r
- glGetMapiv\r
- glGetMaterialfv\r
- glGetMaterialiv\r
- glGetPixelMapfv\r
- glGetPixelMapuiv\r
- glGetPixelMapusv\r
- glGetPointerv\r
- glGetPolygonStipple\r
- glGetString\r
- glGetTexEnvfv\r
- glGetTexEnviv\r
- glGetTexGeniv\r
- glGetTexGendv\r
- glGetTexGenfv\r
- glGetTexImage\r
- glGetTexLevelParameterfv\r
- glGetTexLevelParameteriv\r
- glGetTexParameterfv\r
- glGetTexParameteriv\r
- glHint\r
- glIndexd\r
- glIndexf\r
- glIndexi\r
- glIndexs\r
- glIndexub\r
- glIndexdv\r
- glIndexfv\r
- glIndexiv\r
- glIndexsv\r
- glIndexubv\r
- glIndexMask\r
- glIndexPointer\r
- glInterleavedArrays\r
- glInitNames\r
- glIsList\r
- glIsTexture\r
- glLightf\r
- glLighti\r
- glLightfv\r
- glLightiv\r
- glLightModelf\r
- glLightModeli\r
- glLightModelfv\r
- glLightModeliv\r
- glLineWidth\r
- glLineStipple\r
- glListBase\r
- glLoadIdentity\r
- glLoadMatrixd\r
- glLoadMatrixf\r
- glLoadName\r
- glLogicOp\r
- glMap1d\r
- glMap1f\r
- glMap2d\r
- glMap2f\r
- glMapGrid1d\r
- glMapGrid1f\r
- glMapGrid2d\r
- glMapGrid2f\r
- glMaterialf\r
- glMateriali\r
- glMaterialfv\r
- glMaterialiv\r
- glMatrixMode\r
- glMultMatrixd\r
- glMultMatrixf\r
- glNewList\r
- glNormal3b\r
- glNormal3d\r
- glNormal3f\r
- glNormal3i\r
- glNormal3s\r
- glNormal3bv\r
- glNormal3dv\r
- glNormal3fv\r
- glNormal3iv\r
- glNormal3sv\r
- glNormalPointer\r
- glOrtho\r
- glPassThrough\r
- glPixelMapfv\r
- glPixelMapuiv\r
- glPixelMapusv\r
- glPixelStoref\r
- glPixelStorei\r
- glPixelTransferf\r
- glPixelTransferi\r
- glPixelZoom\r
- glPointSize\r
- glPolygonMode\r
- glPolygonOffset\r
- glPolygonOffsetEXT\r
- glPolygonStipple\r
- glPopAttrib\r
- glPopClientAttrib\r
- glPopMatrix\r
- glPopName\r
- glPrioritizeTextures\r
- glPushMatrix\r
- glRasterPos2d\r
- glRasterPos2f\r
- glRasterPos2i\r
- glRasterPos2s\r
- glRasterPos3d\r
- glRasterPos3f\r
- glRasterPos3i\r
- glRasterPos3s\r
- glRasterPos4d\r
- glRasterPos4f\r
- glRasterPos4i\r
- glRasterPos4s\r
- glRasterPos2dv\r
- glRasterPos2fv\r
- glRasterPos2iv\r
- glRasterPos2sv\r
- glRasterPos3dv\r
- glRasterPos3fv\r
- glRasterPos3iv\r
- glRasterPos3sv\r
- glRasterPos4dv\r
- glRasterPos4fv\r
- glRasterPos4iv\r
- glRasterPos4sv\r
- glReadBuffer\r
- glReadPixels\r
- glRectd\r
- glRectf\r
- glRecti\r
- glRects\r
- glRectdv\r
- glRectfv\r
- glRectiv\r
- glRectsv\r
- glScissor\r
- glIsEnabled\r
- glPushAttrib\r
- glPushClientAttrib\r
- glPushName\r
- glRenderMode\r
- glRotated\r
- glRotatef\r
- glSelectBuffer\r
- glScaled\r
- glScalef\r
- glShadeModel\r
- glStencilFunc\r
- glStencilMask\r
- glStencilOp\r
- glTexCoord1d\r
- glTexCoord1f\r
- glTexCoord1i\r
- glTexCoord1s\r
- glTexCoord2d\r
- glTexCoord2f\r
- glTexCoord2i\r
- glTexCoord2s\r
- glTexCoord3d\r
- glTexCoord3f\r
- glTexCoord3i\r
- glTexCoord3s\r
- glTexCoord4d\r
- glTexCoord4f\r
- glTexCoord4i\r
- glTexCoord4s\r
- glTexCoord1dv\r
- glTexCoord1fv\r
- glTexCoord1iv\r
- glTexCoord1sv\r
- glTexCoord2dv\r
- glTexCoord2fv\r
- glTexCoord2iv\r
- glTexCoord2sv\r
- glTexCoord3dv\r
- glTexCoord3fv\r
- glTexCoord3iv\r
- glTexCoord3sv\r
- glTexCoord4dv\r
- glTexCoord4fv\r
- glTexCoord4iv\r
- glTexCoord4sv\r
- glTexCoordPointer\r
- glTexGend\r
- glTexGenf\r
- glTexGeni\r
- glTexGendv\r
- glTexGeniv\r
- glTexGenfv\r
- glTexEnvf\r
- glTexEnvi\r
- glTexEnvfv\r
- glTexEnviv\r
- glTexImage1D\r
- glTexImage2D\r
- glTexParameterf\r
- glTexParameteri\r
- glTexParameterfv\r
- glTexParameteriv\r
- glTexSubImage1D\r
- glTexSubImage2D\r
- glTranslated\r
- glTranslatef\r
- glVertex2d\r
- glVertex2f\r
- glVertex2i\r
- glVertex2s\r
- glVertex3d\r
- glVertex3f\r
- glVertex3i\r
- glVertex3s\r
- glVertex4d\r
- glVertex4f\r
- glVertex4i\r
- glVertex4s\r
- glVertex2dv\r
- glVertex2fv\r
- glVertex2iv\r
- glVertex2sv\r
- glVertex3dv\r
- glVertex3fv\r
- glVertex3iv\r
- glVertex3sv\r
- glVertex4dv\r
- glVertex4fv\r
- glVertex4iv\r
- glVertex4sv\r
- glVertexPointer\r
- glViewport\r
- glBlendEquationEXT\r
- glBlendColorEXT\r
- glVertexPointerEXT\r
- glNormalPointerEXT\r
- glColorPointerEXT\r
- glIndexPointerEXT\r
- glTexCoordPointerEXT\r
- glEdgeFlagPointerEXT\r
- glGetPointervEXT\r
- glArrayElementEXT\r
- glDrawArraysEXT\r
- glBindTextureEXT\r
- glDeleteTexturesEXT\r
- glGenTexturesEXT\r
- glPrioritizeTexturesEXT\r
- glCopyTexSubImage3DEXT\r
- glTexImage3DEXT\r
- glTexSubImage3DEXT\r
- glWindowPos4fMESA\r
- glWindowPos2iMESA\r
- glWindowPos2sMESA\r
- glWindowPos2fMESA\r
- glWindowPos2dMESA\r
- glWindowPos2ivMESA\r
- glWindowPos2svMESA\r
- glWindowPos2fvMESA\r
- glWindowPos2dvMESA\r
- glWindowPos3iMESA\r
- glWindowPos3sMESA\r
- glWindowPos3fMESA\r
- glWindowPos3dMESA\r
- glWindowPos3ivMESA\r
- glWindowPos3svMESA\r
- glWindowPos3fvMESA\r
- glWindowPos3dvMESA\r
- glWindowPos4iMESA\r
- glWindowPos4sMESA\r
- glWindowPos4dMESA\r
- glWindowPos4ivMESA\r
- glWindowPos4svMESA\r
- glWindowPos4fvMESA\r
- glWindowPos4dvMESA\r
- glResizeBuffersMESA\r
- wglCopyContext\r
- wglCreateContext\r
- wglCreateLayerContext\r
- wglDeleteContext\r
-;wglDescribeLayerPlane\r
- wglGetCurrentContext\r
- wglGetCurrentDC\r
-;wglGetLayerPaletteEntries\r
- wglGetProcAddress\r
- wglMakeCurrent\r
-;wglRealizeLayerPalette\r
-;wglSetLayerPaletteEntries\r
- wglShareLists\r
- wglSwapLayerBuffers\r
- wglUseFontBitmapsA\r
- wglUseFontBitmapsW\r
- wglUseFontOutlinesA\r
- wglUseFontOutlinesW\r
- wglChoosePixelFormat\r
- ChoosePixelFormat\r
- wglDescribePixelFormat\r
- DescribePixelFormat\r
- wglGetPixelFormat\r
- GetPixelFormat\r
- wglSetPixelFormat\r
- SetPixelFormat\r
- wglSwapBuffers\r
- SwapBuffers\r
- gl3DfxSetPaletteEXT\r
- glActiveTextureARB\r
- glClientActiveTextureARB\r
- glMultiTexCoord1dARB\r
- glMultiTexCoord1dvARB\r
- glMultiTexCoord1fARB\r
- glMultiTexCoord1fvARB\r
- glMultiTexCoord1iARB\r
- glMultiTexCoord1ivARB\r
- glMultiTexCoord1sARB\r
- glMultiTexCoord1svARB\r
- glMultiTexCoord2dARB\r
- glMultiTexCoord2dvARB\r
- glMultiTexCoord2fARB\r
- glMultiTexCoord2fvARB\r
- glMultiTexCoord2iARB\r
- glMultiTexCoord2ivARB\r
- glMultiTexCoord2sARB\r
- glMultiTexCoord2svARB\r
- glMultiTexCoord3dARB\r
- glMultiTexCoord3dvARB\r
- glMultiTexCoord3fARB\r
- glMultiTexCoord3fvARB\r
- glMultiTexCoord3iARB\r
- glMultiTexCoord3ivARB\r
- glMultiTexCoord3sARB\r
- glMultiTexCoord3svARB\r
- glMultiTexCoord4dARB\r
- glMultiTexCoord4dvARB\r
- glMultiTexCoord4fARB\r
- glMultiTexCoord4fvARB\r
- glMultiTexCoord4iARB\r
- glMultiTexCoord4ivARB\r
- glMultiTexCoord4sARB\r
- glMultiTexCoord4svARB\r
- fxMesaCreateContext\r
- fxMesaCreateBestContext\r
- fxMesaDestroyContext\r
- fxMesaSelectCurrentBoard\r
- fxMesaMakeCurrent\r
- fxMesaGetCurrentContext\r
- fxMesaSwapBuffers\r
- fxMesaSetNearFar\r
- fxMesaUpdateScreenSize\r
- fxQueryHardware\r
- fxCloseHardware\r
- OSMesaCreateContext\r
- OSMesaDestroyContext\r
- OSMesaGetCurrentContext\r
- OSMesaGetDepthBuffer\r
- OSMesaGetIntegerv\r
- OSMesaMakeCurrent\r
- OSMesaPixelStore\r
+EXPORTS
+ glAccum
+ glAlphaFunc
+ glAreTexturesResident
+ glArrayElement
+ glBegin
+ glBindTexture
+ glBitmap
+ glBlendFunc
+ glCallList
+ glCallLists
+ glClear
+ glClearAccum
+ glClearIndex
+ glClearColor
+ glClearDepth
+ glClearStencil
+ glClipPlane
+ glColor3b
+ glColor3d
+ glColor3f
+ glColor3i
+ glColor3s
+ glColor3ub
+ glColor3ui
+ glColor3us
+ glColor4b
+ glColor4d
+ glColor4f
+ glColor4i
+ glColor4s
+ glColor4ub
+ glColor4ui
+ glColor4us
+ glColor3bv
+ glColor3dv
+ glColor3fv
+ glColor3iv
+ glColor3sv
+ glColor3ubv
+ glColor3uiv
+ glColor3usv
+ glColor4bv
+ glColor4dv
+ glColor4fv
+ glColor4iv
+ glColor4sv
+ glColor4ubv
+ glColor4uiv
+ glColor4usv
+ glColorMask
+ glColorMaterial
+ glColorPointer
+ glColorTableEXT
+ glColorSubTableEXT
+ glCopyPixels
+ glCopyTexImage1D
+ glCopyTexImage2D
+ glCopyTexSubImage1D
+ glCopyTexSubImage2D
+ glCullFace
+ glDepthFunc
+ glDepthMask
+ glDepthRange
+ glDeleteLists
+ glDeleteTextures
+ glDisable
+ glDisableClientState
+ glDrawArrays
+ glDrawBuffer
+ glDrawElements
+ glDrawPixels
+ glEnable
+ glEnableClientState
+ glEnd
+ glEndList
+ glEvalCoord1d
+ glEvalCoord1f
+ glEvalCoord1dv
+ glEvalCoord1fv
+ glEvalCoord2d
+ glEvalCoord2f
+ glEvalCoord2dv
+ glEvalCoord2fv
+ glEvalPoint1
+ glEvalPoint2
+ glEvalMesh1
+ glEdgeFlag
+ glEdgeFlagv
+ glEdgeFlagPointer
+ glEvalMesh2
+ glFeedbackBuffer
+ glFinish
+ glFlush
+ glFogf
+ glFogi
+ glFogfv
+ glFogiv
+ glFrontFace
+ glFrustum
+ glGenLists
+ glGenTextures
+ glGetBooleanv
+ glGetClipPlane
+ glGetColorTableEXT
+ glGetColorTableParameterivEXT
+ glGetColorTableParameterfvEXT
+ glGetDoublev
+ glGetError
+ glGetFloatv
+ glGetIntegerv
+ glGetLightfv
+ glGetLightiv
+ glGetMapdv
+ glGetMapfv
+ glGetMapiv
+ glGetMaterialfv
+ glGetMaterialiv
+ glGetPixelMapfv
+ glGetPixelMapuiv
+ glGetPixelMapusv
+ glGetPointerv
+ glGetPolygonStipple
+ glGetString
+ glGetTexEnvfv
+ glGetTexEnviv
+ glGetTexGeniv
+ glGetTexGendv
+ glGetTexGenfv
+ glGetTexImage
+ glGetTexLevelParameterfv
+ glGetTexLevelParameteriv
+ glGetTexParameterfv
+ glGetTexParameteriv
+ glHint
+ glIndexd
+ glIndexf
+ glIndexi
+ glIndexs
+ glIndexub
+ glIndexdv
+ glIndexfv
+ glIndexiv
+ glIndexsv
+ glIndexubv
+ glIndexMask
+ glIndexPointer
+ glInterleavedArrays
+ glInitNames
+ glIsList
+ glIsTexture
+ glLightf
+ glLighti
+ glLightfv
+ glLightiv
+ glLightModelf
+ glLightModeli
+ glLightModelfv
+ glLightModeliv
+ glLineWidth
+ glLineStipple
+ glListBase
+ glLoadIdentity
+ glLoadMatrixd
+ glLoadMatrixf
+ glLoadName
+ glLogicOp
+ glMap1d
+ glMap1f
+ glMap2d
+ glMap2f
+ glMapGrid1d
+ glMapGrid1f
+ glMapGrid2d
+ glMapGrid2f
+ glMaterialf
+ glMateriali
+ glMaterialfv
+ glMaterialiv
+ glMatrixMode
+ glMultMatrixd
+ glMultMatrixf
+ glNewList
+ glNormal3b
+ glNormal3d
+ glNormal3f
+ glNormal3i
+ glNormal3s
+ glNormal3bv
+ glNormal3dv
+ glNormal3fv
+ glNormal3iv
+ glNormal3sv
+ glNormalPointer
+ glOrtho
+ glPassThrough
+ glPixelMapfv
+ glPixelMapuiv
+ glPixelMapusv
+ glPixelStoref
+ glPixelStorei
+ glPixelTransferf
+ glPixelTransferi
+ glPixelZoom
+ glPointSize
+ glPolygonMode
+ glPolygonOffset
+ glPolygonOffsetEXT
+ glPolygonStipple
+ glPopAttrib
+ glPopClientAttrib
+ glPopMatrix
+ glPopName
+ glPrioritizeTextures
+ glPushMatrix
+ glRasterPos2d
+ glRasterPos2f
+ glRasterPos2i
+ glRasterPos2s
+ glRasterPos3d
+ glRasterPos3f
+ glRasterPos3i
+ glRasterPos3s
+ glRasterPos4d
+ glRasterPos4f
+ glRasterPos4i
+ glRasterPos4s
+ glRasterPos2dv
+ glRasterPos2fv
+ glRasterPos2iv
+ glRasterPos2sv
+ glRasterPos3dv
+ glRasterPos3fv
+ glRasterPos3iv
+ glRasterPos3sv
+ glRasterPos4dv
+ glRasterPos4fv
+ glRasterPos4iv
+ glRasterPos4sv
+ glReadBuffer
+ glReadPixels
+ glRectd
+ glRectf
+ glRecti
+ glRects
+ glRectdv
+ glRectfv
+ glRectiv
+ glRectsv
+ glScissor
+ glIsEnabled
+ glPushAttrib
+ glPushClientAttrib
+ glPushName
+ glRenderMode
+ glRotated
+ glRotatef
+ glSelectBuffer
+ glScaled
+ glScalef
+ glShadeModel
+ glStencilFunc
+ glStencilMask
+ glStencilOp
+ glTexCoord1d
+ glTexCoord1f
+ glTexCoord1i
+ glTexCoord1s
+ glTexCoord2d
+ glTexCoord2f
+ glTexCoord2i
+ glTexCoord2s
+ glTexCoord3d
+ glTexCoord3f
+ glTexCoord3i
+ glTexCoord3s
+ glTexCoord4d
+ glTexCoord4f
+ glTexCoord4i
+ glTexCoord4s
+ glTexCoord1dv
+ glTexCoord1fv
+ glTexCoord1iv
+ glTexCoord1sv
+ glTexCoord2dv
+ glTexCoord2fv
+ glTexCoord2iv
+ glTexCoord2sv
+ glTexCoord3dv
+ glTexCoord3fv
+ glTexCoord3iv
+ glTexCoord3sv
+ glTexCoord4dv
+ glTexCoord4fv
+ glTexCoord4iv
+ glTexCoord4sv
+ glTexCoordPointer
+ glTexGend
+ glTexGenf
+ glTexGeni
+ glTexGendv
+ glTexGeniv
+ glTexGenfv
+ glTexEnvf
+ glTexEnvi
+ glTexEnvfv
+ glTexEnviv
+ glTexImage1D
+ glTexImage2D
+ glTexParameterf
+ glTexParameteri
+ glTexParameterfv
+ glTexParameteriv
+ glTexSubImage1D
+ glTexSubImage2D
+ glTranslated
+ glTranslatef
+ glVertex2d
+ glVertex2f
+ glVertex2i
+ glVertex2s
+ glVertex3d
+ glVertex3f
+ glVertex3i
+ glVertex3s
+ glVertex4d
+ glVertex4f
+ glVertex4i
+ glVertex4s
+ glVertex2dv
+ glVertex2fv
+ glVertex2iv
+ glVertex2sv
+ glVertex3dv
+ glVertex3fv
+ glVertex3iv
+ glVertex3sv
+ glVertex4dv
+ glVertex4fv
+ glVertex4iv
+ glVertex4sv
+ glVertexPointer
+ glViewport
+ glBlendEquationEXT
+ glBlendColorEXT
+ glVertexPointerEXT
+ glNormalPointerEXT
+ glColorPointerEXT
+ glIndexPointerEXT
+ glTexCoordPointerEXT
+ glEdgeFlagPointerEXT
+ glGetPointervEXT
+ glArrayElementEXT
+ glDrawArraysEXT
+ glBindTextureEXT
+ glDeleteTexturesEXT
+ glGenTexturesEXT
+ glPrioritizeTexturesEXT
+ glCopyTexSubImage3DEXT
+ glTexImage3DEXT
+ glTexSubImage3DEXT
+ glWindowPos4fMESA
+ glWindowPos2iMESA
+ glWindowPos2sMESA
+ glWindowPos2fMESA
+ glWindowPos2dMESA
+ glWindowPos2ivMESA
+ glWindowPos2svMESA
+ glWindowPos2fvMESA
+ glWindowPos2dvMESA
+ glWindowPos3iMESA
+ glWindowPos3sMESA
+ glWindowPos3fMESA
+ glWindowPos3dMESA
+ glWindowPos3ivMESA
+ glWindowPos3svMESA
+ glWindowPos3fvMESA
+ glWindowPos3dvMESA
+ glWindowPos4iMESA
+ glWindowPos4sMESA
+ glWindowPos4dMESA
+ glWindowPos4ivMESA
+ glWindowPos4svMESA
+ glWindowPos4fvMESA
+ glWindowPos4dvMESA
+ glResizeBuffersMESA
+ wglCopyContext
+ wglCreateContext
+ wglCreateLayerContext
+ wglDeleteContext
+;wglDescribeLayerPlane
+ wglGetCurrentContext
+ wglGetCurrentDC
+;wglGetLayerPaletteEntries
+ wglGetProcAddress
+ wglMakeCurrent
+;wglRealizeLayerPalette
+;wglSetLayerPaletteEntries
+ wglShareLists
+ wglSwapLayerBuffers
+ wglUseFontBitmapsA
+ wglUseFontBitmapsW
+ wglUseFontOutlinesA
+ wglUseFontOutlinesW
+ wglChoosePixelFormat
+ ChoosePixelFormat
+ wglDescribePixelFormat
+ DescribePixelFormat
+ wglGetPixelFormat
+ GetPixelFormat
+ wglSetPixelFormat
+ SetPixelFormat
+ wglSwapBuffers
+ SwapBuffers
+ gl3DfxSetPaletteEXT
+ glActiveTextureARB
+ glClientActiveTextureARB
+ glMultiTexCoord1dARB
+ glMultiTexCoord1dvARB
+ glMultiTexCoord1fARB
+ glMultiTexCoord1fvARB
+ glMultiTexCoord1iARB
+ glMultiTexCoord1ivARB
+ glMultiTexCoord1sARB
+ glMultiTexCoord1svARB
+ glMultiTexCoord2dARB
+ glMultiTexCoord2dvARB
+ glMultiTexCoord2fARB
+ glMultiTexCoord2fvARB
+ glMultiTexCoord2iARB
+ glMultiTexCoord2ivARB
+ glMultiTexCoord2sARB
+ glMultiTexCoord2svARB
+ glMultiTexCoord3dARB
+ glMultiTexCoord3dvARB
+ glMultiTexCoord3fARB
+ glMultiTexCoord3fvARB
+ glMultiTexCoord3iARB
+ glMultiTexCoord3ivARB
+ glMultiTexCoord3sARB
+ glMultiTexCoord3svARB
+ glMultiTexCoord4dARB
+ glMultiTexCoord4dvARB
+ glMultiTexCoord4fARB
+ glMultiTexCoord4fvARB
+ glMultiTexCoord4iARB
+ glMultiTexCoord4ivARB
+ glMultiTexCoord4sARB
+ glMultiTexCoord4svARB
+ fxMesaCreateContext
+ fxMesaCreateBestContext
+ fxMesaDestroyContext
+ fxMesaSelectCurrentBoard
+ fxMesaMakeCurrent
+ fxMesaGetCurrentContext
+ fxMesaSwapBuffers
+; fxMesaSetNearFar
+ fxMesaUpdateScreenSize
+ fxQueryHardware
+ fxCloseHardware
+; OSMesaCreateContext
+; OSMesaDestroyContext
+; OSMesaGetCurrentContext
+; OSMesaGetDepthBuffer
+; OSMesaGetIntegerv
+; OSMesaMakeCurrent
+; OSMesaPixelStore
-/* $Id: fxsetup.c,v 1.38 2002/11/04 20:29:04 brianp Exp $ */
+/* $Id: fxsetup.c,v 1.39 2003/08/19 15:52:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Brian Paul
* Daryll Strauss
* Keith Whitwell
+ * Daniel Borca
+ * Hiroshi Morii
*/
/* fxsetup.c - 3Dfx VooDoo rendering mode setup functions */
else
FX_smallLodLog2(ti->info) = FX_largeLodLog2(ti->info);
- fxTexGetFormat(tObj->Image[minl]->TexFormat->BaseFormat, &(ti->info.format),
- &(ti->baseLevelInternalFormat));
+ fxTexGetFormat(ctx, tObj->Image[minl]->TexFormat->BaseFormat, &(ti->info.format),
+ &(ti->baseLevelInternalFormat)); /* [koolsmoky] */
switch (tObj->WrapS) {
case GL_CLAMP_TO_EDGE:
else {
if (fxMesa->haveTwoTMUs) {
if (fxMesa->freeTexMem[FX_TMU0] >
- FX_grTexTextureMemRequired_NoLock(GR_MIPMAPLEVELMASK_BOTH,
+ grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH,
&(ti->info))) {
fxTMMoveInTM_NoLock(fxMesa, tObj, FX_TMU0);
}
if (MESA_VERBOSE & VERBOSE_DRIVER) {
fprintf(stderr, "fxmesa: uploading texture palette\n");
}
- FX_grTexDownloadTable_NoLock(GR_TMU0, GR_TEXTABLE_PALETTE,
- &(ti->palette));
- FX_grTexDownloadTable_NoLock(GR_TMU1, GR_TEXTABLE_PALETTE,
- &(ti->palette));
+ grTexDownloadTable(GR_TEXTABLE_PALETTE, &(ti->palette));
}
- FX_grTexClampMode_NoLock(GR_TMU0, ti->sClamp, ti->tClamp);
- FX_grTexClampMode_NoLock(GR_TMU1, ti->sClamp, ti->tClamp);
- FX_grTexFilterMode_NoLock(GR_TMU0, ti->minFilt, ti->maxFilt);
- FX_grTexFilterMode_NoLock(GR_TMU1, ti->minFilt, ti->maxFilt);
- FX_grTexMipMapMode_NoLock(GR_TMU0, ti->mmMode, ti->LODblend);
- FX_grTexMipMapMode_NoLock(GR_TMU1, ti->mmMode, ti->LODblend);
+ grTexClampMode(GR_TMU0, ti->sClamp, ti->tClamp);
+ grTexClampMode(GR_TMU1, ti->sClamp, ti->tClamp);
+ grTexFilterMode(GR_TMU0, ti->minFilt, ti->maxFilt);
+ grTexFilterMode(GR_TMU1, ti->minFilt, ti->maxFilt);
+ grTexMipMapMode(GR_TMU0, ti->mmMode, ti->LODblend);
+ grTexMipMapMode(GR_TMU1, ti->mmMode, ti->LODblend);
- FX_grTexSource_NoLock(GR_TMU0, ti->tm[FX_TMU0]->startAddr,
+ grTexSource(GR_TMU0, ti->tm[FX_TMU0]->startAddr,
GR_MIPMAPLEVELMASK_ODD, &(ti->info));
- FX_grTexSource_NoLock(GR_TMU1, ti->tm[FX_TMU1]->startAddr,
+ grTexSource(GR_TMU1, ti->tm[FX_TMU1]->startAddr,
GR_MIPMAPLEVELMASK_EVEN, &(ti->info));
}
else {
if (MESA_VERBOSE & VERBOSE_DRIVER) {
fprintf(stderr, "fxmesa: uploading texture palette\n");
}
- FX_grTexDownloadTable_NoLock(tmu, GR_TEXTABLE_PALETTE,
- &(ti->palette));
+ grTexDownloadTable(GR_TEXTABLE_PALETTE, &(ti->palette));
}
/* KW: The alternative is to do the download to the other tmu. If
if (ti->LODblend && (MESA_VERBOSE & VERBOSE_DRIVER))
fprintf(stderr, "fxmesa: not blending texture - only on one tmu\n");
- FX_grTexClampMode_NoLock(tmu, ti->sClamp, ti->tClamp);
- FX_grTexFilterMode_NoLock(tmu, ti->minFilt, ti->maxFilt);
- FX_grTexMipMapMode_NoLock(tmu, ti->mmMode, FXFALSE);
+ grTexClampMode(tmu, ti->sClamp, ti->tClamp);
+ grTexFilterMode(tmu, ti->minFilt, ti->maxFilt);
+ grTexMipMapMode(tmu, ti->mmMode, FXFALSE);
- FX_grTexSource_NoLock(tmu, ti->tm[tmu]->startAddr,
- GR_MIPMAPLEVELMASK_BOTH, &(ti->info));
+ grTexSource(tmu, ti->tm[tmu]->startAddr, GR_MIPMAPLEVELMASK_BOTH, &(ti->info));
}
}
}
if (LODblend) {
- FX_grTexCombine_NoLock(GR_TMU0,
+ grTexCombine(GR_TMU0,
GR_COMBINE_FUNCTION_BLEND,
GR_COMBINE_FACTOR_ONE_MINUS_LOD_FRACTION,
GR_COMBINE_FUNCTION_BLEND,
FXFALSE, FXFALSE);
if (fxMesa->haveTwoTMUs)
- FX_grTexCombine_NoLock(GR_TMU1,
+ grTexCombine(GR_TMU1,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GR_COMBINE_FUNCTION_LOCAL,
}
else {
if (tmu != FX_TMU1) {
- FX_grTexCombine_NoLock(GR_TMU0,
+ grTexCombine(GR_TMU0,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE, FXFALSE, FXFALSE);
if (fxMesa->haveTwoTMUs) {
- FX_grTexCombine_NoLock(GR_TMU1,
+ grTexCombine(GR_TMU1,
GR_COMBINE_FUNCTION_ZERO,
GR_COMBINE_FACTOR_NONE,
GR_COMBINE_FUNCTION_ZERO,
fxMesa->tmuSrc = FX_TMU0;
}
else {
- FX_grTexCombine_NoLock(GR_TMU1,
+ grTexCombine(GR_TMU1,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GR_COMBINE_FUNCTION_LOCAL,
/* GR_COMBINE_FUNCTION_SCALE_OTHER doesn't work ?!? */
- FX_grTexCombine_NoLock(GR_TMU0,
+ grTexCombine(GR_TMU0,
GR_COMBINE_FUNCTION_BLEND,
GR_COMBINE_FACTOR_ONE,
GR_COMBINE_FUNCTION_BLEND,
switch (ctx->Texture.Unit[textureset].EnvMode) {
case GL_DECAL:
- FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_LOCAL,
+ grAlphaCombine(GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
locala, GR_COMBINE_OTHER_NONE, FXFALSE);
- FX_grColorCombine_NoLock(GR_COMBINE_FUNCTION_BLEND,
+ grColorCombine(GR_COMBINE_FUNCTION_BLEND,
GR_COMBINE_FACTOR_TEXTURE_ALPHA,
localc, GR_COMBINE_OTHER_TEXTURE, FXFALSE);
break;
case GL_MODULATE:
- FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER,
+ grAlphaCombine(GR_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_LOCAL,
locala, GR_COMBINE_OTHER_TEXTURE, FXFALSE);
if (ifmt == GL_ALPHA)
- FX_grColorCombine_NoLock(GR_COMBINE_FUNCTION_LOCAL,
+ grColorCombine(GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
localc, GR_COMBINE_OTHER_NONE, FXFALSE);
else
- FX_grColorCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER,
+ grColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_LOCAL,
localc, GR_COMBINE_OTHER_TEXTURE, FXFALSE);
break;
break;
case GL_REPLACE:
if ((ifmt == GL_RGB) || (ifmt == GL_LUMINANCE))
- FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_LOCAL,
+ grAlphaCombine(GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
locala, GR_COMBINE_OTHER_NONE, FXFALSE);
else
- FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER,
+ grAlphaCombine(GR_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
locala, GR_COMBINE_OTHER_TEXTURE, FXFALSE);
if (ifmt == GL_ALPHA)
- FX_grColorCombine_NoLock(GR_COMBINE_FUNCTION_LOCAL,
+ grColorCombine(GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
localc, GR_COMBINE_OTHER_NONE, FXFALSE);
else
- FX_grColorCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER,
+ grColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
localc, GR_COMBINE_OTHER_TEXTURE, FXFALSE);
break;
}
if (!fxMesa->haveGlobalPaletteTexture) {
+ /* [dBorca]
+ * all TMUs share the same table.
+ * The next test shouldn't be TMU specific...
+ */
if (ti0->info.format == GR_TEXFMT_P_8) {
if (MESA_VERBOSE & VERBOSE_DRIVER) {
fprintf(stderr, "fxmesa: uploading texture palette TMU0\n");
}
- FX_grTexDownloadTable_NoLock(tmu0, GR_TEXTABLE_PALETTE,
- &(ti0->palette));
- }
-
- if (ti1->info.format == GR_TEXFMT_P_8) {
- if (MESA_VERBOSE & VERBOSE_DRIVER) {
- fprintf(stderr, "fxmesa: uploading texture palette TMU1\n");
- }
- FX_grTexDownloadTable_NoLock(tmu1, GR_TEXTABLE_PALETTE,
- &(ti1->palette));
+ grTexDownloadTable(GR_TEXTABLE_PALETTE, &(ti0->palette));
}
}
- FX_grTexSource_NoLock(tmu0, ti0->tm[tmu0]->startAddr,
+ grTexSource(tmu0, ti0->tm[tmu0]->startAddr,
GR_MIPMAPLEVELMASK_BOTH, &(ti0->info));
- FX_grTexClampMode_NoLock(tmu0, ti0->sClamp, ti0->tClamp);
- FX_grTexFilterMode_NoLock(tmu0, ti0->minFilt, ti0->maxFilt);
- FX_grTexMipMapMode_NoLock(tmu0, ti0->mmMode, FXFALSE);
+ grTexClampMode(tmu0, ti0->sClamp, ti0->tClamp);
+ grTexFilterMode(tmu0, ti0->minFilt, ti0->maxFilt);
+ grTexMipMapMode(tmu0, ti0->mmMode, FXFALSE);
- FX_grTexSource_NoLock(tmu1, ti1->tm[tmu1]->startAddr,
+ grTexSource(tmu1, ti1->tm[tmu1]->startAddr,
GR_MIPMAPLEVELMASK_BOTH, &(ti1->info));
- FX_grTexClampMode_NoLock(tmu1, ti1->sClamp, ti1->tClamp);
- FX_grTexFilterMode_NoLock(tmu1, ti1->minFilt, ti1->maxFilt);
- FX_grTexMipMapMode_NoLock(tmu1, ti1->mmMode, FXFALSE);
+ grTexClampMode(tmu1, ti1->sClamp, ti1->tClamp);
+ grTexFilterMode(tmu1, ti1->minFilt, ti1->maxFilt);
+ grTexMipMapMode(tmu1, ti1->mmMode, FXFALSE);
#undef T0_NOT_IN_TMU
#undef T1_NOT_IN_TMU
isalpha[tmu1] = GL_FALSE;
if (isalpha[FX_TMU1])
- FX_grTexCombine_NoLock(GR_TMU1,
+ grTexCombine(GR_TMU1,
GR_COMBINE_FUNCTION_ZERO,
GR_COMBINE_FACTOR_NONE,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE, FXTRUE, FXFALSE);
else
- FX_grTexCombine_NoLock(GR_TMU1,
+ grTexCombine(GR_TMU1,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE, FXFALSE, FXFALSE);
if (isalpha[FX_TMU0])
- FX_grTexCombine_NoLock(GR_TMU0,
+ grTexCombine(GR_TMU0,
GR_COMBINE_FUNCTION_BLEND_OTHER,
GR_COMBINE_FACTOR_ONE,
GR_COMBINE_FUNCTION_BLEND_OTHER,
GR_COMBINE_FACTOR_LOCAL, FXFALSE, FXFALSE);
else
- FX_grTexCombine_NoLock(GR_TMU0,
+ grTexCombine(GR_TMU0,
GR_COMBINE_FUNCTION_BLEND_OTHER,
GR_COMBINE_FACTOR_LOCAL,
GR_COMBINE_FUNCTION_BLEND_OTHER,
GR_COMBINE_FACTOR_LOCAL, FXFALSE, FXFALSE);
- FX_grColorCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER,
+ grColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_LOCAL,
localc, GR_COMBINE_OTHER_TEXTURE, FXFALSE);
- FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER,
+ grAlphaCombine(GR_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_LOCAL,
locala, GR_COMBINE_OTHER_TEXTURE, FXFALSE);
break;
}
case (FX_UM_E0_REPLACE | FX_UM_E1_BLEND): /* Only for GLQuake */
if (tmu1 == FX_TMU1) {
- FX_grTexCombine_NoLock(GR_TMU1,
+ grTexCombine(GR_TMU1,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE, FXTRUE, FXFALSE);
- FX_grTexCombine_NoLock(GR_TMU0,
+ grTexCombine(GR_TMU0,
GR_COMBINE_FUNCTION_BLEND_OTHER,
GR_COMBINE_FACTOR_LOCAL,
GR_COMBINE_FUNCTION_BLEND_OTHER,
GR_COMBINE_FACTOR_LOCAL, FXFALSE, FXFALSE);
}
else {
- FX_grTexCombine_NoLock(GR_TMU1,
+ grTexCombine(GR_TMU1,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE, FXFALSE, FXFALSE);
- FX_grTexCombine_NoLock(GR_TMU0,
+ grTexCombine(GR_TMU0,
GR_COMBINE_FUNCTION_BLEND_OTHER,
GR_COMBINE_FACTOR_ONE_MINUS_LOCAL,
GR_COMBINE_FUNCTION_BLEND_OTHER,
FXFALSE, FXFALSE);
}
- FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_LOCAL,
+ grAlphaCombine(GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
locala, GR_COMBINE_OTHER_NONE, FXFALSE);
- FX_grColorCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER,
+ grColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
localc, GR_COMBINE_OTHER_TEXTURE, FXFALSE);
break;
case (FX_UM_E0_REPLACE | FX_UM_E1_MODULATE): /* Quake 2 and 3 */
if (tmu1 == FX_TMU1) {
- FX_grTexCombine_NoLock(GR_TMU1,
+ grTexCombine(GR_TMU1,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GR_COMBINE_FUNCTION_ZERO,
GR_COMBINE_FACTOR_NONE, FXFALSE, FXTRUE);
- FX_grTexCombine_NoLock(GR_TMU0,
+ grTexCombine(GR_TMU0,
GR_COMBINE_FUNCTION_BLEND_OTHER,
GR_COMBINE_FACTOR_LOCAL,
GR_COMBINE_FUNCTION_BLEND_OTHER,
}
else {
- FX_grTexCombine_NoLock(GR_TMU1,
+ grTexCombine(GR_TMU1,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE, FXFALSE, FXFALSE);
- FX_grTexCombine_NoLock(GR_TMU0,
+ grTexCombine(GR_TMU0,
GR_COMBINE_FUNCTION_BLEND_OTHER,
GR_COMBINE_FACTOR_LOCAL,
GR_COMBINE_FUNCTION_BLEND_OTHER,
}
if (ti0->baseLevelInternalFormat == GL_RGB)
- FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_LOCAL,
+ grAlphaCombine(GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
locala, GR_COMBINE_OTHER_NONE, FXFALSE);
else
- FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER,
+ grAlphaCombine(GR_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
locala, GR_COMBINE_OTHER_NONE, FXFALSE);
- FX_grColorCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER,
+ grColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
localc, GR_COMBINE_OTHER_TEXTURE, FXFALSE);
break;
isalpha[tmu1] = GL_FALSE;
if (isalpha[FX_TMU1])
- FX_grTexCombine_NoLock(GR_TMU1,
+ grTexCombine(GR_TMU1,
GR_COMBINE_FUNCTION_ZERO,
GR_COMBINE_FACTOR_NONE,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE, FXTRUE, FXFALSE);
else
- FX_grTexCombine_NoLock(GR_TMU1,
+ grTexCombine(GR_TMU1,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE, FXFALSE, FXFALSE);
if (isalpha[FX_TMU0])
- FX_grTexCombine_NoLock(GR_TMU0,
+ grTexCombine(GR_TMU0,
GR_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL,
GR_COMBINE_FACTOR_ONE, FXFALSE, FXFALSE);
else
- FX_grTexCombine_NoLock(GR_TMU0,
+ grTexCombine(GR_TMU0,
GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL,
GR_COMBINE_FACTOR_ONE,
GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL,
GR_COMBINE_FACTOR_ONE, FXFALSE, FXFALSE);
- FX_grColorCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER,
+ grColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_LOCAL,
localc, GR_COMBINE_OTHER_TEXTURE, FXFALSE);
- FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER,
+ grAlphaCombine(GR_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_LOCAL,
locala, GR_COMBINE_OTHER_TEXTURE, FXFALSE);
break;
else
localc = GR_COMBINE_LOCAL_CONSTANT;
- FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_LOCAL,
+ grAlphaCombine(GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
locala, GR_COMBINE_OTHER_NONE, FXFALSE);
- FX_grColorCombine_NoLock(GR_COMBINE_FUNCTION_LOCAL,
+ grColorCombine(GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
localc, GR_COMBINE_OTHER_NONE, FXFALSE);
tfxUnitsState *us = &fxMesa->unitsState;
if (us->blendEnabled)
- FX_grAlphaBlendFunction(us->blendSrcFuncRGB, us->blendDstFuncRGB,
+ grAlphaBlendFunction(us->blendSrcFuncRGB, us->blendDstFuncRGB,
us->blendSrcFuncAlpha, us->blendDstFuncAlpha);
else
- FX_grAlphaBlendFunction(GR_BLEND_ONE, GR_BLEND_ZERO, GR_BLEND_ONE,
+ grAlphaBlendFunction(GR_BLEND_ONE, GR_BLEND_ZERO, GR_BLEND_ONE,
GR_BLEND_ZERO);
}
if (us->alphaTestEnabled) {
GrAlpha_t ref = (GLint) (us->alphaTestRefValue * 255.0);
- FX_grAlphaTestFunction(us->alphaTestFunc);
- FX_grAlphaTestReferenceValue(ref);
+ grAlphaTestFunction(us->alphaTestFunc);
+ grAlphaTestReferenceValue(ref);
}
else
- FX_grAlphaTestFunction(GR_CMP_ALWAYS);
+ grAlphaTestFunction(GR_CMP_ALWAYS);
}
/************************************************************************/
tfxUnitsState *us = &fxMesa->unitsState;
if (us->depthTestEnabled) {
- FX_grDepthBufferFunction(us->depthTestFunc);
- FX_grDepthMask(us->depthMask);
+ grDepthBufferFunction(us->depthTestFunc);
+ grDepthMask(us->depthMask);
}
else {
- FX_grDepthBufferFunction(GR_CMP_ALWAYS);
- FX_grDepthMask(FXFALSE);
+ grDepthBufferFunction(GR_CMP_ALWAYS);
+ grDepthMask(FXFALSE);
}
}
fxMesaContext fxMesa = FX_CONTEXT(ctx);
if (ctx->Color.DrawBuffer == GL_NONE) {
- FX_grColorMask(FXFALSE, FXFALSE);
+ grColorMask(FXFALSE, FXFALSE);
}
else {
- FX_grColorMask(ctx->Color.ColorMask[RCOMP] ||
+ grColorMask(ctx->Color.ColorMask[RCOMP] ||
ctx->Color.ColorMask[GCOMP] ||
ctx->Color.ColorMask[BCOMP],
ctx->Color.ColorMask[ACOMP] && fxMesa->haveAlphaBuffer);
col[1] = (unsigned int) (255 * ctx->Fog.Color[1]);
col[2] = (unsigned int) (255 * ctx->Fog.Color[2]);
col[3] = (unsigned int) (255 * ctx->Fog.Color[3]);
- FX_grFogColorValue(FXCOLOR4(col));
+ grFogColorValue(FXCOLOR4(col));
if (fxMesa->fogTableMode != ctx->Fog.Mode ||
fxMesa->fogDensity != ctx->Fog.Density ||
fxMesa->fogEnd = ctx->Fog.End;
}
- FX_grFogTable(fxMesa->fogTable);
- FX_grFogMode(GR_FOG_WITH_TABLE);
+ grFogTable(fxMesa->fogTable);
+ grFogMode(GR_FOG_WITH_TABLE);
}
else {
- FX_grFogMode(GR_FOG_DISABLE);
+ grFogMode(GR_FOG_DISABLE);
}
}
ymin = fxMesa->screen_height - fxMesa->clipMaxY;
if (ymax > fxMesa->screen_height - fxMesa->clipMinY)
ymax = fxMesa->screen_height - fxMesa->clipMinY;
- FX_grClipWindow_NoLock(xmin, ymin, xmax, ymax);
+ grClipWindow(xmin, ymin, xmax, ymax);
}
static void
FX_CONTEXT(ctx)->cullMode = GR_CULL_DISABLE;
if (FX_CONTEXT(ctx)->raster_primitive == GL_TRIANGLES)
- FX_grCullMode(FX_CONTEXT(ctx)->cullMode);
+ grCullMode(FX_CONTEXT(ctx)->cullMode);
}
break;
case GL_DITHER:
if (state) {
- FX_grDitherMode(GR_DITHER_4x4);
+ grDitherMode(GR_DITHER_4x4);
}
else {
- FX_grDitherMode(GR_DITHER_DISABLE);
+ grDitherMode(GR_DITHER_DISABLE);
}
break;
case GL_SCISSOR_TEST:
-/* $Id: fxtexman.c,v 1.15 2001/09/23 16:50:01 brianp Exp $ */
+/* $Id: fxtexman.c,v 1.16 2003/08/19 15:52:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Brian Paul
* Daryll Strauss
* Keith Whitwell
+ * Daniel Borca
+ * Hiroshi Morii
*/
/* fxtexman.c - 3Dfx VooDoo texture memory functions */
MemRange *tmn, *last;
FxU32 start, end, blockstart, blockend;
- start = FX_grTexMinAddress(tmu);
- end = FX_grTexMaxAddress(tmu);
+ start = grTexMinAddress(tmu);
+ end = grTexMaxAddress(tmu);
if (fxMesa->verbose) {
- fprintf(stderr, "Voodoo %s configuration:",
+ fprintf(stderr, "Voodoo %s configuration:\n",
(tmu == FX_TMU0) ? "TMU0" : "TMU1");
fprintf(stderr, "Voodoo Lower texture memory address (%u)\n",
(unsigned int) start);
fxTMAddObj(fxMesaContext fxMesa,
struct gl_texture_object *tObj, GLint tmu, int texmemsize)
{
- FxU32 startAddr;
+ FxI32 startAddr;
MemRange *range;
startAddr = fxTMFindStartAddr(fxMesa, tmu, texmemsize);
switch (where) {
case FX_TMU0:
case FX_TMU1:
- texmemsize =
- (int) FX_grTexTextureMemRequired_NoLock(GR_MIPMAPLEVELMASK_BOTH,
- &(ti->info));
+ texmemsize = (int)grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &(ti->info));
ti->tm[where] = fxTMAddObj(fxMesa, tObj, where, texmemsize);
fxMesa->stats.memTexUpload += texmemsize;
for (i = FX_largeLodValue(ti->info), l = ti->minLevel;
i <= FX_smallLodValue(ti->info); i++, l++) {
struct gl_texture_image *texImage = tObj->Image[l];
- FX_grTexDownloadMipMapLevel_NoLock(where,
+ grTexDownloadMipMapLevel(where,
ti->tm[where]->startAddr,
FX_valueToLod(i),
FX_largeLodLog2(ti->info),
}
break;
case FX_TMU_SPLIT:
- texmemsize =
- (int) FX_grTexTextureMemRequired_NoLock(GR_MIPMAPLEVELMASK_ODD,
- &(ti->info));
+ texmemsize = (int)grTexTextureMemRequired(GR_MIPMAPLEVELMASK_ODD, &(ti->info));
ti->tm[FX_TMU0] = fxTMAddObj(fxMesa, tObj, FX_TMU0, texmemsize);
fxMesa->stats.memTexUpload += texmemsize;
- texmemsize =
- (int) FX_grTexTextureMemRequired_NoLock(GR_MIPMAPLEVELMASK_EVEN,
- &(ti->info));
+ texmemsize = (int)grTexTextureMemRequired(GR_MIPMAPLEVELMASK_EVEN, &(ti->info));
ti->tm[FX_TMU1] = fxTMAddObj(fxMesa, tObj, FX_TMU1, texmemsize);
fxMesa->stats.memTexUpload += texmemsize;
i <= FX_smallLodValue(ti->info); i++, l++) {
struct gl_texture_image *texImage = tObj->Image[l];
- FX_grTexDownloadMipMapLevel_NoLock(GR_TMU0,
+ grTexDownloadMipMapLevel(GR_TMU0,
ti->tm[FX_TMU0]->startAddr,
FX_valueToLod(i),
FX_largeLodLog2(ti->info),
GR_MIPMAPLEVELMASK_ODD,
texImage->Data);
- FX_grTexDownloadMipMapLevel_NoLock(GR_TMU1,
+ grTexDownloadMipMapLevel(GR_TMU1,
ti->tm[FX_TMU1]->startAddr,
FX_valueToLod(i),
FX_largeLodLog2(ti->info),
}
break;
case FX_TMU_BOTH:
- texmemsize =
- (int) FX_grTexTextureMemRequired_NoLock(GR_MIPMAPLEVELMASK_BOTH,
- &(ti->info));
+ texmemsize = (int)grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &(ti->info));
ti->tm[FX_TMU0] = fxTMAddObj(fxMesa, tObj, FX_TMU0, texmemsize);
fxMesa->stats.memTexUpload += texmemsize;
- texmemsize =
- (int) FX_grTexTextureMemRequired_NoLock(GR_MIPMAPLEVELMASK_BOTH,
- &(ti->info));
+ texmemsize = (int)grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &(ti->info));
ti->tm[FX_TMU1] = fxTMAddObj(fxMesa, tObj, FX_TMU1, texmemsize);
fxMesa->stats.memTexUpload += texmemsize;
for (i = FX_largeLodValue(ti->info), l = ti->minLevel;
i <= FX_smallLodValue(ti->info); i++, l++) {
struct gl_texture_image *texImage = tObj->Image[l];
- FX_grTexDownloadMipMapLevel_NoLock(GR_TMU0,
+ grTexDownloadMipMapLevel(GR_TMU0,
ti->tm[FX_TMU0]->startAddr,
FX_valueToLod(i),
FX_largeLodLog2(ti->info),
GR_MIPMAPLEVELMASK_BOTH,
texImage->Data);
- FX_grTexDownloadMipMapLevel_NoLock(GR_TMU1,
+ grTexDownloadMipMapLevel(GR_TMU1,
ti->tm[FX_TMU1]->startAddr,
FX_valueToLod(i),
FX_largeLodLog2(ti->info),
fxTexGetInfo(mml->width, mml->height,
&lodlevel, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
-#ifdef FX_GLIDE3
lodlevel -= level;
-#else
- lodlevel += level;
-#endif
switch (tmu) {
case FX_TMU0:
case FX_TMU1:
- FX_grTexDownloadMipMapLevel(tmu,
+ grTexDownloadMipMapLevel(tmu,
ti->tm[tmu]->startAddr,
FX_valueToLod(FX_lodToValue(lodlevel)),
FX_largeLodLog2(ti->info),
GR_MIPMAPLEVELMASK_BOTH, texImage->Data);
break;
case FX_TMU_SPLIT:
- FX_grTexDownloadMipMapLevel(GR_TMU0,
+ grTexDownloadMipMapLevel(GR_TMU0,
ti->tm[GR_TMU0]->startAddr,
FX_valueToLod(FX_lodToValue(lodlevel)),
FX_largeLodLog2(ti->info),
ti->info.format,
GR_MIPMAPLEVELMASK_ODD, texImage->Data);
- FX_grTexDownloadMipMapLevel(GR_TMU1,
+ grTexDownloadMipMapLevel(GR_TMU1,
ti->tm[GR_TMU1]->startAddr,
FX_valueToLod(FX_lodToValue(lodlevel)),
FX_largeLodLog2(ti->info),
GR_MIPMAPLEVELMASK_EVEN, texImage->Data);
break;
case FX_TMU_BOTH:
- FX_grTexDownloadMipMapLevel(GR_TMU0,
+ grTexDownloadMipMapLevel(GR_TMU0,
ti->tm[GR_TMU0]->startAddr,
FX_valueToLod(FX_lodToValue(lodlevel)),
FX_largeLodLog2(ti->info),
ti->info.format,
GR_MIPMAPLEVELMASK_BOTH, texImage->Data);
- FX_grTexDownloadMipMapLevel(GR_TMU1,
+ grTexDownloadMipMapLevel(GR_TMU1,
ti->tm[GR_TMU1]->startAddr,
FX_valueToLod(FX_lodToValue(lodlevel)),
FX_largeLodLog2(ti->info),
switch (tmu) {
case FX_TMU0:
case FX_TMU1:
- FX_grTexDownloadMipMapLevelPartial(tmu,
+ grTexDownloadMipMapLevelPartial(tmu,
ti->tm[tmu]->startAddr,
FX_valueToLod(FX_lodToValue(lodlevel)
+ level),
yoffset, yoffset + height - 1);
break;
case FX_TMU_SPLIT:
- FX_grTexDownloadMipMapLevelPartial(GR_TMU0,
+ grTexDownloadMipMapLevelPartial(GR_TMU0,
ti->tm[FX_TMU0]->startAddr,
FX_valueToLod(FX_lodToValue(lodlevel)
+ level),
GR_MIPMAPLEVELMASK_ODD, data,
yoffset, yoffset + height - 1);
- FX_grTexDownloadMipMapLevelPartial(GR_TMU1,
+ grTexDownloadMipMapLevelPartial(GR_TMU1,
ti->tm[FX_TMU1]->startAddr,
FX_valueToLod(FX_lodToValue(lodlevel)
+ level),
yoffset, yoffset + height - 1);
break;
case FX_TMU_BOTH:
- FX_grTexDownloadMipMapLevelPartial(GR_TMU0,
+ grTexDownloadMipMapLevelPartial(GR_TMU0,
ti->tm[FX_TMU0]->startAddr,
FX_valueToLod(FX_lodToValue(lodlevel)
+ level),
GR_MIPMAPLEVELMASK_BOTH, data,
yoffset, yoffset + height - 1);
- FX_grTexDownloadMipMapLevelPartial(GR_TMU1,
+ grTexDownloadMipMapLevelPartial(GR_TMU1,
ti->tm[FX_TMU1]->startAddr,
FX_valueToLod(FX_lodToValue(lodlevel)
+ level),
-/* $Id: fxwgl.c,v 1.16 2002/10/24 23:57:23 brianp Exp $ */
+/* $Id: fxwgl.c,v 1.17 2003/08/19 15:52:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
#endif
#include <windows.h>
-#include "glheader.h"
-#include "fxdrv.h"
-#include "glapi.h"
+#define GL_GLEXT_PROTOTYPES
+#include "GL/gl.h"
+#include "GL/glext.h"
#ifdef __cplusplus
}
#include <stdio.h>
#include "GL/fxmesa.h"
+#include "glheader.h"
+#include "fxdrv.h"
+#include "glapi.h"
#define MAX_MESA_ATTRS 20
WINGDIAPI void GLAPIENTRY gl3DfxSetPaletteEXT(GLuint *);
struct __pixelformat__ pix[] = {
+#if 0
+ /* None */
+ {
+ {
+ sizeof(PIXELFORMATDESCRIPTOR), 1,
+ PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL |
+ PFD_DOUBLEBUFFER | PFD_SWAP_COPY,
+ PFD_TYPE_RGBA,
+ 16,
+ 5, 11, 6, 5, 5, 0, 0, 0,
+ 0, 0, 0, 0, 0,
+ 0,
+ 0,
+ 0,
+ PFD_MAIN_PLANE,
+ 0, 0, 0, 0}
+ ,
+ {
+ FXMESA_COLORDEPTH, 16,
+ FXMESA_DOUBLEBUFFER,
+ FXMESA_ALPHA_SIZE, 0,
+ FXMESA_DEPTH_SIZE, 0,
+ FXMESA_STENCIL_SIZE, 0,
+ FXMESA_ACCUM_SIZE, 0,
+ FXMESA_NONE}
+ }
+ ,
+
+ /* Alpha */
+ {
+ {
+ sizeof(PIXELFORMATDESCRIPTOR), 1,
+ PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL |
+ PFD_DOUBLEBUFFER | PFD_SWAP_COPY,
+ PFD_TYPE_RGBA,
+ 16,
+ 5, 10, 5, 5, 5, 0, 1, 15,
+ 0, 0, 0, 0, 0,
+ 0,
+ 0,
+ 0,
+ PFD_MAIN_PLANE,
+ 0, 0, 0, 0}
+ ,
+ {
+ FXMESA_COLORDEPTH, 15,
+ FXMESA_DOUBLEBUFFER,
+ FXMESA_ALPHA_SIZE, 1,
+ FXMESA_DEPTH_SIZE, 0,
+ FXMESA_STENCIL_SIZE, 0,
+ FXMESA_ACCUM_SIZE, 0,
+ FXMESA_NONE}
+ }
+ ,
+
+ /* Depth */
+ {
+ {
+ sizeof(PIXELFORMATDESCRIPTOR), 1,
+ PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL |
+ PFD_DOUBLEBUFFER | PFD_SWAP_COPY,
+ PFD_TYPE_RGBA,
+ 16,
+ 5, 11, 6, 5, 5, 0, 0, 0,
+ 0, 0, 0, 0, 0,
+ 16,
+ 0,
+ 0,
+ PFD_MAIN_PLANE,
+ 0, 0, 0, 0}
+ ,
+ {
+ FXMESA_COLORDEPTH, 16,
+ FXMESA_DOUBLEBUFFER,
+ FXMESA_ALPHA_SIZE, 0,
+ FXMESA_DEPTH_SIZE, 16,
+ FXMESA_STENCIL_SIZE, 0,
+ FXMESA_ACCUM_SIZE, 0,
+ FXMESA_NONE}
+ }
+ ,
+
/* None */
{
{
PFD_DOUBLEBUFFER | PFD_SWAP_COPY,
PFD_TYPE_RGBA,
32,
- 8, 0, 8, 8, 8, 16, 0, 24,
+ 8, 16, 8, 8, 8, 0, 0, 0,
0, 0, 0, 0, 0,
0,
0,
0, 0, 0, 0}
,
{
+ FXMESA_COLORDEPTH, 32,
FXMESA_DOUBLEBUFFER,
FXMESA_ALPHA_SIZE, 0,
FXMESA_DEPTH_SIZE, 0,
PFD_DOUBLEBUFFER | PFD_SWAP_COPY,
PFD_TYPE_RGBA,
32,
- 8, 0, 8, 8, 8, 16, 8, 24,
+ 8, 16, 8, 8, 8, 0, 8, 24,
0, 0, 0, 0, 0,
0,
0,
0, 0, 0, 0}
,
{
+ FXMESA_COLORDEPTH, 32,
FXMESA_DOUBLEBUFFER,
FXMESA_ALPHA_SIZE, 8,
FXMESA_DEPTH_SIZE, 0,
PFD_DOUBLEBUFFER | PFD_SWAP_COPY,
PFD_TYPE_RGBA,
32,
- 8, 0, 8, 8, 8, 16, 0, 24,
+ 8, 16, 8, 8, 8, 0, 0, 0,
0, 0, 0, 0, 0,
16,
0,
0, 0, 0, 0}
,
{
+ FXMESA_COLORDEPTH, 32,
FXMESA_DOUBLEBUFFER,
FXMESA_ALPHA_SIZE, 0,
FXMESA_DEPTH_SIZE, 16,
FXMESA_ACCUM_SIZE, 0,
FXMESA_NONE}
}
+#endif
+ /* 16bit RGB565 */
+ {
+ {sizeof(PIXELFORMATDESCRIPTOR), 1,
+ PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL |
+ PFD_DOUBLEBUFFER | PFD_SWAP_COPY,
+ PFD_TYPE_RGBA,
+ 16,
+ 5, 11, 6, 5, 5, 0, 0, 0,
+ 0, 0, 0, 0, 0,
+ 16,
+ 0,
+ 0,
+ PFD_MAIN_PLANE,
+ 0, 0, 0, 0}
+ ,
+ {FXMESA_COLORDEPTH, 16,
+ FXMESA_DOUBLEBUFFER,
+ FXMESA_ALPHA_SIZE, 0,
+ FXMESA_DEPTH_SIZE, 16,
+ FXMESA_STENCIL_SIZE, 0,
+ FXMESA_ACCUM_SIZE, 0,
+ FXMESA_NONE}
+ }
+ ,
+ /* 16bit ARGB1555 */
+ {
+ {sizeof(PIXELFORMATDESCRIPTOR), 1,
+ PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL |
+ PFD_DOUBLEBUFFER | PFD_SWAP_COPY,
+ PFD_TYPE_RGBA,
+ 16,
+ 5, 10, 5, 5, 5, 0, 1, 15,
+ 0, 0, 0, 0, 0,
+ 16,
+ 0,
+ 0,
+ PFD_MAIN_PLANE,
+ 0, 0, 0, 0}
+ ,
+ {FXMESA_COLORDEPTH, 15,
+ FXMESA_DOUBLEBUFFER,
+ FXMESA_ALPHA_SIZE, 1,
+ FXMESA_DEPTH_SIZE, 16,
+ FXMESA_STENCIL_SIZE, 0,
+ FXMESA_ACCUM_SIZE, 0,
+ FXMESA_NONE}
+ }
+ ,
+ /* 32bit ARGB8888 */
+ {
+ {sizeof(PIXELFORMATDESCRIPTOR), 1,
+ PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL |
+ PFD_DOUBLEBUFFER | PFD_SWAP_COPY,
+ PFD_TYPE_RGBA,
+ 32,
+ 8, 16, 8, 8, 8, 0, 8, 24,
+ 0, 0, 0, 0, 0,
+ 24,
+ 0,
+ 0,
+ PFD_MAIN_PLANE,
+ 0, 0, 0, 0}
+ ,
+ {FXMESA_COLORDEPTH, 32,
+ FXMESA_DOUBLEBUFFER,
+ FXMESA_ALPHA_SIZE, 8,
+ FXMESA_DEPTH_SIZE, 24,
+ FXMESA_STENCIL_SIZE, 0,
+ FXMESA_ACCUM_SIZE, 0,
+ FXMESA_NONE}
+ }
};
static int qt_pix = sizeof(pix) / sizeof(pix[0]);
/* For the in-window-rendering hack */
+#ifndef GR_CONTROL_RESIZE
+/* Apparently GR_CONTROL_RESIZE can be ignored. OK? */
+#define GR_CONTROL_RESIZE -1
+#endif
+
static GLboolean gdiWindowHack;
-static GLboolean gdiWindowHackEna;
static void *dibSurfacePtr;
static BITMAPINFO *dibBMI;
static HBITMAP dibHBM;
long ret; /* Now gives the resized window at the end to hWNDOldProc */
if (ctx && hwnd == hWND) {
- switch (message) {
- case WM_PAINT:
- case WM_MOVE:
- break;
- case WM_DISPLAYCHANGE:
- case WM_SIZE:
- if (wParam != SIZE_MINIMIZED) {
- static int moving = 0;
- if (!moving) {
- if (fxQueryHardware() != GR_SSTTYPE_VOODOO) {
- if (!FX_grSstControl(GR_CONTROL_RESIZE)) {
- moving = 1;
- SetWindowPos(hwnd, 0, 0, 0, 300, 300,
- SWP_NOMOVE | SWP_NOZORDER);
- moving = 0;
- if (!FX_grSstControl(GR_CONTROL_RESIZE)) {
- /*MessageBox(0,_T("Error changing windowsize"),_T("fxMESA"),MB_OK); */
- PostMessage(hWND, WM_CLOSE, 0, 0);
+ switch (message) {
+ case WM_PAINT:
+ case WM_MOVE:
+ break;
+ case WM_DISPLAYCHANGE:
+ case WM_SIZE:
+ if (wParam != SIZE_MINIMIZED) {
+ static int moving = 0;
+ if (!moving) {
+ if (!FX_grSstControl(GR_CONTROL_RESIZE)) {
+ moving = 1;
+ SetWindowPos(hwnd, 0, 0, 0, 300, 300, SWP_NOMOVE | SWP_NOZORDER);
+ moving = 0;
+ if (!FX_grSstControl(GR_CONTROL_RESIZE)) {
+ /*MessageBox(0,_T("Error changing windowsize"),_T("fxMESA"),MB_OK); */
+ PostMessage(hWND, WM_CLOSE, 0, 0);
}
- }
- }
-
+ }
/* Do the clipping in the glide library */
- FX_grClipWindow(0, 0, FX_grSstScreenWidth(),
- FX_grSstScreenHeight());
- /* And let the new size set in the context */
- fxMesaUpdateScreenSize(ctx);
- }
- }
- break;
- case WM_ACTIVATE:
- if ((fxQueryHardware() == GR_SSTTYPE_VOODOO) &&
- (!gdiWindowHack) && (!haveDualHead)) {
- WORD fActive = LOWORD(wParam);
- BOOL fMinimized = (BOOL) HIWORD(wParam);
-
- if ((fActive == WA_INACTIVE) || fMinimized)
- FX_grSstControl(GR_CONTROL_DEACTIVATE);
- else
- FX_grSstControl(GR_CONTROL_ACTIVATE);
- }
- break;
- case WM_SHOWWINDOW:
- break;
- case WM_SYSKEYDOWN:
- case WM_SYSCHAR:
- if (gdiWindowHackEna && (VK_RETURN == wParam)) {
- if (gdiWindowHack) {
- gdiWindowHack = GL_FALSE;
- FX_grSstControl(GR_CONTROL_ACTIVATE);
- }
- else {
- gdiWindowHack = GL_TRUE;
- FX_grSstControl(GR_CONTROL_DEACTIVATE);
- }
- }
- break;
- }
+ grClipWindow(0, 0, FX_grSstScreenWidth(), FX_grSstScreenHeight());
+ /* And let the new size set in the context */
+ fxMesaUpdateScreenSize(ctx);
+ }
+ }
+ break;
+ case WM_ACTIVATE:
+ break;
+ case WM_SHOWWINDOW:
+ break;
+ case WM_SYSKEYDOWN:
+ case WM_SYSCHAR:
+ break;
+ }
}
/* Finaly call the hWNDOldProc, which handles the resize witch the
freopen("MESA.LOG", "w", stderr);
#endif
- ShowWindow(hWnd, SW_SHOWNORMAL);
- SetForegroundWindow(hWnd);
- Sleep(100); /* an hack for win95 */
-
- if (fxQueryHardware() == GR_SSTTYPE_VOODOO) {
- RECT cliRect;
-
- GetClientRect(hWnd, &cliRect);
- error = !(ctx =
- fxMesaCreateBestContext((GLuint) hWnd, cliRect.right,
- cliRect.bottom,
- pix[curPFD - 1].mesaAttr));
-
- if (!error) {
- /* create the DIB section for windowed rendering */
- DWORD *p;
-
- dibWnd = hWnd;
-
- hDC = GetDC(dibWnd);
-
- dibBMI =
- (BITMAPINFO *) MALLOC(sizeof(BITMAPINFO) +
- (256 * sizeof(RGBQUAD)));
-
- memset(dibBMI, 0, sizeof(BITMAPINFO) + (256 * sizeof(RGBQUAD)));
-
- dibBMI->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- dibBMI->bmiHeader.biWidth = ctx->width;
- dibBMI->bmiHeader.biHeight = -ctx->height;
- dibBMI->bmiHeader.biPlanes = (short) 1;
- dibBMI->bmiHeader.biBitCount = (short) 16;
- dibBMI->bmiHeader.biCompression = BI_BITFIELDS;
- dibBMI->bmiHeader.biSizeImage = 0;
- dibBMI->bmiHeader.biXPelsPerMeter = 0;
- dibBMI->bmiHeader.biYPelsPerMeter = 0;
- dibBMI->bmiHeader.biClrUsed = 3;
- dibBMI->bmiHeader.biClrImportant = 3;
-
- p = (DWORD *) dibBMI->bmiColors;
- p[0] = 0xF800;
- p[1] = 0x07E0;
- p[2] = 0x001F;
-
- dibHBM =
- CreateDIBSection(hDC, dibBMI, DIB_RGB_COLORS, &dibSurfacePtr,
- NULL, 0);
-
- ReleaseDC(dibWnd, hDC);
-
- gdiWindowHackEna = (dibHBM != NULL ? GL_TRUE : GL_FALSE);
-
- if (!getenv("MESA_WGL_FX")
- || !strcmp(getenv("MESA_WGL_FX"), "fullscreen"))
- gdiWindowHack = GL_FALSE;
- else {
- gdiWindowHack = GL_TRUE;
- FX_grSstControl(GR_CONTROL_DEACTIVATE);
- }
- }
- }
- else {
- /* For the Voodoo Rush */
-
- if (getenv("MESA_WGL_FX")
- && !strcmp(getenv("MESA_WGL_FX"), "fullscreen")) {
- RECT cliRect;
-
- GetClientRect(hWnd, &cliRect);
- error = !(ctx =
- fxMesaCreateBestContext((GLuint) hWnd, cliRect.right,
- cliRect.bottom,
- pix[curPFD - 1].mesaAttr));
- }
- else
- error = !(ctx =
- fxMesaCreateContext((GLuint) hWnd, GR_RESOLUTION_NONE,
- GR_REFRESH_75Hz,
- pix[curPFD - 1].mesaAttr));
+ {
+ RECT cliRect;
+ ShowWindow(hWnd, SW_SHOWNORMAL);
+ SetForegroundWindow(hWnd);
+ Sleep(100); /* a hack for win95 */
+ GetClientRect(hWnd, &cliRect);
+ error = !(ctx = fxMesaCreateBestContext((GLuint) hWnd, cliRect.right, cliRect.bottom, pix[curPFD - 1].mesaAttr));
}
if (getenv("SST_DUALHEAD"))
wglDeleteContext(HGLRC hglrc)
{
if (ctx && hglrc == (HGLRC) 1) {
- if (gdiWindowHackEna) {
- DeleteObject(dibHBM);
- FREE(dibBMI);
-
- dibSurfacePtr = NULL;
- dibBMI = NULL;
- dibHBM = NULL;
- dibWnd = NULL;
- }
fxMesaDestroyContext(ctx);
// Place chars based on base line
VERIFY(SetTextAlign(bitDevice, TA_BASELINE) >= 0 ? 1 : 0);
- for (i = 0; i < numChars; i++) {
+ for (i = 0; i < (int)numChars; i++) {
SIZE size;
char curChar;
int charWidth, charHeight, bmapWidth, bmapHeight, numBytes, res;
HGDIOBJ origBmap;
unsigned char *bmap;
- curChar = i + firstChar;
+ curChar = (char)(i + firstChar); // [koolsmoky] explicit cast
// Find how high/wide this character is
VERIFY(GetTextExtentPoint32(bitDevice, &curChar, 1, &size));
}
for (i = 0; i < qt_valid_pix; i++) {
+ if (ppfd->cColorBits > 0 && pix[i].pfd.cColorBits != ppfd->cColorBits)
+ continue;
+
if ((ppfd->dwFlags & PFD_DRAW_TO_WINDOW)
&& !(pix[i].pfd.dwFlags & PFD_DRAW_TO_WINDOW)) continue;
if ((ppfd->dwFlags & PFD_DRAW_TO_BITMAP)
fxMesaSwapBuffers();
- if (gdiWindowHack) {
- GLuint width = ctx->width;
- GLuint height = ctx->height;
-
- HDC hdcScreen = GetDC(dibWnd);
- HDC hdcDIBSection = CreateCompatibleDC(hdcScreen);
- HBITMAP holdBitmap = (HBITMAP) SelectObject(hdcDIBSection, dibHBM);
-
- FX_grLfbReadRegion(GR_BUFFER_FRONTBUFFER, 0, 0,
- width, height, width * 2, dibSurfacePtr);
-
- /* Since the hardware is configured for GR_COLORFORMAT_ABGR the pixel data is
- * going to come out as BGR 565, which is reverse of what we need for blitting
- * to screen, so we need to convert it here pixel-by-pixel (ick). This loop would NOT
- * be required if the color format was changed to GR_COLORFORMAT_ARGB, but I do
- * not know the ramifications of that, so this will work until that is resolved.
- *
- * This routine CRIES out for MMX implementation, however since that's not
- * guaranteed to be running on MMX enabled hardware so I'm not going to do
- * that. I'm just going to try to make a reasonably efficient C
- * version. -TAJ
- *
- * This routine drops frame rate by <1 fps on a 200Mhz MMX processor with a 640x480
- * display. Obviously, it's performance hit will be higher on larger displays and
- * less on smaller displays. To support the window-hack display this is probably fine.
- */
-#if FXMESA_USE_ARGB
- {
- unsigned long *pixel = dibSurfacePtr;
- unsigned long count = (width * height) / 2;
-
- while (count--) {
- *pixel++ = (*pixel & 0x07e007e0) /* greens */
- |((*pixel & 0xf800f800) >> 11) /* swap blues */
- |((*pixel & 0x001f001f) << 11) /* swap reds */
- ;
- }
- }
-#endif
-
- BitBlt(hdcScreen, 0, 0, width, height, hdcDIBSection, 0, 0, SRCCOPY);
-
- ReleaseDC(dibWnd, hdcScreen);
- SelectObject(hdcDIBSection, holdBitmap);
- DeleteDC(hdcDIBSection);
- }
-
return (TRUE);
}