mesa: Remove obsolete Windows gldirect and ICD drivers

Acked-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Marek Olšák <maraeo@gmail.com>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Build-Tested-by: Jakob Bornecrantz <jakob@vmware.com>
Tested-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
This commit is contained in:
Ian Romanick 2011-08-24 14:56:36 -07:00
parent 17645103aa
commit 117042b46f
60 changed files with 2 additions and 35854 deletions

View file

@ -50,9 +50,6 @@
# As a consequence, you'll need the Win32 Glide3
# library to build any application.
# default = no
# ICD=1 build the installable client driver interface
# (windows opengl driver interface)
# default = no
# X86=1 optimize for x86 (if possible, use MMX, SSE, 3DNow).
# default = no
#
@ -69,11 +66,7 @@
# Set this to the prefix of your build tools, i.e. mingw32-
TOOLS_PREFIX = mingw32-
ifeq ($(ICD),1)
LIB_NAME = mesa32
else
LIB_NAME = opengl32
endif
LIB_NAME = opengl32
DLL_EXT = .dll
IMP_EXT = .a
@ -106,12 +99,7 @@ ifeq ($(FX),1)
GL_DEF = drivers/windows/fx/fxopengl.def
GL_RES = drivers/windows/fx/fx.rc
else
ifeq ($(ICD),1)
CFLAGS += -DUSE_MGL_NAMESPACE
GL_DEF = drivers/windows/icd/mesa.def
else
GL_DEF = $(LIB_NAME).def
endif
GL_DEF = $(LIB_NAME).def
endif
@ -143,16 +131,10 @@ DRIVER_SOURCES = \
$(GLIDE_DRIVER_SOURCES) \
drivers/windows/fx/fxwgl.c
else
ifeq ($(ICD),1)
DRIVER_SOURCES = \
drivers/windows/gdi/wmesa.c \
drivers/windows/icd/icd.c
else
DRIVER_SOURCES = \
drivers/windows/gdi/wmesa.c \
drivers/windows/gdi/wgl.c
endif
endif
SOURCES = $(MESA_SOURCES) $(GLAPI_SOURCES) $(X86_SOURCES) $(DRIVER_SOURCES)

View file

@ -1,192 +0,0 @@
/****************************************************************************
*
* Mesa 3-D graphics library
* Direct3D Driver Interface
*
* ========================================================================
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* ======================================================================
*
* Language: ANSI C
* Environment: Windows 9x (Win32)
*
* Description: Logging functions.
*
****************************************************************************/
#define STRICT
#include <windows.h>
#include "ddlog.h"
#include "gld_driver.h"
// ***********************************************************************
static char ddlogbuf[256];
static FILE* fpDDLog = NULL; // Log file pointer
static char szDDLogName[_MAX_PATH] = {"gldirect.log"}; // Filename of the log
static DDLOG_loggingMethodType ddlogLoggingMethod = DDLOG_NONE; // Default to No Logging
static DDLOG_severityType ddlogDebugLevel;
static BOOL bUIWarning = FALSE; // MessageBox warning ?
// ***********************************************************************
void ddlogOpen(
DDLOG_loggingMethodType LoggingMethod,
DDLOG_severityType Severity)
{
if (fpDDLog != NULL) {
// Tried to re-open the log
ddlogMessage(DDLOG_WARN, "Tried to re-open the log file\n");
return;
}
ddlogLoggingMethod = LoggingMethod;
ddlogDebugLevel = Severity;
if (ddlogLoggingMethod == DDLOG_NORMAL) {
fpDDLog = fopen(szDDLogName, "wt");
if (fpDDLog == NULL)
return;
}
ddlogMessage(DDLOG_SYSTEM, "\n");
ddlogMessage(DDLOG_SYSTEM, "-> Logging Started\n");
}
// ***********************************************************************
void ddlogClose()
{
// Determine whether the log is already closed
if (fpDDLog == NULL && ddlogLoggingMethod == DDLOG_NORMAL)
return; // Nothing to do.
ddlogMessage(DDLOG_SYSTEM, "<- Logging Ended\n");
if (ddlogLoggingMethod == DDLOG_NORMAL) {
fclose(fpDDLog);
fpDDLog = NULL;
}
}
// ***********************************************************************
void ddlogMessage(
DDLOG_severityType severity,
LPSTR message)
{
char buf[256];
// Bail if logging is disabled
if (ddlogLoggingMethod == DDLOG_NONE)
return;
if (ddlogLoggingMethod == DDLOG_CRASHPROOF)
fpDDLog = fopen(szDDLogName, "at");
if (fpDDLog == NULL)
return;
if (severity >= ddlogDebugLevel) {
sprintf(buf, "DDLog: (%s) %s", ddlogSeverityMessages[severity], message);
fputs(buf, fpDDLog); // Write string to file
OutputDebugString(buf); // Echo to debugger
}
if (ddlogLoggingMethod == DDLOG_CRASHPROOF) {
fflush(fpDDLog); // Write info to disk
fclose(fpDDLog);
fpDDLog = NULL;
}
// Popup message box if critical error
if (bUIWarning && severity == DDLOG_CRITICAL) {
MessageBox(NULL, buf, "GLDirect", MB_OK | MB_ICONWARNING | MB_TASKMODAL);
}
}
// ***********************************************************************
// Write a string value to the log file
void ddlogError(
DDLOG_severityType severity,
LPSTR message,
HRESULT hResult)
{
#ifdef _USE_GLD3_WGL
char dxErrStr[1024];
_gldDriver.GetDXErrorString(hResult, &dxErrStr[0], sizeof(dxErrStr));
if (FAILED(hResult)) {
sprintf(ddlogbuf, "DDLog: %s %8x:[ %s ]\n", message, hResult, dxErrStr);
} else
sprintf(ddlogbuf, "DDLog: %s\n", message);
#else
if (FAILED(hResult)) {
sprintf(ddlogbuf, "DDLog: %s %8x:[ %s ]\n", message, hResult, DDErrorToString(hResult));
} else
sprintf(ddlogbuf, "DDLog: %s\n", message);
#endif
ddlogMessage(severity, ddlogbuf);
}
// ***********************************************************************
void ddlogPrintf(
DDLOG_severityType severity,
LPSTR message,
...)
{
va_list args;
va_start(args, message);
vsprintf(ddlogbuf, message, args);
va_end(args);
lstrcat(ddlogbuf, "\n");
ddlogMessage(severity, ddlogbuf);
}
// ***********************************************************************
void ddlogWarnOption(
BOOL bWarnOption)
{
bUIWarning = bWarnOption;
}
// ***********************************************************************
void ddlogPathOption(
LPSTR szPath)
{
char szPathName[_MAX_PATH];
strcpy(szPathName, szPath);
strcat(szPathName, "\\");
strcat(szPathName, szDDLogName);
strcpy(szDDLogName, szPathName);
}
// ***********************************************************************

View file

@ -1,109 +0,0 @@
/****************************************************************************
*
* Mesa 3-D graphics library
* Direct3D Driver Interface
*
* ========================================================================
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* ======================================================================
*
* Language: ANSI C
* Environment: Windows 9x (Win32)
*
* Description: Logging functions.
*
****************************************************************************/
#ifndef __DDLOG_H
#define __DDLOG_H
#include <stdio.h>
#ifndef _USE_GLD3_WGL
#include "dderrstr.h" // ddraw/d3d error string
#endif
/*---------------------- Macros and type definitions ----------------------*/
typedef enum {
DDLOG_NONE = 0, // No log output
DDLOG_NORMAL = 1, // Log is kept open
DDLOG_CRASHPROOF = 2, // Log is closed and flushed
DDLOG_METHOD_FORCE_DWORD = 0x7fffffff,
} DDLOG_loggingMethodType;
// Denotes type of message sent to the logging functions
typedef enum {
DDLOG_INFO = 0, // Information only
DDLOG_WARN = 1, // Warning only
DDLOG_ERROR = 2, // Notify user of an error
DDLOG_CRITICAL = 3, // Exceptionally severe error
DDLOG_SYSTEM = 4, // System message. Not an error
// but must always be printed.
DDLOG_SEVERITY_FORCE_DWORD = 0x7fffffff, // Make enum dword
} DDLOG_severityType;
#ifdef _USE_GLD3_WGL
// Synomyms
#define GLDLOG_INFO DDLOG_INFO
#define GLDLOG_WARN DDLOG_WARN
#define GLDLOG_ERROR DDLOG_ERROR
#define GLDLOG_CRITICAL DDLOG_CRITICAL
#define GLDLOG_SYSTEM DDLOG_SYSTEM
#endif
// The message that will be output to the log
static const char *ddlogSeverityMessages[] = {
"INFO",
"WARN",
"ERROR",
"*CRITICAL*",
"System",
};
/*------------------------- Function Prototypes ---------------------------*/
#ifdef __cplusplus
extern "C" {
#endif
void ddlogOpen(DDLOG_loggingMethodType LoggingMethod, DDLOG_severityType Severity);
void ddlogClose();
void ddlogMessage(DDLOG_severityType severity, LPSTR message);
void ddlogError(DDLOG_severityType severity, LPSTR message, HRESULT hResult);
void ddlogPrintf(DDLOG_severityType severity, LPSTR message, ...);
void ddlogWarnOption(BOOL bWarnOption);
void ddlogPathOption(LPSTR szPath);
#ifdef _USE_GLD3_WGL
// Synomyms
#define gldLogMessage ddlogMessage
#define gldLogError ddlogError
#define gldLogPrintf ddlogPrintf
#endif
#ifdef __cplusplus
}
#endif
#endif

File diff suppressed because it is too large Load diff

View file

@ -1,281 +0,0 @@
/****************************************************************************
*
* Mesa 3-D graphics library
* Direct3D Driver Interface
*
* ========================================================================
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* ======================================================================
*
* Language: ANSI C
* Environment: Windows 9x (Win32)
*
* Description: OpenGL context handling.
*
****************************************************************************/
#ifndef __DGLCONTEXT_H
#define __DGLCONTEXT_H
// Disable compiler complaints about DLL linkage
#pragma warning (disable:4273)
// Macros to control compilation
#ifndef STRICT
#define STRICT
#endif // STRICT
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <GL\gl.h>
#ifdef _USE_GLD3_WGL
#include "dglmacros.h"
#include "dglglobals.h"
#include "pixpack.h"
#include "ddlog.h"
#include "dglpf.h"
#include "context.h" // Mesa context
#else
#include <ddraw.h>
#include <d3d.h>
#include "dglmacros.h"
#include "dglglobals.h"
#include "pixpack.h"
#include "ddlog.h"
#include "dglpf.h"
#include "d3dvertex.h"
#include "DirectGL.h"
#include "context.h" // Mesa context
#include "vb.h" // Mesa vertex buffer
#endif // _USE_GLD3_WGL
/*---------------------- Macros and type definitions ----------------------*/
// TODO: Use a list instead of this constant!
#define DGL_MAX_CONTEXTS 32
// Structure for describing an OpenGL context
#ifdef _USE_GLD3_WGL
typedef struct {
BOOL bHasBeenCurrent;
DGL_pixelFormat *lpPF;
// Pointer to private driver data (this also contains the drawable).
void *glPriv;
// Mesa vars:
struct gl_context *glCtx; // The core Mesa context
struct gl_config *glVis; // Describes the color buffer
struct gl_framebuffer *glBuffer; // Ancillary buffers
GLuint ClearIndex;
GLuint CurrentIndex;
GLubyte ClearColor[4];
GLubyte CurrentColor[4];
BOOL EmulateSingle; // Emulate single-buffering
BOOL bDoubleBuffer;
BOOL bDepthBuffer;
// Shared driver vars:
BOOL bAllocated;
BOOL bFullscreen; // Is this a fullscreen context?
BOOL bSceneStarted; // Has a lpDev->BeginScene been issued?
BOOL bCanRender; // Flag: states whether rendering is OK
BOOL bFrameStarted; // Has frame update started at all?
BOOL bStencil; // TRUE if this context has stencil
BOOL bGDIEraseBkgnd; // GDI Erase Background command
// Window information
HWND hWnd; // Window handle
HDC hDC; // Windows' Device Context of the window
DWORD dwWidth; // Window width
DWORD dwHeight; // Window height
DWORD dwBPP; // Window bits-per-pixel;
RECT rcScreenRect; // Screen rectangle
DWORD dwModeWidth; // Display mode width
DWORD dwModeHeight; // Display mode height
float dvClipX;
float dvClipY;
LONG lpfnWndProc; // window message handler function
} DGL_ctx;
#define GLD_context DGL_ctx
#define GLD_GET_CONTEXT(c) (GLD_context*)(c)->DriverCtx
#else // _USE_GLD3_WGL
typedef struct {
BOOL bHasBeenCurrent;
DGL_pixelFormat *lpPF;
//
// Mesa context vars:
//
struct gl_context *glCtx; // The core Mesa context
struct gl_config *glVis; // Describes the color buffer
struct gl_framebuffer *glBuffer; // Ancillary buffers
GLuint ClearIndex;
GLuint CurrentIndex;
GLubyte ClearColor[4];
GLubyte CurrentColor[4];
BOOL EmulateSingle; // Emulate single-buffering
BOOL bDoubleBuffer;
BOOL bDepthBuffer;
int iZBufferPF; // Index of Zbuffer pixel format
// Vertex buffer: one-to-one correlation with Mesa's vertex buffer.
// This will be filled by our setup function (see d3dvsetup.c)
DGL_TLvertex gWin[VB_SIZE]; // Transformed and lit vertices
// DGL_Lvertex gObj[VB_SIZE]; // Lit vertices in object coordinates.
// Indices for DrawIndexedPrimitive.
// Clipped quads are drawn seperately, so use VB_SIZE.
// 6 indices are needed to make 2 triangles for each possible quad
// WORD wIndices[(VB_SIZE / 4) * 6];
WORD wIndices[32768];
//
// Device driver vars:
//
BOOL bAllocated;
BOOL bFullscreen; // Is this a fullscreen context?
BOOL bSceneStarted; // Has a lpDev->BeginScene been issued?
BOOL bCanRender; // Flag: states whether rendering is OK
BOOL bFrameStarted; // Has frame update started at all?
// DirectX COM interfaces, postfixed with the interface number
IDirectDraw *lpDD1;
IDirectDraw4 *lpDD4;
IDirect3D3 *lpD3D3;
IDirect3DDevice3 *lpDev3;
IDirect3DViewport3 *lpViewport3;
IDirectDrawSurface4 *lpFront4;
IDirectDrawSurface4 *lpBack4;
IDirectDrawSurface4 *lpDepth4;
// Vertex buffers
BOOL bD3DPipeline; // True if using D3D geometry pipeline
IDirect3DVertexBuffer *m_vbuf; // Unprocessed vertices
IDirect3DVertexBuffer *m_pvbuf; // Processed vertices ready to be rendered
D3DTEXTUREOP ColorOp[MAX_TEXTURE_UNITS]; // Used for re-enabling texturing
D3DTEXTUREOP AlphaOp[MAX_TEXTURE_UNITS]; // Used for re-enabling texturing
struct gl_texture_object *tObj[MAX_TEXTURE_UNITS];
DDCAPS ddCaps; // DirectDraw caps
D3DDEVICEDESC D3DDevDesc; // Direct3D Device description
DDPIXELFORMAT ddpfRender; // Pixel format of the render buffer
DDPIXELFORMAT ddpfDepth; // Pixel format of the depth buffer
BOOL bStencil; // TRUE is this context has stencil
PX_packFunc fnPackFunc; // Pixel packing function for SW
PX_unpackFunc fnUnpackFunc; // Pixel unpacking function for SW
PX_packSpanFunc fnPackSpanFunc; // Pixel span packer
D3DVIEWPORT2 d3dViewport; // D3D Viewport object
D3DCULL cullmode; // Direct3D cull mode
D3DCOLOR curcolor; // Current color
DWORD dwColorPF; // Current color, in format of target surface
D3DCOLOR d3dClearColor; // Clear color
D3DCOLOR ConstantColor; // For flat shading
DWORD dwClearColorPF; // Clear color, in format of target surface
BOOL bGDIEraseBkgnd; // GDI Erase Background command
// Primitive caches
// DGL_vertex LineCache[DGL_MAX_LINE_VERTS];
// DGL_vertex TriCache[DGL_MAX_TRI_VERTS];
// DWORD dwNextLineVert;
// DWORD dwNextTriVert;
// Window information
HWND hWnd; // Window handle
HDC hDC; // Windows' Device Context of the window
DWORD dwWidth; // Window width
DWORD dwHeight; // Window height
DWORD dwBPP; // Window bits-per-pixel;
RECT rcScreenRect; // Screen rectangle
DWORD dwModeWidth; // Display mode width
DWORD dwModeHeight; // Display mode height
float dvClipX;
float dvClipY;
LONG lpfnWndProc; // window message handler function
// Shared texture palette
IDirectDrawPalette *lpGlobalPalette;
// Usage counters.
// One of these counters will be incremented when we choose
// between hardware and software rendering functions.
// DWORD dwHWUsageCount; // Hardware usage count
// DWORD dwSWUsageCount; // Software usage count
// Texture state flags.
// BOOL m_texturing; // TRUE is texturing
// BOOL m_mtex; // TRUE if multitexture
// BOOL m_texHandleValid; // TRUE if tex state valid
// Renderstate caches to ensure no redundant state changes
DWORD dwRS[256]; // Renderstates
DWORD dwTSS[2][24]; // Texture-stage states
LPDIRECT3DTEXTURE2 lpTex[2]; // Texture (1 per stage)
DWORD dwMaxTextureSize; // Max texture size:
// clamped to 1024.
} DGL_ctx;
#endif // _USE_GLD3_WGL
/*------------------------- Function Prototypes ---------------------------*/
#ifdef __cplusplus
extern "C" {
#endif
HHOOK hKeyHook;
LRESULT CALLBACK dglKeyProc(int code,WPARAM wParam,LPARAM lParam);
void dglInitContextState();
void dglDeleteContextState();
BOOL dglIsValidContext(HGLRC a);
DGL_ctx* dglGetContextAddress(const HGLRC a);
HDC dglGetCurrentDC(void);
HGLRC dglGetCurrentContext(void);
HGLRC dglCreateContext(HDC a, const DGL_pixelFormat *lpPF);
BOOL dglMakeCurrent(HDC a, HGLRC b);
BOOL dglDeleteContext(HGLRC a);
BOOL dglSwapBuffers(HDC hDC);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,149 +0,0 @@
/****************************************************************************
*
* Mesa 3-D graphics library
* Direct3D Driver Interface
*
* ========================================================================
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* ======================================================================
*
* Language: ANSI C
* Environment: Windows 9x (Win32)
*
* Description: Global variables.
*
****************************************************************************/
#include "dglglobals.h"
// =======================================================================
// Global Variables
// =======================================================================
char szCopyright[] = "Copyright (c) 1998 SciTech Software, Inc.";
char szDllName[] = "Scitech GLDirect";
char szErrorTitle[] = "GLDirect Error";
DGL_globals glb;
// Shared result variable
HRESULT hResult;
// ***********************************************************************
// Patch function for missing function in Mesa
int finite(
double x)
{
return _finite(x);
};
// ***********************************************************************
void dglInitGlobals()
{
// Zero all fields just in case
memset(&glb, 0, sizeof(glb));
// Set the global defaults
glb.bPrimary = FALSE; // Not the primary device
glb.bHardware = FALSE; // Not a hardware device
// glb.bFullscreen = FALSE; // Not running fullscreen
glb.bSquareTextures = FALSE; // Device does not need sq
glb.bPAL8 = FALSE; // Device cannot do 8bit
glb.dwMemoryType = DDSCAPS_SYSTEMMEMORY;
glb.dwRendering = DGL_RENDER_D3D;
glb.bWaitForRetrace = TRUE; // Sync to vertical retrace
glb.bFullscreenBlit = FALSE;
glb.nPixelFormatCount = 0;
glb.lpPF = NULL; // Pixel format list
#ifndef _USE_GLD3_WGL
glb.nZBufferPFCount = 0;
glb.lpZBufferPF = NULL;
glb.nDisplayModeCount = 0;
glb.lpDisplayModes = NULL;
glb.nTextureFormatCount = 0;
glb.lpTextureFormat = NULL;
#endif // _USE_GLD3_WGL
glb.wMaxSimultaneousTextures = 1;
// Enable support for multitexture, if available.
glb.bMultitexture = TRUE;
// Enable support for mipmapping
glb.bUseMipmaps = TRUE;
// Alpha emulation via chroma key
glb.bEmulateAlphaTest = FALSE;
// Use Mesa pipeline always (for compatibility)
glb.bForceMesaPipeline = FALSE;
// Init support for multiple GLRCs
glb.bDirectDraw = FALSE;
glb.bDirectDrawPrimary = FALSE;
glb.bDirect3D = FALSE;
glb.bDirect3DDevice = FALSE;
glb.bDirectDrawStereo = FALSE;
glb.iDirectDrawStereo = 0;
glb.hWndActive = NULL;
// Init DirectX COM interfaces for multiple GLRCs
// glb.lpDD4 = NULL;
// glb.lpPrimary4 = NULL;
// glb.lpBack4 = NULL;
// glb.lpDepth4 = NULL;
// glb.lpGlobalPalette = NULL;
// Init special support options
glb.bMessageBoxWarnings = TRUE;
glb.bDirectDrawPersistant = FALSE;
glb.bPersistantBuffers = FALSE;
// Do not assume single-precision-only FPU (for compatibility)
glb.bFastFPU = FALSE;
// Allow hot-key support
glb.bHotKeySupport = TRUE;
// Default to single-threaded support (for simplicity)
glb.bMultiThreaded = FALSE;
// Use application-specific customizations (for end-user convenience)
glb.bAppCustomizations = TRUE;
#ifdef _USE_GLD3_WGL
// Registry/ini-file settings for GLDirect 3.x
glb.dwAdapter = 0; // Primary DX8 adapter
glb.dwTnL = 1; // MesaSW TnL
glb.dwMultisample = 0; // Multisample Off
glb.dwDriver = 2; // Direct3D HW
// Signal a pixelformat list rebuild
glb.bPixelformatsDirty = TRUE;
#endif
}
// ***********************************************************************

View file

@ -1,198 +0,0 @@
/****************************************************************************
*
* Mesa 3-D graphics library
* Direct3D Driver Interface
*
* ========================================================================
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* ======================================================================
*
* Language: ANSI C
* Environment: Windows 9x (Win32)
*
* Description: Globals.
*
****************************************************************************/
#ifndef __DGLGLOBALS_H
#define __DGLGLOBALS_H
#include "dglcontext.h"
#include "dglpf.h" // Pixel format
#ifndef _USE_GLD3_WGL
#include "d3dtexture.h"
#endif
/*---------------------- Macros and type definitions ----------------------*/
typedef enum {
DGL_RENDER_MESASW = 0,
DGL_RENDER_D3D = 1,
DGL_RENDER_FORCE_DWORD = 0x7ffffff,
} DGL_renderType;
#ifdef _USE_GLD3_WGL
// Same as DGL_renderType? KeithH
typedef enum {
GLDS_DRIVER_MESA_SW = 0, // Mesa SW rendering
GLDS_DRIVER_REF = 1, // Direct3D Reference Rasteriser
GLDS_DRIVER_HAL = 2, // Direct3D HW rendering
} GLDS_DRIVER;
typedef enum {
GLDS_TNL_DEFAULT = 0, // Choose best TnL method
GLDS_TNL_MESA = 1, // Mesa TnL
GLDS_TNL_D3DSW = 2, // D3D Software TnL
GLDS_TNL_D3DHW = 3, // D3D Hardware TnL
} GLDS_TNL;
typedef enum {
GLDS_MULTISAMPLE_NONE = 0,
GLDS_MULTISAMPLE_FASTEST = 1,
GLDS_MULTISAMPLE_NICEST = 2,
} GLDS_MULTISAMPLE;
#endif
typedef struct {
// Registry settings
char szDDName[MAX_DDDEVICEID_STRING]; // DirectDraw device name
char szD3DName[MAX_DDDEVICEID_STRING]; // Direct3D driver name
BOOL bPrimary; // Is ddraw device the Primary device?
BOOL bHardware; // Is the d3d driver a Hardware driver?
#ifndef _USE_GLD3_WGL
GUID ddGuid; // GUID of the ddraw device
GUID d3dGuid; // GUID of the direct3d driver
#endif // _USE_GLD3_WGL
// BOOL bFullscreen; // Force fullscreen - only useful for primary adaptors.
BOOL bSquareTextures; // Does this driver require square textures?
DWORD dwRendering; // Type of rendering required
BOOL bWaitForRetrace; // Sync to vertical retrace
BOOL bFullscreenBlit; // Use Blt instead of Flip in fullscreen modes
// Multitexture
BOOL bMultitexture;
BOOL bUseMipmaps;
DWORD dwMemoryType; // Sysmem or Vidmem
// Global palette
BOOL bPAL8;
DDPIXELFORMAT ddpfPAL8;
// Multitexture
WORD wMaxSimultaneousTextures;
// Win32 internals
BOOL bAppActive; // Keep track of Alt-Tab
LONG lpfnWndProc; // WndProc of calling app
// Pixel Format Descriptior list.
int nPixelFormatCount;
DGL_pixelFormat *lpPF;
#ifndef _USE_GLD3_WGL
// ZBuffer pixel formats
int nZBufferPFCount; // Count of Zbuffer pixel formats
DDPIXELFORMAT *lpZBufferPF; // ZBuffer pixel formats
// Display modes (for secondary devices)
int nDisplayModeCount;
DDSURFACEDESC2 *lpDisplayModes;
// Texture pixel formats
int nTextureFormatCount;
DGL_textureFormat *lpTextureFormat;
#endif // _USE_GLD3_WGL
// Alpha emulation via chroma key
BOOL bEmulateAlphaTest;
// Geom pipeline override.
// If this is set TRUE then the D3D pipeline will never be used,
// and the Mesa pipline will always be used.
BOOL bForceMesaPipeline;
#ifdef _USE_GLD3_WGL
BOOL bPixelformatsDirty; // Signal a list rebuild
#endif
// Additional globals to support multiple GL rendering contexts, GLRCs
BOOL bDirectDraw; // DirectDraw interface exists ?
BOOL bDirectDrawPrimary; // DirectDraw primary surface exists ?
BOOL bDirect3D; // Direct3D interface exists ?
BOOL bDirect3DDevice; // Direct3D device exists ?
BOOL bDirectDrawStereo; // DirectDraw Stereo driver started ?
int iDirectDrawStereo; // DirectDraw Stereo driver reference count
HWND hWndActive; // copy of active window
// Copies of DirectX COM interfaces for re-referencing across multiple GLRCs
// IDirectDraw4 *lpDD4; // copy of DirectDraw interface
// IDirectDrawSurface4 *lpPrimary4; // copy of DirectDraw primary surface
// IDirectDrawSurface4 *lpBack4;
// IDirectDrawSurface4 *lpDepth4;
// IDirectDrawPalette *lpGlobalPalette;
// Aids for heavy-duty MFC-windowed OGL apps, like AutoCAD
BOOL bMessageBoxWarnings; // popup message box warning
BOOL bDirectDrawPersistant; // DirectDraw is persisitant
BOOL bPersistantBuffers; // DirectDraw buffers persisitant
// FPU setup option for CAD precision (AutoCAD) vs GAME speed (Quake)
BOOL bFastFPU; // single-precision-only FPU ?
// Hot-Key support, like for real-time stereo parallax adjustments
BOOL bHotKeySupport; // hot-key support ?
// Multi-threaded support, for apps like 3DStudio
BOOL bMultiThreaded; // multi-threaded ?
// Detect and use app-specific customizations for apps like 3DStudio
BOOL bAppCustomizations; // app customizations ?
#ifdef _USE_GLD3_WGL
DWORD dwAdapter; // Primary DX8 adapter
DWORD dwTnL; // MesaSW TnL
DWORD dwMultisample; // Multisample Off
DWORD dwDriver; // Direct3D HW
void *pDrvPrivate; // Driver-specific data
#endif
} DGL_globals;
/*------------------------- Function Prototypes ---------------------------*/
#ifdef __cplusplus
extern "C" {
#endif
DGL_globals glb;
void dglInitGlobals();
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,91 +0,0 @@
/****************************************************************************
*
* Mesa 3-D graphics library
* Direct3D Driver Interface
*
* ========================================================================
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* ======================================================================
*
* Language: ANSI C
* Environment: Windows 9x (Win32)
*
* Description: Useful generic macros.
*
****************************************************************************/
#ifndef __DGLMACROS_H
#define __DGLMACROS_H
#include <ddraw.h>
// Define the relevant RELEASE macro depending on C or C++
#if !defined(__cplusplus) || defined(CINTERFACE)
// Standard C version
#define RELEASE(x) if (x!=NULL) { x->lpVtbl->Release(x); x=NULL; }
#else
// C++ version
#define RELEASE(x) if (x!=NULL) { x->Release(); x=NULL; }
#endif
// We don't want a message *every* time we call an unsupported function
#define UNSUPPORTED(x) \
{ \
static BOOL bFirstTime = TRUE; \
if (bFirstTime) { \
bFirstTime = FALSE; \
ddlogError(DDLOG_WARN, (x), DDERR_CURRENTLYNOTAVAIL); \
} \
}
#define DGL_CHECK_CONTEXT \
if (ctx == NULL) return;
// Don't render if bCanRender is not TRUE.
#define DGL_CHECK_RENDER \
if (!dgl->bCanRender) return;
#if 0
#define TRY(a,b) (a)
#define TRY_ERR(a,b) (a)
#else
// hResult should be defined in the function
// Return codes should be checked via SUCCEDDED and FAILED macros
#define TRY(a,b) \
{ \
if (FAILED(hResult=(a))) \
ddlogError(DDLOG_ERROR, (b), hResult); \
}
// hResult is a global
// The label exit_with_error should be defined within the calling scope
#define TRY_ERR(a,b) \
{ \
if (FAILED(hResult=(a))) { \
ddlogError(DDLOG_ERROR, (b), hResult); \
goto exit_with_error; \
} \
}
#endif // #if 1
#endif

View file

@ -1,620 +0,0 @@
/****************************************************************************
*
* Mesa 3-D graphics library
* Direct3D Driver Interface
*
* ========================================================================
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* ========================================================================
*
* Language: ANSI C
* Environment: Windows 9x (Win32)
*
* Description: Pixel Formats.
*
****************************************************************************/
#include "dglpf.h"
#ifdef _USE_GLD3_WGL
#include "gld_driver.h"
#endif
// ***********************************************************************
char szColorDepthWarning[] =
"GLDirect does not support the current desktop\n\
color depth.\n\n\
You may need to change the display resolution to\n\
16 bits per pixel or higher color depth using\n\
the Windows Display Settings control panel\n\
before running this OpenGL application.\n";
// ***********************************************************************
// This pixel format will be used as a template when compiling the list
// of pixel formats supported by the hardware. Many fields will be
// filled in at runtime.
// PFD flag defaults are upgraded to match ChoosePixelFormat() -- DaveM
DGL_pixelFormat pfTemplateHW =
{
{
sizeof(PIXELFORMATDESCRIPTOR), // Size of the data structure
1, // Structure version - should be 1
// Flags:
PFD_DRAW_TO_WINDOW | // The buffer can draw to a window or device surface.
PFD_DRAW_TO_BITMAP | // The buffer can draw to a bitmap. (DaveM)
PFD_SUPPORT_GDI | // The buffer supports GDI drawing. (DaveM)
PFD_SUPPORT_OPENGL | // The buffer supports OpenGL drawing.
PFD_DOUBLEBUFFER | // The buffer is double-buffered.
0, // Placeholder for easy commenting of above flags
PFD_TYPE_RGBA, // Pixel type RGBA.
16, // Total colour bitplanes (excluding alpha bitplanes)
5, 0, // Red bits, shift
5, 5, // Green bits, shift
5, 10, // Blue bits, shift
0, 0, // Alpha bits, shift (destination alpha)
0, // Accumulator bits (total)
0, 0, 0, 0, // Accumulator bits: Red, Green, Blue, Alpha
0, // Depth bits
0, // Stencil bits
0, // Number of auxiliary buffers
0, // Layer type
0, // Specifies the number of overlay and underlay planes.
0, // Layer mask
0, // Specifies the transparent color or index of an underlay plane.
0 // Damage mask
},
-1, // No depth/stencil buffer
};
// ***********************************************************************
// Return the count of the number of bits in a Bit Mask.
int BitCount(
DWORD dw)
{
int i;
if (dw == 0)
return 0; // account for non-RGB mode
for (i=0; dw; dw=dw>>1)
i += (dw & 1);
return i;
}
// ***********************************************************************
DWORD BitShift(
DWORD dwMaskIn)
{
DWORD dwShift, dwMask;
if (dwMaskIn == 0)
return 0; // account for non-RGB mode
for (dwShift=0, dwMask=dwMaskIn; !(dwMask&1); dwShift++, dwMask>>=1);
return dwShift;
}
// ***********************************************************************
BOOL IsValidPFD(int iPFD)
{
DGL_pixelFormat *lpPF;
// Validate license
if (!dglValidate())
return FALSE;
if ((glb.lpPF == NULL) ||
(glb.nPixelFormatCount == 0))
return FALSE;
// Check PFD range
if ( (iPFD < 1) || (iPFD > glb.nPixelFormatCount) ) {
ddlogMessage(DDLOG_ERROR, "PFD out of range\n");
return FALSE; // PFD is invalid
}
// Make a pointer to the pixel format
lpPF = &glb.lpPF[iPFD-1];
// Check size
if (lpPF->pfd.nSize != sizeof(PIXELFORMATDESCRIPTOR)) {
ddlogMessage(DDLOG_ERROR, "Bad PFD size\n");
return FALSE; // PFD is invalid
}
// Check version
if (lpPF->pfd.nVersion != 1) {
ddlogMessage(DDLOG_ERROR, "PFD is not Version 1\n");
return FALSE; // PFD is invalid
}
return TRUE; // PFD is valid
}
// ***********************************************************************
#ifndef _USE_GLD3_WGL
int iEnumCount; // Enumeration count
DWORD dwDisplayBitDepth; // Bit depth of current display mode
// ***********************************************************************
HRESULT WINAPI EnumDisplayModesCallback(
DDSURFACEDESC2* pddsd,
void *pvContext)
{
DWORD dwModeDepth;
DDSURFACEDESC2 *lpDisplayMode;
char buf[32];
// Check parameters
if (pddsd == NULL)
return DDENUMRET_CANCEL;
dwModeDepth = pddsd->ddpfPixelFormat.dwRGBBitCount;
lpDisplayMode = (DDSURFACEDESC2 *)pvContext;
// Check mode for compatability with device.
if (dwModeDepth != dwDisplayBitDepth)
return DDENUMRET_OK;
if (lpDisplayMode != NULL) {
memcpy(&lpDisplayMode[iEnumCount], pddsd, sizeof(DDSURFACEDESC2));
sprintf(buf, TEXT("Mode: %ld x %ld x %ld\n"),
pddsd->dwWidth, pddsd->dwHeight, dwModeDepth);
ddlogMessage(DDLOG_INFO, buf);
}
iEnumCount++;
return DDENUMRET_OK;
}
// ***********************************************************************
HRESULT CALLBACK d3dEnumZBufferFormatsCallback(
DDPIXELFORMAT* pddpf,
VOID* lpZBufferPF )
{
char buf[64];
if(pddpf == NULL)
return D3DENUMRET_CANCEL;
if (pddpf->dwFlags & DDPF_ZBUFFER) {
if (lpZBufferPF == NULL) {
// Pass 1. Merely counting the PF
glb.nZBufferPFCount++;
} else {
// Pass 2. Save the PF
if (pddpf->dwFlags & DDPF_STENCILBUFFER) {
sprintf(buf, " %d: Z=%d S=%d\n",
iEnumCount,
pddpf->dwZBufferBitDepth,
pddpf->dwStencilBitDepth);
} else {
sprintf(buf, " %d: Z=%d S=0\n",
iEnumCount,
pddpf->dwZBufferBitDepth);
}
ddlogMessage(DDLOG_INFO, buf);
memcpy(&glb.lpZBufferPF[iEnumCount++],
pddpf,
sizeof(DDPIXELFORMAT));
}
}
return D3DENUMRET_OK;
}
#endif // _USE_GLD3_WGL
// ***********************************************************************
BOOL IsStencilSupportBroken(LPDIRECTDRAW4 lpDD4)
{
DDDEVICEIDENTIFIER dddi; // DX6 device identifier
BOOL bBroken = FALSE;
// Microsoft really fucked up with the GetDeviceIdentifier function
// on Windows 2000, since it locks up on stock driers on the CD. Updated
// drivers from vendors appear to work, but we can't identify the drivers
// without this function!!! For now we skip these tests on Windows 2000.
if ((GetVersion() & 0x80000000UL) == 0)
return FALSE;
// Obtain device info
if (FAILED(IDirectDraw4_GetDeviceIdentifier(lpDD4, &dddi, 0)))
return FALSE;
// Matrox G400 stencil buffer support does not draw anything in AutoCAD,
// but ordinary Z buffers draw shaded models fine. (DaveM)
if (dddi.dwVendorId == 0x102B) { // Matrox
if (dddi.dwDeviceId == 0x0525) { // G400
bBroken = TRUE;
}
}
return bBroken;
}
// ***********************************************************************
void dglBuildPixelFormatList()
{
int i;
char buf[128];
char cat[8];
DGL_pixelFormat *lpPF;
#ifdef _USE_GLD3_WGL
_gldDriver.BuildPixelformatList();
#else
HRESULT hRes;
IDirectDraw *lpDD1 = NULL;
IDirectDraw4 *lpDD4 = NULL;
IDirect3D3 *lpD3D3 = NULL;
DDSURFACEDESC2 ddsdDisplayMode;
DWORD dwRb, dwGb, dwBb, dwAb; // Bit counts
DWORD dwRs, dwGs, dwBs, dwAs; // Bit shifts
DWORD dwPixelType; // RGB or color index
// Set defaults
glb.nPixelFormatCount = 0;
glb.lpPF = NULL;
glb.nZBufferPFCount = 0;
glb.lpZBufferPF = NULL;
glb.nDisplayModeCount = 0;
glb.lpDisplayModes = NULL;
//
// Examine the hardware for depth and stencil
//
if (glb.bPrimary)
hRes = DirectDrawCreate(NULL, &lpDD1, NULL);
else
hRes = DirectDrawCreate(&glb.ddGuid, &lpDD1, NULL);
if (FAILED(hRes)) {
ddlogError(DDLOG_ERROR, "dglBPFL: DirectDrawCreate failed", hRes);
return;
}
// Query for DX6 IDirectDraw4.
hRes = IDirectDraw_QueryInterface(
lpDD1,
&IID_IDirectDraw4,
(void**)&lpDD4);
if (FAILED(hRes)) {
ddlogError(DDLOG_ERROR, "dglBPFL: QueryInterface (DD4) failed", hRes);
goto clean_up;
}
// Retrieve caps of current display mode
ZeroMemory(&ddsdDisplayMode, sizeof(ddsdDisplayMode));
ddsdDisplayMode.dwSize = sizeof(ddsdDisplayMode);
hRes = IDirectDraw4_GetDisplayMode(lpDD4, &ddsdDisplayMode);
if (FAILED(hRes))
goto clean_up;
dwDisplayBitDepth = ddsdDisplayMode.ddpfPixelFormat.dwRGBBitCount;
dwPixelType = (dwDisplayBitDepth <= 8) ? PFD_TYPE_COLORINDEX : PFD_TYPE_RGBA;
dwRb = BitCount(ddsdDisplayMode.ddpfPixelFormat.dwRBitMask);
dwGb = BitCount(ddsdDisplayMode.ddpfPixelFormat.dwGBitMask);
dwBb = BitCount(ddsdDisplayMode.ddpfPixelFormat.dwBBitMask);
dwRs = BitShift(ddsdDisplayMode.ddpfPixelFormat.dwRBitMask);
dwGs = BitShift(ddsdDisplayMode.ddpfPixelFormat.dwGBitMask);
dwBs = BitShift(ddsdDisplayMode.ddpfPixelFormat.dwBBitMask);
if (BitCount(ddsdDisplayMode.ddpfPixelFormat.dwRGBAlphaBitMask)) {
dwAb = BitCount(ddsdDisplayMode.ddpfPixelFormat.dwRGBAlphaBitMask);
dwAs = BitShift(ddsdDisplayMode.ddpfPixelFormat.dwRGBAlphaBitMask);
} else {
dwAb = 0;
dwAs = 0;
}
// Query for available display modes
ddlogMessage(DDLOG_INFO, "\n");
ddlogMessage(DDLOG_INFO, "Display Modes:\n");
// Pass 1: Determine count
iEnumCount = 0;
hRes = IDirectDraw4_EnumDisplayModes(
lpDD4,
0,
NULL,
NULL,
EnumDisplayModesCallback);
if (FAILED(hRes)) {
ddlogError(DDLOG_ERROR, "dglBPFL: EnumDisplayModes failed", hRes);
goto clean_up;
}
if (iEnumCount == 0) {
ddlogMessage(DDLOG_ERROR, "dglBPFL: No display modes found");
goto clean_up;
}
glb.lpDisplayModes = (DDSURFACEDESC2 *)calloc(iEnumCount,
sizeof(DDSURFACEDESC2));
if (glb.lpDisplayModes == NULL) {
ddlogMessage(DDLOG_ERROR, "dglBPFL: DDSURFACEDESC2 calloc failed");
goto clean_up;
}
glb.nDisplayModeCount = iEnumCount;
// Pass 2: Save modes
iEnumCount = 0;
hRes = IDirectDraw4_EnumDisplayModes(
lpDD4,
0,
NULL,
(void *)glb.lpDisplayModes,
EnumDisplayModesCallback);
if (FAILED(hRes)) {
ddlogError(DDLOG_ERROR, "dglBPFL: EnumDisplayModes failed", hRes);
goto clean_up;
}
// Query for IDirect3D3 interface
hRes = IDirectDraw4_QueryInterface(
lpDD4,
&IID_IDirect3D3,
(void**)&lpD3D3);
if (FAILED(hRes)) {
ddlogError(DDLOG_ERROR, "dglBPFL: QueryInterface (D3D3) failed", hRes);
goto clean_up;
}
ddlogMessage(DDLOG_INFO, "\n");
ddlogMessage(DDLOG_INFO, "ZBuffer formats:\n");
// Pass 1. Count the ZBuffer pixel formats
hRes = IDirect3D3_EnumZBufferFormats(
lpD3D3,
&glb.d3dGuid,
d3dEnumZBufferFormatsCallback,
NULL);
if (FAILED(hRes))
goto clean_up;
if (glb.nZBufferPFCount) {
glb.lpZBufferPF = (DDPIXELFORMAT *)calloc(glb.nZBufferPFCount,
sizeof(DDPIXELFORMAT));
if(glb.lpZBufferPF == NULL)
goto clean_up;
// Pass 2. Cache the ZBuffer pixel formats
iEnumCount = 0; // (Used by the enum function)
hRes = IDirect3D3_EnumZBufferFormats(
lpD3D3,
&glb.d3dGuid,
d3dEnumZBufferFormatsCallback,
glb.lpZBufferPF);
if (FAILED(hRes))
goto clean_up;
}
// Remove stencil support for boards which don't work for AutoCAD;
// Matrox G400 does not work, but NVidia TNT2 and ATI Rage128 do... (DaveM)
if (IsStencilSupportBroken(lpDD4)) {
for (i=0; i<iEnumCount; i++)
if (glb.lpZBufferPF[i].dwFlags & DDPF_STENCILBUFFER)
glb.nZBufferPFCount--;
}
// One each for every ZBuffer pixel format (including no depth buffer)
// Times-two because duplicated for single buffering (as opposed to double)
glb.nPixelFormatCount = 2 * (glb.nZBufferPFCount + 1);
glb.lpPF = (DGL_pixelFormat *)calloc(glb.nPixelFormatCount,
sizeof(DGL_pixelFormat));
if (glb.lpPF == NULL)
goto clean_up;
//
// Fill in the pixel formats
// Note: Depth buffer bits are really (dwZBufferBitDepth-dwStencilBitDepth)
// but this will pass wierd numbers to the OpenGL app. (?)
//
pfTemplateHW.pfd.iPixelType = dwPixelType;
pfTemplateHW.pfd.cColorBits = dwDisplayBitDepth;
pfTemplateHW.pfd.cRedBits = dwRb;
pfTemplateHW.pfd.cGreenBits = dwGb;
pfTemplateHW.pfd.cBlueBits = dwBb;
pfTemplateHW.pfd.cAlphaBits = dwAb;
pfTemplateHW.pfd.cRedShift = dwRs;
pfTemplateHW.pfd.cGreenShift = dwGs;
pfTemplateHW.pfd.cBlueShift = dwBs;
pfTemplateHW.pfd.cAlphaShift = dwAs;
lpPF = glb.lpPF;
// Fill in the double-buffered pixel formats
for (i=0; i<(glb.nZBufferPFCount + 1); i++, lpPF++) {
memcpy(lpPF, &pfTemplateHW, sizeof(DGL_pixelFormat));
if (i) {
lpPF->iZBufferPF = i-1;
lpPF->pfd.cDepthBits = glb.lpZBufferPF[i-1].dwZBufferBitDepth;
lpPF->pfd.cStencilBits = glb.lpZBufferPF[i-1].dwStencilBitDepth;
}
}
// Fill in the single-buffered pixel formats
for (i=0; i<(glb.nZBufferPFCount + 1); i++, lpPF++) {
memcpy(lpPF, &pfTemplateHW, sizeof(DGL_pixelFormat));
if (i) {
lpPF->iZBufferPF = i-1;
lpPF->pfd.cDepthBits = glb.lpZBufferPF[i-1].dwZBufferBitDepth;
lpPF->pfd.cStencilBits = glb.lpZBufferPF[i-1].dwStencilBitDepth;
}
// Remove double-buffer flag. Could use XOR instead...
lpPF->pfd.dwFlags &= (~(PFD_DOUBLEBUFFER));
// Insert GDI flag for single buffered format only.
lpPF->pfd.dwFlags |= PFD_SUPPORT_GDI;
}
#endif // _USE_GLD3_WGL
// Lets dump the list to the log
// ** Based on "wglinfo" by Nate Robins **
ddlogMessage(DDLOG_INFO, "\n");
ddlogMessage(DDLOG_INFO, "Pixel Formats:\n");
ddlogMessage(DDLOG_INFO,
" visual x bf lv rg d st r g b a ax dp st accum buffs ms\n");
ddlogMessage(DDLOG_INFO,
" id dep cl sp sz l ci b ro sz sz sz sz bf th cl r g b a ns b\n");
ddlogMessage(DDLOG_INFO,
"-----------------------------------------------------------------\n");
for (i=0, lpPF = glb.lpPF; i<glb.nPixelFormatCount; i++, lpPF++) {
sprintf(buf, "0x%02x ", i+1);
sprintf(cat, "%2d ", lpPF->pfd.cColorBits);
strcat(buf, cat);
if(lpPF->pfd.dwFlags & PFD_DRAW_TO_WINDOW) sprintf(cat, "wn ");
else if(lpPF->pfd.dwFlags & PFD_DRAW_TO_BITMAP) sprintf(cat, "bm ");
else sprintf(cat, ". ");
strcat(buf, cat);
/* should find transparent pixel from LAYERPLANEDESCRIPTOR */
sprintf(cat, " . ");
strcat(buf, cat);
sprintf(cat, "%2d ", lpPF->pfd.cColorBits);
strcat(buf, cat);
/* bReserved field indicates number of over/underlays */
if(lpPF->pfd.bReserved) sprintf(cat, " %d ", lpPF->pfd.bReserved);
else sprintf(cat, " . ");
strcat(buf, cat);
sprintf(cat, " %c ", lpPF->pfd.iPixelType == PFD_TYPE_RGBA ? 'r' : 'c');
strcat(buf, cat);
sprintf(cat, "%c ", lpPF->pfd.dwFlags & PFD_DOUBLEBUFFER ? 'y' : '.');
strcat(buf, cat);
sprintf(cat, " %c ", lpPF->pfd.dwFlags & PFD_STEREO ? 'y' : '.');
strcat(buf, cat);
if(lpPF->pfd.cRedBits && lpPF->pfd.iPixelType == PFD_TYPE_RGBA)
sprintf(cat, "%2d ", lpPF->pfd.cRedBits);
else sprintf(cat, " . ");
strcat(buf, cat);
if(lpPF->pfd.cGreenBits && lpPF->pfd.iPixelType == PFD_TYPE_RGBA)
sprintf(cat, "%2d ", lpPF->pfd.cGreenBits);
else sprintf(cat, " . ");
strcat(buf, cat);
if(lpPF->pfd.cBlueBits && lpPF->pfd.iPixelType == PFD_TYPE_RGBA)
sprintf(cat, "%2d ", lpPF->pfd.cBlueBits);
else sprintf(cat, " . ");
strcat(buf, cat);
if(lpPF->pfd.cAlphaBits && lpPF->pfd.iPixelType == PFD_TYPE_RGBA)
sprintf(cat, "%2d ", lpPF->pfd.cAlphaBits);
else sprintf(cat, " . ");
strcat(buf, cat);
if(lpPF->pfd.cAuxBuffers) sprintf(cat, "%2d ", lpPF->pfd.cAuxBuffers);
else sprintf(cat, " . ");
strcat(buf, cat);
if(lpPF->pfd.cDepthBits) sprintf(cat, "%2d ", lpPF->pfd.cDepthBits);
else sprintf(cat, " . ");
strcat(buf, cat);
if(lpPF->pfd.cStencilBits) sprintf(cat, "%2d ", lpPF->pfd.cStencilBits);
else sprintf(cat, " . ");
strcat(buf, cat);
if(lpPF->pfd.cAccumRedBits) sprintf(cat, "%2d ", lpPF->pfd.cAccumRedBits);
else sprintf(cat, " . ");
strcat(buf, cat);
if(lpPF->pfd.cAccumGreenBits) sprintf(cat, "%2d ", lpPF->pfd.cAccumGreenBits);
else sprintf(cat, " . ");
strcat(buf, cat);
if(lpPF->pfd.cAccumBlueBits) sprintf(cat, "%2d ", lpPF->pfd.cAccumBlueBits);
else sprintf(cat, " . ");
strcat(buf, cat);
if(lpPF->pfd.cAccumAlphaBits) sprintf(cat, "%2d ", lpPF->pfd.cAccumAlphaBits);
else sprintf(cat, " . ");
strcat(buf, cat);
/* no multisample in Win32 */
sprintf(cat, " . .\n");
strcat(buf, cat);
ddlogMessage(DDLOG_INFO, buf);
}
ddlogMessage(DDLOG_INFO,
"-----------------------------------------------------------------\n");
ddlogMessage(DDLOG_INFO, "\n");
#ifndef _USE_GLD3_WGL
clean_up:
// Release COM objects
RELEASE(lpD3D3);
RELEASE(lpDD4);
RELEASE(lpDD1);
// Popup warning message if non RGB color mode
if (dwDisplayBitDepth <= 8) {
ddlogPrintf(DDLOG_WARN, "Current Color Depth %d bpp is not supported", dwDisplayBitDepth);
MessageBox(NULL, szColorDepthWarning, "GLDirect", MB_OK | MB_ICONWARNING);
}
#endif // _USE_GLD3_WGL
}
// ***********************************************************************
void dglReleasePixelFormatList()
{
glb.nPixelFormatCount = 0;
if (glb.lpPF) {
free(glb.lpPF);
glb.lpPF = NULL;
}
#ifndef _USE_GLD3_WGL
glb.nZBufferPFCount = 0;
if (glb.lpZBufferPF) {
free(glb.lpZBufferPF);
glb.lpZBufferPF = NULL;
}
glb.nDisplayModeCount = 0;
if (glb.lpDisplayModes) {
free(glb.lpDisplayModes);
glb.lpDisplayModes = NULL;
}
#endif // _USE_GLD3_WGL
}
// ***********************************************************************

View file

@ -1,77 +0,0 @@
/****************************************************************************
*
* Mesa 3-D graphics library
* Direct3D Driver Interface
*
* ========================================================================
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* ======================================================================
*
* Language: ANSI C
* Environment: Windows 9x (Win32)
*
* Description: Pixel Formats.
*
****************************************************************************/
#ifndef __DGLPF_H
#define __DGLPF_H
#ifndef STRICT
#define STRICT
#endif // STRICT
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
/*---------------------- Macros and type definitions ----------------------*/
typedef struct {
PIXELFORMATDESCRIPTOR pfd; // Win32 Pixel Format Descriptor
#ifdef _USE_GLD3_WGL
// Driver-specific data.
// Example: The DX8 driver uses this to hold an index into a
// list of depth-stencil descriptions.
DWORD dwDriverData;
#else
int iZBufferPF; // Index of depth buffer pixel format
#endif
} DGL_pixelFormat;
#include "dglglobals.h"
/*------------------------- Function Prototypes ---------------------------*/
#ifdef __cplusplus
extern "C" {
#endif
BOOL IsValidPFD(int iPFD);
void dglBuildPixelFormatList();
void dglReleasePixelFormatList();
#ifdef __cplusplus
}
#endif
#endif

File diff suppressed because it is too large Load diff

View file

@ -1,127 +0,0 @@
/****************************************************************************
*
* Mesa 3-D graphics library
* Direct3D Driver Interface
*
* ========================================================================
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* ======================================================================
*
* Language: ANSI C
* Environment: Windows 9x (Win32)
*
* Description: OpenGL window functions (wgl*).
*
****************************************************************************/
#ifndef __DGLWGL_H
#define __DGLWGL_H
// Disable compiler complaints about DLL linkage
#pragma warning (disable:4273)
// Macros to control compilation
#define STRICT
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <GL\gl.h>
#include "dglcontext.h"
#include "dglglobals.h"
#include "dglmacros.h"
#include "ddlog.h"
#include "dglpf.h"
/*---------------------- Macros and type definitions ----------------------*/
typedef struct {
PROC proc;
char *name;
} DGL_extension;
#ifndef __MINGW32__
/* XXX why is this here?
* It should probaby be somewhere in src/mesa/drivers/windows/
*/
#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_WINGDI_H) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) && !defined(BUILD_FOR_SNAP)
# define WGL_FONT_LINES 0
# define WGL_FONT_POLYGONS 1
#ifndef _GNU_H_WINDOWS32_FUNCTIONS
# ifdef UNICODE
# define wglUseFontBitmaps wglUseFontBitmapsW
# define wglUseFontOutlines wglUseFontOutlinesW
# else
# define wglUseFontBitmaps wglUseFontBitmapsA
# define wglUseFontOutlines wglUseFontOutlinesA
# endif /* !UNICODE */
#endif /* _GNU_H_WINDOWS32_FUNCTIONS */
typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR;
typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT;
typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR;
#if !defined(GLX_USE_MESA)
#include <GL/mesa_wgl.h>
#endif
#endif
#endif /* !__MINGW32__ */
/*------------------------- Function Prototypes ---------------------------*/
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _USE_GLD3_WGL
int APIENTRY DGL_ChoosePixelFormat(HDC a, CONST PIXELFORMATDESCRIPTOR *ppfd);
BOOL APIENTRY DGL_CopyContext(HGLRC a, HGLRC b, UINT c);
HGLRC APIENTRY DGL_CreateContext(HDC a);
HGLRC APIENTRY DGL_CreateLayerContext(HDC a, int b);
BOOL APIENTRY DGL_DeleteContext(HGLRC a);
BOOL APIENTRY DGL_DescribeLayerPlane(HDC a, int b, int c, UINT d, LPLAYERPLANEDESCRIPTOR e);
int APIENTRY DGL_DescribePixelFormat(HDC a, int b, UINT c, LPPIXELFORMATDESCRIPTOR d);
HGLRC APIENTRY DGL_GetCurrentContext(void);
HDC APIENTRY DGL_GetCurrentDC(void);
PROC APIENTRY DGL_GetDefaultProcAddress(LPCSTR a);
int APIENTRY DGL_GetLayerPaletteEntries(HDC a, int b, int c, int d, COLORREF *e);
int APIENTRY DGL_GetPixelFormat(HDC a);
PROC APIENTRY DGL_GetProcAddress(LPCSTR a);
BOOL APIENTRY DGL_MakeCurrent(HDC a, HGLRC b);
BOOL APIENTRY DGL_RealizeLayerPalette(HDC a, int b, BOOL c);
int APIENTRY DGL_SetLayerPaletteEntries(HDC a, int b, int c, int d, CONST COLORREF *e);
BOOL APIENTRY DGL_SetPixelFormat(HDC a, int b, CONST PIXELFORMATDESCRIPTOR *c);
BOOL APIENTRY DGL_ShareLists(HGLRC a, HGLRC b);
BOOL APIENTRY DGL_SwapBuffers(HDC a);
BOOL APIENTRY DGL_SwapLayerBuffers(HDC a, UINT b);
BOOL APIENTRY DGL_UseFontBitmapsA(HDC a, DWORD b, DWORD c, DWORD d);
BOOL APIENTRY DGL_UseFontBitmapsW(HDC a, DWORD b, DWORD c, DWORD d);
BOOL APIENTRY DGL_UseFontOutlinesA(HDC a, DWORD b, DWORD c, DWORD d, FLOAT e, FLOAT f, int g, LPGLYPHMETRICSFLOAT h);
BOOL APIENTRY DGL_UseFontOutlinesW(HDC a, DWORD b, DWORD c, DWORD d, FLOAT e, FLOAT f, int g, LPGLYPHMETRICSFLOAT h);
#endif //_USE_GLD3_WGL
BOOL dglWglResizeBuffers(struct gl_context *ctx, BOOL bDefaultDriver);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,817 +0,0 @@
/****************************************************************************
*
* Mesa 3-D graphics library
* Direct3D Driver Interface
*
* ========================================================================
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* ======================================================================
*
* Language: ANSI C
* Environment: Windows 9x (Win32)
*
* Description: Win32 DllMain functions.
*
****************************************************************************/
// INITGUID must only be defined once.
// Don't put it in a shared header file!
// GLD3 uses dxguid.lib, so INITGUID must *not* be used!
#ifndef _USE_GLD3_WGL
#define INITGUID
#endif // _USE_GLD3_WGL
#include "dllmain.h"
//#include "snap/graphics.h"
//#include "drvlib/os/os.h"
#ifdef _USE_GLD3_WGL
typedef void (APIENTRY *LPDGLSPLASHSCREEN)(int, int, char*);
#include "gld_driver.h"
#endif
// ***********************************************************************
BOOL bInitialized = FALSE; // callback driver initialized?
BOOL bExited = FALSE; // callback driver exited this instance?
HINSTANCE hInstanceDll = NULL; // DLL instance handle
static BOOL bDriverValidated = FALSE; // prior validation status
static BOOL bSplashScreen = TRUE; // Splash Screen ?
static BOOL bValidINIFound = FALSE; // Have we found a valid INI file?
HHOOK hKeyHook = NULL; // global keyboard handler hook
// Multi-threaded support needs to be reflected in Mesa code. (DaveM)
int _gld_bMultiThreaded = FALSE;
// ***********************************************************************
DWORD dwLogging = 0; // Logging flag
DWORD dwDebugLevel = 0; // Log debug level
char szLogPath[_MAX_PATH] = {"\0"}; // Log file path
char szSNAPPath[_MAX_PATH] = {"\0"}; // SNAP driver path
#ifndef _USE_GLD3_WGL
DGL_wglFuncs wglFuncs = {
sizeof(DGL_wglFuncs),
DGL_ChoosePixelFormat,
DGL_CopyContext,
DGL_CreateContext,
DGL_CreateLayerContext,
DGL_DeleteContext,
DGL_DescribeLayerPlane,
DGL_DescribePixelFormat,
DGL_GetCurrentContext,
DGL_GetCurrentDC,
DGL_GetDefaultProcAddress,
DGL_GetLayerPaletteEntries,
DGL_GetPixelFormat,
DGL_GetProcAddress,
DGL_MakeCurrent,
DGL_RealizeLayerPalette,
DGL_SetLayerPaletteEntries,
DGL_SetPixelFormat,
DGL_ShareLists,
DGL_SwapBuffers,
DGL_SwapLayerBuffers,
DGL_UseFontBitmapsA,
DGL_UseFontBitmapsW,
DGL_UseFontOutlinesA,
DGL_UseFontOutlinesW,
};
DGL_mesaFuncs mesaFuncs = {
sizeof(DGL_mesaFuncs),
};
#endif // _USE_GLD3_WGL
// ***********************************************************************
typedef struct {
DWORD dwDriver; // 0=SciTech SW, 1=Direct3D SW, 2=Direct3D HW
BOOL bMipmapping; // 0=off, 1=on
BOOL bMultitexture; // 0=off, 1=on
BOOL bWaitForRetrace; // 0=off, 1=on
BOOL bFullscreenBlit; // 0=off, 1=on
BOOL bFastFPU; // 0=off, 1=on
BOOL bDirectDrawPersistant;// 0=off, 1=on
BOOL bPersistantBuffers; // 0=off, 1=on
DWORD dwLogging; // 0=off, 1=normal, 2=crash-proof
DWORD dwLoggingSeverity; // 0=all, 1=warnings+errors, 2=errors only
BOOL bMessageBoxWarnings;// 0=off, 1=on
BOOL bMultiThreaded; // 0=off, 1=on
BOOL bAppCustomizations; // 0=off, 1=on
BOOL bHotKeySupport; // 0=off, 1=on
BOOL bSplashScreen; // 0=off, 1=on
#ifdef _USE_GLD3_WGL
//
// New for GLDirect 3.0
//
DWORD dwAdapter; // DX8 adpater ordinal
DWORD dwTnL; // Transform & Lighting type
DWORD dwMultisample; // DX8 multisample type
#endif // _USE_GLD3_WGL
} INI_settings;
static INI_settings ini;
// ***********************************************************************
BOOL APIENTRY DGL_initDriver(
#ifdef _USE_GLD3_WGL
void)
{
#else
DGL_wglFuncs *lpWglFuncs,
DGL_mesaFuncs *lpMesaFuncs)
{
// Check for valid pointers
if ((lpWglFuncs == NULL) || (lpMesaFuncs == NULL))
return FALSE;
// Check for valid structs
if (lpWglFuncs->dwSize != sizeof(DGL_wglFuncs)) {
return FALSE;
}
// Check for valid structs
if (lpMesaFuncs->dwSize != sizeof(DGL_mesaFuncs)) {
return FALSE;
}
// Copy the Mesa functions
memcpy(&mesaFuncs, lpMesaFuncs, sizeof(DGL_mesaFuncs));
// Pass back the wgl functions
memcpy(lpWglFuncs, &wglFuncs, sizeof(DGL_wglFuncs));
#endif // _USE_GLD3_WGL
// Finally initialize the callback driver
if (!dglInitDriver())
return FALSE;
return TRUE;
};
// ***********************************************************************
BOOL ReadINIFile(
HINSTANCE hInstance)
{
char szModuleFilename[MAX_PATH];
char szSystemDirectory[MAX_PATH];
const char szSectionName[] = "Config";
char szINIFile[MAX_PATH];
int pos;
// Now using the DLL module handle. KeithH, 24/May/2000.
// Addendum: GetModuleFileName(NULL, ... returns process filename,
// GetModuleFileName(hModule, ... returns DLL filename,
// Get the dll path and filename.
GetModuleFileName(hInstance, &szModuleFilename[0], MAX_PATH); // NULL for current process
// Get the System directory.
GetSystemDirectory(&szSystemDirectory[0], MAX_PATH);
// Test to see if DLL is in system directory.
if (strnicmp(szModuleFilename, szSystemDirectory, strlen(szSystemDirectory))==0) {
// DLL *is* in system directory.
// Return FALSE to indicate that registry keys should be read.
return FALSE;
}
// Compose filename of INI file
strcpy(szINIFile, szModuleFilename);
pos = strlen(szINIFile);
while (szINIFile[pos] != '\\') {
pos--;
}
szINIFile[pos+1] = '\0';
// Use run-time DLL path for log file too
strcpy(szLogPath, szINIFile);
szLogPath[pos] = '\0';
// Complete full INI file path
strcat(szINIFile, "gldirect.ini");
// Read settings from private INI file.
// Note that defaults are contained in the calls.
ini.dwDriver = GetPrivateProfileInt(szSectionName, "dwDriver", 2, szINIFile);
ini.bMipmapping = GetPrivateProfileInt(szSectionName, "bMipmapping", 1, szINIFile);
ini.bMultitexture = GetPrivateProfileInt(szSectionName, "bMultitexture", 1, szINIFile);
ini.bWaitForRetrace = GetPrivateProfileInt(szSectionName, "bWaitForRetrace", 0, szINIFile);
ini.bFullscreenBlit = GetPrivateProfileInt(szSectionName, "bFullscreenBlit", 0, szINIFile);
ini.bFastFPU = GetPrivateProfileInt(szSectionName, "bFastFPU", 1, szINIFile);
ini.bDirectDrawPersistant = GetPrivateProfileInt(szSectionName, "bPersistantDisplay", 0, szINIFile);
ini.bPersistantBuffers = GetPrivateProfileInt(szSectionName, "bPersistantResources", 0, szINIFile);
ini.dwLogging = GetPrivateProfileInt(szSectionName, "dwLogging", 0, szINIFile);
ini.dwLoggingSeverity = GetPrivateProfileInt(szSectionName, "dwLoggingSeverity", 0, szINIFile);
ini.bMessageBoxWarnings = GetPrivateProfileInt(szSectionName, "bMessageBoxWarnings", 0, szINIFile);
ini.bMultiThreaded = GetPrivateProfileInt(szSectionName, "bMultiThreaded", 0, szINIFile);
ini.bAppCustomizations = GetPrivateProfileInt(szSectionName, "bAppCustomizations", 1, szINIFile);
ini.bHotKeySupport = GetPrivateProfileInt(szSectionName, "bHotKeySupport", 0, szINIFile);
ini.bSplashScreen = GetPrivateProfileInt(szSectionName, "bSplashScreen", 1, szINIFile);
#ifdef _USE_GLD3_WGL
// New for GLDirect 3.x
ini.dwAdapter = GetPrivateProfileInt(szSectionName, "dwAdapter", 0, szINIFile);
// dwTnL now defaults to zero (chooses TnL at runtime). KeithH
ini.dwTnL = GetPrivateProfileInt(szSectionName, "dwTnL", 0, szINIFile);
ini.dwMultisample = GetPrivateProfileInt(szSectionName, "dwMultisample", 0, szINIFile);
#endif
return TRUE;
}
// ***********************************************************************
BOOL dllReadRegistry(
HINSTANCE hInstance)
{
// Read settings from INI file, if available
bValidINIFound = FALSE;
if (ReadINIFile(hInstance)) {
const char *szRendering[3] = {
"SciTech Software Renderer",
"Direct3D MMX Software Renderer",
"Direct3D Hardware Renderer"
};
// Set globals
glb.bPrimary = 1;
glb.bHardware = (ini.dwDriver == 2) ? 1 : 0;
#ifndef _USE_GLD3_WGL
memset(&glb.ddGuid, 0, sizeof(glb.ddGuid));
glb.d3dGuid = (ini.dwDriver == 2) ? IID_IDirect3DHALDevice : IID_IDirect3DRGBDevice;
#endif // _USE_GLD3_WGL
strcpy(glb.szDDName, "Primary");
strcpy(glb.szD3DName, szRendering[ini.dwDriver]);
glb.dwRendering = ini.dwDriver;
glb.bUseMipmaps = ini.bMipmapping;
glb.bMultitexture = ini.bMultitexture;
glb.bWaitForRetrace = ini.bWaitForRetrace;
glb.bFullscreenBlit = ini.bFullscreenBlit;
glb.bFastFPU = ini.bFastFPU;
glb.bDirectDrawPersistant = ini.bDirectDrawPersistant;
glb.bPersistantBuffers = ini.bPersistantBuffers;
dwLogging = ini.dwLogging;
dwDebugLevel = ini.dwLoggingSeverity;
glb.bMessageBoxWarnings = ini.bMessageBoxWarnings;
glb.bMultiThreaded = ini.bMultiThreaded;
glb.bAppCustomizations = ini.bAppCustomizations;
glb.bHotKeySupport = ini.bHotKeySupport;
bSplashScreen = ini.bSplashScreen;
#ifdef _USE_GLD3_WGL
// New for GLDirect 3.x
glb.dwAdapter = ini.dwAdapter;
glb.dwDriver = ini.dwDriver;
glb.dwTnL = ini.dwTnL;
glb.dwMultisample = ini.dwMultisample;
#endif
bValidINIFound = TRUE;
return TRUE;
}
// Read settings from registry
else {
HKEY hReg;
DWORD cbValSize;
DWORD dwType = REG_SZ; // Registry data type for strings
BOOL bRegistryError;
BOOL bSuccess;
#define REG_READ_DWORD(a, b) \
cbValSize = sizeof(b); \
if (ERROR_SUCCESS != RegQueryValueEx( hReg, (a), \
NULL, NULL, (LPBYTE)&(b), &cbValSize )) \
bRegistryError = TRUE;
#define REG_READ_DEVICEID(a, b) \
cbValSize = MAX_DDDEVICEID_STRING; \
if(ERROR_SUCCESS != RegQueryValueEx(hReg, (a), 0, &dwType, \
(LPBYTE)&(b), &cbValSize)) \
bRegistryError = TRUE;
#define REG_READ_STRING(a, b) \
cbValSize = sizeof((b)); \
if(ERROR_SUCCESS != RegQueryValueEx(hReg, (a), 0, &dwType, \
(LPBYTE)&(b), &cbValSize)) \
bRegistryError = TRUE;
// Read settings from the registry.
// Open the registry key for the current user if it exists.
bSuccess = (ERROR_SUCCESS == RegOpenKeyEx(HKEY_CURRENT_USER,
DIRECTGL_REG_SETTINGS_KEY,
0,
KEY_READ,
&hReg));
// Otherwise open the registry key for the local machine.
if (!bSuccess)
bSuccess = (ERROR_SUCCESS == RegOpenKeyEx(DIRECTGL_REG_KEY_ROOT,
DIRECTGL_REG_SETTINGS_KEY,
0,
KEY_READ,
&hReg));
if (!bSuccess)
return FALSE;
bRegistryError = FALSE;
REG_READ_DWORD(DIRECTGL_REG_SETTING_PRIMARY, glb.bPrimary);
REG_READ_DWORD(DIRECTGL_REG_SETTING_D3D_HW, glb.bHardware);
#ifndef _USE_GLD3_WGL
REG_READ_DWORD(DIRECTGL_REG_SETTING_DD_GUID, glb.ddGuid);
REG_READ_DWORD(DIRECTGL_REG_SETTING_D3D_GUID, glb.d3dGuid);
#endif // _USE_GLD3_WGL
REG_READ_DWORD(DIRECTGL_REG_SETTING_LOGGING, dwLogging);
REG_READ_DWORD(DIRECTGL_REG_SETTING_DEBUGLEVEL, dwDebugLevel);
REG_READ_DWORD(DIRECTGL_REG_SETTING_RENDERING, glb.dwRendering);
REG_READ_DWORD(DIRECTGL_REG_SETTING_MULTITEXTURE, glb.bMultitexture);
REG_READ_DWORD(DIRECTGL_REG_SETTING_WAITFORRETRACE, glb.bWaitForRetrace);
REG_READ_DWORD(DIRECTGL_REG_SETTING_FULLSCREENBLIT, glb.bFullscreenBlit);
REG_READ_DWORD(DIRECTGL_REG_SETTING_USEMIPMAPS, glb.bUseMipmaps);
REG_READ_DEVICEID(DIRECTGL_REG_SETTING_DD_NAME, glb.szDDName);
REG_READ_DEVICEID(DIRECTGL_REG_SETTING_D3D_NAME, glb.szD3DName);
REG_READ_DWORD(DIRECTGL_REG_SETTING_MSGBOXWARNINGS, glb.bMessageBoxWarnings);
REG_READ_DWORD(DIRECTGL_REG_SETTING_PERSISTDISPLAY, glb.bDirectDrawPersistant);
REG_READ_DWORD(DIRECTGL_REG_SETTING_PERSISTBUFFERS, glb.bPersistantBuffers);
REG_READ_DWORD(DIRECTGL_REG_SETTING_FASTFPU, glb.bFastFPU);
REG_READ_DWORD(DIRECTGL_REG_SETTING_HOTKEYS, glb.bHotKeySupport);
REG_READ_DWORD(DIRECTGL_REG_SETTING_MULTITHREAD, glb.bMultiThreaded);
REG_READ_DWORD(DIRECTGL_REG_SETTING_APPCUSTOM, glb.bAppCustomizations);
REG_READ_DWORD(DIRECTGL_REG_SETTING_SPLASHSCREEN, bSplashScreen);
#ifdef _USE_GLD3_WGL
// New for GLDirect 3.x
glb.dwDriver = glb.dwRendering;
REG_READ_DWORD(DIRECTGL_REG_SETTING_ADAPTER, glb.dwAdapter);
REG_READ_DWORD(DIRECTGL_REG_SETTING_TNL, glb.dwTnL);
REG_READ_DWORD(DIRECTGL_REG_SETTING_MULTISAMPLE, glb.dwMultisample);
#endif
RegCloseKey(hReg);
// Open the global registry key for GLDirect
bSuccess = (ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE,
DIRECTGL_REG_SETTINGS_KEY,
0,
KEY_READ,
&hReg));
if (bSuccess) {
// Read the installation path for GLDirect
REG_READ_STRING("InstallLocation",szLogPath);
RegCloseKey(hReg);
}
if (bRegistryError || !bSuccess)
return FALSE;
else
return TRUE;
#undef REG_READ_DWORD
#undef REG_READ_DEVICEID
#undef REG_READ_STRING
}
}
// ***********************************************************************
BOOL dllWriteRegistry(
void )
{
HKEY hReg;
DWORD dwCreateDisposition, cbValSize;
BOOL bRegistryError = FALSE;
#define REG_WRITE_DWORD(a, b) \
cbValSize = sizeof(b); \
if (ERROR_SUCCESS != RegSetValueEx( hReg, (a), \
0, REG_DWORD, (LPBYTE)&(b), cbValSize )) \
bRegistryError = TRUE;
if (ERROR_SUCCESS == RegCreateKeyEx( DIRECTGL_REG_KEY_ROOT, DIRECTGL_REG_SETTINGS_KEY,
0, NULL, 0, KEY_WRITE, NULL, &hReg,
&dwCreateDisposition )) {
RegFlushKey(hReg); // Make sure keys are written to disk
RegCloseKey(hReg);
hReg = NULL;
}
if (bRegistryError)
return FALSE;
else
return TRUE;
#undef REG_WRITE_DWORD
}
// ***********************************************************************
void dglInitHotKeys(HINSTANCE hInstance)
{
// Hot-Key support at all?
if (!glb.bHotKeySupport)
return;
// Install global keyboard interceptor
hKeyHook = SetWindowsHookEx(WH_KEYBOARD, dglKeyProc, hInstance, 0);
}
// ***********************************************************************
void dglExitHotKeys(void)
{
// Hot-Key support at all?
if (!glb.bHotKeySupport)
return;
// Remove global keyboard interceptor
if (hKeyHook)
UnhookWindowsHookEx(hKeyHook);
hKeyHook = NULL;
}
// ***********************************************************************
// Note: This app-customization step must be performed in both the main
// OpenGL32 driver and the callback driver DLLs for multithreading option.
void dglSetAppCustomizations(void)
{
char szModuleFileName[MAX_PATH];
int iSize = MAX_PATH;
// Get the currently loaded EXE filename.
GetModuleFileName(NULL, &szModuleFileName[0], MAX_PATH); // NULL for current process
strupr(szModuleFileName);
iSize = strlen(szModuleFileName);
// Check for specific EXEs and adjust global settings accordingly
// NOTE: In GLD3.x "bDirectDrawPersistant" corresponds to IDirect3D8 and
// "bPersistantBuffers" corresponds to IDirect3DDevice8. KeithH
// Case 1: 3DStudio must be multi-threaded
// Added: Discreet GMAX (3DStudio MAX 4 for gamers. KeithH)
if (strstr(szModuleFileName, "3DSMAX.EXE")
|| strstr(szModuleFileName, "3DSVIZ.EXE")
|| strstr(szModuleFileName, "GMAX.EXE")) {
glb.bMultiThreaded = TRUE;
glb.bDirectDrawPersistant = FALSE;
glb.bPersistantBuffers = FALSE;
return;
}
// Case 2: Solid Edge must use pre-allocated resources for all GLRCs
if (strstr(szModuleFileName, "PART.EXE")
|| strstr(szModuleFileName, "ASSEMBL.EXE")
|| strstr(szModuleFileName, "DRAFT.EXE")
|| strstr(szModuleFileName, "SMARTVW.EXE")
|| strstr(szModuleFileName, "SMETAL.EXE")) {
glb.bMultiThreaded = FALSE;
glb.bDirectDrawPersistant = TRUE;
glb.bPersistantBuffers = FALSE;
return;
}
// Case 3: Sudden Depth creates and destroys GLRCs on paint commands
if (strstr(szModuleFileName, "SUDDEPTH.EXE")
|| strstr(szModuleFileName, "SUDDEMO.EXE")) {
glb.bMultiThreaded = FALSE;
glb.bDirectDrawPersistant = TRUE;
glb.bPersistantBuffers = TRUE;
glb.bFullscreenBlit = TRUE;
return;
}
// Case 4: StereoGraphics test apps create and destroy GLRCs on paint commands
if (strstr(szModuleFileName, "REDBLUE.EXE")
|| strstr(szModuleFileName, "DIAGNOSE.EXE")) {
glb.bMultiThreaded = FALSE;
glb.bDirectDrawPersistant = TRUE;
glb.bPersistantBuffers = TRUE;
return;
}
// Case 5: Pipes screen savers share multiple GLRCs for same window
if (strstr(szModuleFileName, "PIPES.SCR")
|| (strstr(szModuleFileName, "PIPES") && strstr(szModuleFileName, ".SCR"))) {
glb.bMultiThreaded = FALSE;
glb.bDirectDrawPersistant = TRUE;
glb.bPersistantBuffers = TRUE;
return;
}
// Case 6: AutoVue uses sub-viewport ops which are temporarily broken in stereo window
if (strstr(szModuleFileName, "AVWIN.EXE")) {
glb.bMultiThreaded = FALSE;
glb.bDirectDrawPersistant = TRUE;
glb.bPersistantBuffers = TRUE;
return;
}
// Case 7: Quake3 is waiting for DDraw objects to be released at exit
if (strstr(szModuleFileName, "QUAKE")) {
glb.bMultiThreaded = FALSE;
glb.bDirectDrawPersistant = FALSE;
glb.bPersistantBuffers = FALSE;
glb.bFullscreenBlit = FALSE;
return;
}
// Case 8: Reflection GLX server is unable to switch contexts at run-time
if (strstr(szModuleFileName, "RX.EXE")) {
glb.bMultiThreaded = FALSE;
glb.bMessageBoxWarnings = FALSE;
return;
}
// Case 9: Original AutoCAD 2000 must share DDraw objects across GLRCs
if (strstr(szModuleFileName, "ACAD.EXE")) {
glb.bFastFPU = FALSE;
if (GetModuleHandle("wopengl6.hdi") != NULL) {
glb.bMultiThreaded = FALSE;
glb.bDirectDrawPersistant = TRUE;
glb.bPersistantBuffers = FALSE;
}
return;
}
}
// ***********************************************************************
BOOL dglInitDriver(void)
{
UCHAR szExeName[MAX_PATH];
const char *szRendering[] = {
"Mesa Software",
"Direct3D RGB SW",
"Direct3D HW",
};
static BOOL bWarnOnce = FALSE;
// Already initialized?
if (bInitialized)
return TRUE;
// Moved from DllMain DLL_PROCESS_ATTACH:
// (Re-)Init defaults
dglInitGlobals();
// Read registry or INI file settings
if (!dllReadRegistry(hInstanceDll)) {
if (!bWarnOnce)
MessageBox( NULL, "GLDirect has not been configured.\n\n"
"Please run the configuration program\n"
"before using GLDirect with applications.\n",
"GLDirect", MB_OK | MB_ICONWARNING);
bWarnOnce = TRUE;
return FALSE;
}
#ifdef _USE_GLD3_WGL
// Must do this as early as possible.
// Need to read regkeys/ini-file first though.
gldInitDriverPointers(glb.dwDriver);
// Create private driver globals
_gldDriver.CreatePrivateGlobals();
#endif
// Overide settings with application customizations
if (glb.bAppCustomizations)
dglSetAppCustomizations();
//#ifndef _USE_GLD3_WGL
// Set the global memory type to either sysmem or vidmem
glb.dwMemoryType = glb.bHardware ? DDSCAPS_VIDEOMEMORY : DDSCAPS_SYSTEMMEMORY;
//#endif
// Multi-threaded support overides persistant display support
if (glb.bMultiThreaded)
glb.bDirectDrawPersistant = glb.bPersistantBuffers = FALSE;
// Multi-threaded support needs to be reflected in Mesa code. (DaveM)
_gld_bMultiThreaded = glb.bMultiThreaded;
// Start logging
ddlogPathOption(szLogPath);
ddlogWarnOption(glb.bMessageBoxWarnings);
ddlogOpen((DDLOG_loggingMethodType)dwLogging,
(DDLOG_severityType)dwDebugLevel);
// Obtain the name of the calling app
ddlogMessage(DDLOG_SYSTEM, "Driver : SciTech GLDirect 4.0\n");
GetModuleFileName(NULL, szExeName, sizeof(szExeName));
ddlogPrintf(DDLOG_SYSTEM, "Executable : %s", szExeName);
ddlogPrintf(DDLOG_SYSTEM, "DirectDraw device: %s", glb.szDDName);
ddlogPrintf(DDLOG_SYSTEM, "Direct3D driver : %s", glb.szD3DName);
ddlogPrintf(DDLOG_SYSTEM, "Rendering type : %s", szRendering[glb.dwRendering]);
ddlogPrintf(DDLOG_SYSTEM, "Multithreaded : %s", glb.bMultiThreaded ? "Enabled" : "Disabled");
ddlogPrintf(DDLOG_SYSTEM, "Display resources: %s", glb.bDirectDrawPersistant ? "Persistant" : "Instanced");
ddlogPrintf(DDLOG_SYSTEM, "Buffer resources : %s", glb.bPersistantBuffers ? "Persistant" : "Instanced");
dglInitContextState();
dglBuildPixelFormatList();
//dglBuildTextureFormatList();
// D3D callback driver is now successfully initialized
bInitialized = TRUE;
// D3D callback driver is now ready to be exited
bExited = FALSE;
return TRUE;
}
// ***********************************************************************
void dglExitDriver(void)
{
// Only need to clean up once per instance:
// May be called implicitly from DLL_PROCESS_DETACH,
// or explicitly from DGL_exitDriver().
if (bExited)
return;
bExited = TRUE;
// DDraw objects may be invalid when DLL unloads.
__try {
// Clean-up sequence (moved from DLL_PROCESS_DETACH)
#ifndef _USE_GLD3_WGL
dglReleaseTextureFormatList();
#endif
dglReleasePixelFormatList();
dglDeleteContextState();
#ifdef _USE_GLD3_WGL
_gldDriver.DestroyPrivateGlobals();
#endif
}
__except(EXCEPTION_EXECUTE_HANDLER) {
ddlogPrintf(DDLOG_WARN, "Exception raised in dglExitDriver.");
}
// Close the log file
ddlogClose();
}
// ***********************************************************************
int WINAPI DllMain(
HINSTANCE hInstance,
DWORD fdwReason,
PVOID pvReserved)
{
switch (fdwReason) {
case DLL_PROCESS_ATTACH:
// Cache DLL instance handle
hInstanceDll = hInstance;
// Flag that callback driver has yet to be initialized
bInitialized = bExited = FALSE;
#ifndef _USE_GLD3_WGL
// Init internal Mesa function pointers
memset(&mesaFuncs, 0, sizeof(DGL_mesaFuncs));
#endif // _USE_GLD3_WGL
// Init defaults
dglInitGlobals();
// Defer rest of DLL initialization to 1st WGL function call
break;
case DLL_PROCESS_DETACH:
// Call exit clean-up sequence
dglExitDriver();
break;
}
return TRUE;
}
// ***********************************************************************
void APIENTRY DGL_exitDriver(void)
{
// Call exit clean-up sequence
dglExitDriver();
}
// ***********************************************************************
void APIENTRY DGL_reinitDriver(void)
{
// Force init sequence again
bInitialized = bExited = FALSE;
dglInitDriver();
}
// ***********************************************************************
int WINAPI DllInitialize(
HINSTANCE hInstance,
DWORD fdwReason,
PVOID pvReserved)
{
// Some Watcom compiled executables require this.
return DllMain(hInstance, fdwReason, pvReserved);
}
// ***********************************************************************
void DGL_LoadSplashScreen(int piReg, char* pszUser)
{
HINSTANCE hSplashDll = NULL;
LPDGLSPLASHSCREEN dglSplashScreen = NULL;
static BOOL bOnce = FALSE;
static int iReg = 0;
static char szUser[255] = {"\0"};
// Display splash screen at all?
if (!bSplashScreen)
return;
// Only display splash screen once
if (bOnce)
return;
bOnce = TRUE;
// Make local copy of string for passing to DLL
if (pszUser)
strcpy(szUser, pszUser);
iReg = piReg;
// Load Splash Screen DLL
// (If it fails to load for any reason, we don't care...)
hSplashDll = LoadLibrary("gldsplash.dll");
if (hSplashDll) {
// Execute the Splash Screen function
dglSplashScreen = (LPDGLSPLASHSCREEN)GetProcAddress(hSplashDll, "GLDSplashScreen");
if (dglSplashScreen)
(*dglSplashScreen)(1, iReg, szUser);
// Don't unload the DLL since splash screen dialog is modeless now
}
}
// ***********************************************************************
BOOL dglValidate()
{
char *szCaption = "SciTech GLDirect Driver";
UINT uType = MB_OK | MB_ICONEXCLAMATION;
#ifdef _USE_GLD3_WGL
// (Re)build pixelformat list
if (glb.bPixelformatsDirty)
_gldDriver.BuildPixelformatList();
#endif
// Check to see if we have already validated
if (bDriverValidated && bInitialized)
return TRUE;
// Since all (most) the WGL functions must be validated at this point,
// this also insure that the callback driver is completely initialized.
if (!bInitialized)
if (!dglInitDriver()) {
MessageBox(NULL,
"The GLDirect driver could not initialize.\n\n"
"Please run the configuration program to\n"
"properly configure the driver, or else\n"
"re-run the installation program.", szCaption, uType);
_exit(1); // Bail
}
return TRUE;
}
// ***********************************************************************

View file

@ -1,64 +0,0 @@
/****************************************************************************
*
* Mesa 3-D graphics library
* Direct3D Driver Interface
*
* ========================================================================
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* ======================================================================
*
* Language: ANSI C
* Environment: Windows 9x (Win32)
*
* Description: Win32 DllMain functions.
*
****************************************************************************/
#ifndef __DLLMAIN_H
#define __DLLMAIN_H
// Macros to control compilation
#define STRICT
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#ifndef _USE_GLD3_WGL
#include "DirectGL.h"
#endif // _USE_GLD3_WGL
//#include "gldirect/regkeys.h"
#include "dglglobals.h"
#include "ddlog.h"
#ifndef _USE_GLD3_WGL
#include "d3dtexture.h"
#endif // _USE_GLD3_WGL
#include "dglwgl.h"
extern BOOL bInitialized;
BOOL dglInitDriver(void);
void dglExitDriver(void);
#endif

File diff suppressed because it is too large Load diff

View file

@ -1,292 +0,0 @@
/****************************************************************************
*
* Mesa 3-D graphics library
* Direct3D Driver Interface
*
* ========================================================================
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* ======================================================================
*
* Language: ANSI C
* Environment: Windows 9x/2000/XP/XBox (Win32)
*
* Description: GLDirect Direct3D 7.0a header file
*
****************************************************************************/
#ifndef _GLD_DX7_H
#define _GLD_DX7_H
//---------------------------------------------------------------------------
// Windows includes
//---------------------------------------------------------------------------
#define DIRECTDRAW_VERSION 0x0700
#define DIRECT3D_VERSION 0x0700
#include <d3d.h>
#include <d3dx.h>
// Typedef for obtaining function from d3d7.dll
//typedef IDirect3D7* (WINAPI *FNDIRECT3DCREATE7) (UINT);
//---------------------------------------------------------------------------
// Defines
//---------------------------------------------------------------------------
#ifdef _DEBUG
// Debug build tests the return value of D3D calls
#define _GLD_TEST_HRESULT(h) \
{ \
HRESULT _hr = (h); \
if (FAILED(_hr)) { \
gldLogError(GLDLOG_ERROR, #h, _hr); \
} \
}
#define _GLD_DX7(func) _GLD_TEST_HRESULT(IDirect3D7_##func##)
#define _GLD_DX7_DEV(func) _GLD_TEST_HRESULT(IDirect3DDevice7_##func##)
#define _GLD_DX7_VB(func) _GLD_TEST_HRESULT(IDirect3DVertexBuffer7_##func##)
#define _GLD_DX7_TEX(func) _GLD_TEST_HRESULT(IDirectDrawSurface7_##func##)
#else
#define _GLD_DX7(func) IDirect3D7_##func
#define _GLD_DX7_DEV(func) IDirect3DDevice7_##func
#define _GLD_DX7_VB(func) IDirect3DVertexBuffer7_##func
#define _GLD_DX7_TEX(func) IDirectDrawSurface7_##func
#endif
#define SAFE_RELEASE(p) \
{ \
if (p) { \
(p)->lpVtbl->Release(p); \
(p) = NULL; \
} \
}
#define SAFE_RELEASE_VB7(p) \
{ \
if (p) { \
IDirect3DVertexBuffer7_Release((p)); \
(p) = NULL; \
} \
}
#define SAFE_RELEASE_SURFACE7(p) \
{ \
if (p) { \
IDirectDrawSurface7_Release((p)); \
(p) = NULL; \
} \
}
// Emulate some DX8 defines
#define D3DCOLOR_ARGB(a,r,g,b) ((D3DCOLOR)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff)))
#define D3DCOLOR_RGBA(r,g,b,a) D3DCOLOR_ARGB(a,r,g,b)
#define D3DCOLOR_COLORVALUE(r,g,b,a) D3DCOLOR_RGBA((DWORD)((r)*255.f),(DWORD)((g)*255.f),(DWORD)((b)*255.f),(DWORD)((a)*255.f))
// Setup index.
enum {
GLD_SI_FLAT = 0,
GLD_SI_SMOOTH = 1,
GLD_SI_FLAT_EXTRAS = 2,
GLD_SI_SMOOTH_EXTRAS = 3,
};
//---------------------------------------------------------------------------
// Vertex definitions for Fixed-Function pipeline
//---------------------------------------------------------------------------
//
// NOTE: If the number of texture units is altered then most of
// the texture code will need to be revised.
//
#define GLD_MAX_TEXTURE_UNITS_DX7 2
//
// 2D vertex transformed by Mesa
//
#define GLD_FVF_2D_VERTEX ( D3DFVF_XYZRHW | \
D3DFVF_DIFFUSE | \
D3DFVF_SPECULAR | \
D3DFVF_TEX2)
typedef struct {
FLOAT x, y; // 2D raster coords
FLOAT sz; // Screen Z (depth)
FLOAT rhw; // Reciprocal homogenous W
DWORD diffuse; // Diffuse colour
DWORD specular; // For separate-specular support
FLOAT t0_u, t0_v; // 1st set of texture coords
FLOAT t1_u, t1_v; // 2nd set of texture coords
} GLD_2D_VERTEX;
//
// 3D vertex transformed by Direct3D
//
#define GLD_FVF_3D_VERTEX ( D3DFVF_XYZ | \
D3DFVF_DIFFUSE | \
D3DFVF_TEX2)
typedef struct {
D3DXVECTOR3 Position; // XYZ Vector in object space
D3DCOLOR Diffuse; // Diffuse colour
D3DXVECTOR2 TexUnit0; // Texture unit 0
D3DXVECTOR2 TexUnit1; // Texture unit 1
} GLD_3D_VERTEX;
//---------------------------------------------------------------------------
// Structs
//---------------------------------------------------------------------------
// This keeps a count of how many times we choose each individual internal
// pathway. Useful for seeing if a certain pathway was ever used by an app, and
// how much each pathway is biased.
// Zero the members at context creation and dump stats at context deletion.
typedef struct {
// Note: DWORD is probably too small
ULARGE_INTEGER qwMesa; // Mesa TnL pipeline
ULARGE_INTEGER qwD3DFVF; // Direct3D Fixed-Function pipeline
} GLD_pipeline_usage;
// GLDirect Primitive Buffer (points, lines, triangles and quads)
typedef struct {
// Data for IDirect3D7::CreateVertexBuffer()
DWORD dwStride; // Stride of vertex
DWORD dwCreateFlags; // Create flags
DWORD dwFVF; // Direct3D Flexible Vertex Format
IDirect3DVertexBuffer7 *pVB; // Holds points, lines, tris and quads.
// Point list is assumed to be at start of buffer
DWORD iFirstLine; // Index of start of line list
DWORD iFirstTriangle; // Index of start of triangle list
BYTE *pPoints; // Pointer to next free point
BYTE *pLines; // Pointer to next free line
BYTE *pTriangles; // Pointer to next free triangle
DWORD nPoints; // Number of points ready to render
DWORD nLines; // Number of lines ready to render
DWORD nTriangles; // Number of triangles ready to render
} GLD_pb_dx7;
// GLDirect DX7 driver data
typedef struct {
// GLDirect vars
BOOL bDoublebuffer; // Doublebuffer (otherwise single-buffered)
BOOL bDepthStencil; // Depth buffer needed (stencil optional)
D3DX_SURFACEFORMAT RenderFormat; // Format of back/front buffer
D3DX_SURFACEFORMAT DepthFormat; // Format of depth/stencil
// Direct3D vars
DDCAPS ddCaps;
D3DDEVICEDESC7 d3dCaps;
BOOL bHasHWTnL; // Device has Hardware Transform/Light?
ID3DXContext *pD3DXContext; // Base D3DX context
IDirectDraw7 *pDD; // DirectDraw7 interface
IDirect3D7 *pD3D; // Base Direct3D7 interface
IDirect3DDevice7 *pDev; // Direct3D7 Device interface
GLD_pb_dx7 PB2d; // Vertices transformed by Mesa
GLD_pb_dx7 PB3d; // Vertices transformed by Direct3D
D3DPRIMITIVETYPE d3dpt; // Current Direct3D primitive type
D3DMATRIX matProjection; // Projection matrix for D3D TnL
D3DMATRIX matModelView; // Model/View matrix for D3D TnL
int iSetupFunc; // Which setup functions to use
BOOL bUseMesaTnL; // Whether to use Mesa or D3D for TnL
GLD_pipeline_usage PipelineUsage;
} GLD_driver_dx7;
#define GLD_GET_DX7_DRIVER(c) (GLD_driver_dx7*)(c)->glPriv
//---------------------------------------------------------------------------
// Function prototypes
//---------------------------------------------------------------------------
PROC gldGetProcAddress_DX7(LPCSTR a);
void gldEnableExtensions_DX7(struct gl_context *ctx);
void gldInstallPipeline_DX7(struct gl_context *ctx);
void gldSetupDriverPointers_DX7(struct gl_context *ctx);
void gldResizeBuffers_DX7(struct gl_framebuffer *fb);
// Texture functions
void gldCopyTexImage1D_DX7(struct gl_context *ctx, GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border);
void gldCopyTexImage2D_DX7(struct gl_context *ctx, GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
void gldCopyTexSubImage1D_DX7(struct gl_context *ctx, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width );
void gldCopyTexSubImage2D_DX7(struct gl_context *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height );
void gldCopyTexSubImage3D_DX7(struct gl_context *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height );
void gld_NEW_TEXTURE_DX7(struct gl_context *ctx);
void gld_DrawPixels_DX7(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels);
void gld_ReadPixels_DX7(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, const struct gl_pixelstore_attrib *unpack, GLvoid *dest);
void gld_CopyPixels_DX7(struct gl_context *ctx, GLint srcx, GLint srcy, GLsizei width, GLsizei height, GLint dstx, GLint dsty, GLenum type);
void gld_Bitmap_DX7(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei height, const struct gl_pixelstore_attrib *unpack, const GLubyte *bitmap);
const struct gl_texture_format* gld_ChooseTextureFormat_DX7(struct gl_context *ctx, GLint internalFormat, GLenum srcFormat, GLenum srcType);
void gld_TexImage2D_DX7(struct gl_context *ctx, GLenum target, GLint level, GLint internalFormat, GLint width, GLint height, GLint border, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *tObj, struct gl_texture_image *texImage);
void gld_TexImage1D_DX7(struct gl_context *ctx, GLenum target, GLint level, GLint internalFormat, GLint width, GLint border, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage );
void gld_TexSubImage2D_DX7( struct gl_context *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage );
void gld_TexSubImage1D_DX7(struct gl_context *ctx, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage);
void gld_DeleteTexture_DX7(struct gl_context *ctx, struct gl_texture_object *tObj);
void gld_ResetLineStipple_DX7(struct gl_context *ctx);
// 2D primitive functions
void gld_Points2D_DX7(struct gl_context *ctx, GLuint first, GLuint last);
void gld_Line2DFlat_DX7(struct gl_context *ctx, GLuint v0, GLuint v1);
void gld_Line2DSmooth_DX7(struct gl_context *ctx, GLuint v0, GLuint v1);
void gld_Triangle2DFlat_DX7(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
void gld_Triangle2DSmooth_DX7(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
void gld_Triangle2DFlatExtras_DX7(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
void gld_Triangle2DSmoothExtras_DX7(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
void gld_Quad2DFlat_DX7(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
void gld_Quad2DSmooth_DX7(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
void gld_Quad2DFlatExtras_DX7(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
void gld_Quad2DSmoothExtras_DX7(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
// 3D primitive functions
void gld_Points3D_DX7(struct gl_context *ctx, GLuint first, GLuint last);
void gld_Line3DFlat_DX7(struct gl_context *ctx, GLuint v0, GLuint v1);
void gld_Triangle3DFlat_DX7(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
void gld_Quad3DFlat_DX7(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
void gld_Line3DSmooth_DX7(struct gl_context *ctx, GLuint v0, GLuint v1);
void gld_Triangle3DSmooth_DX7(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
void gld_Quad3DSmooth_DX7(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
// Primitive functions for Two-sided-lighting Vertex Shader
void gld_Points2DTwoside_DX7(struct gl_context *ctx, GLuint first, GLuint last);
void gld_Line2DFlatTwoside_DX7(struct gl_context *ctx, GLuint v0, GLuint v1);
void gld_Line2DSmoothTwoside_DX7(struct gl_context *ctx, GLuint v0, GLuint v1);
void gld_Triangle2DFlatTwoside_DX7(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
void gld_Triangle2DSmoothTwoside_DX7(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
void gld_Quad2DFlatTwoside_DX7(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
void gld_Quad2DSmoothTwoside_DX7(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
#endif

View file

@ -1,77 +0,0 @@
/*==========================================================================;
*
*
* File: dxerr8.h
* Content: DirectX Error Library Include File
*
****************************************************************************/
#ifndef _GLD_DXERR7_H_
#define _GLD_DXERR7_H_
#include <d3d.h>
//
// DXGetErrorString8
//
// Desc: Converts an DirectX HRESULT to a string
//
// Args: HRESULT hr Can be any error code from
// DPLAY D3D8 D3DX8 DMUSIC DSOUND
//
// Return: Converted string
//
const char* __stdcall DXGetErrorString8A(HRESULT hr);
const WCHAR* __stdcall DXGetErrorString8W(HRESULT hr);
#ifdef UNICODE
#define DXGetErrorString8 DXGetErrorString8W
#else
#define DXGetErrorString8 DXGetErrorString8A
#endif
//
// DXTrace
//
// Desc: Outputs a formatted error message to the debug stream
//
// Args: CHAR* strFile The current file, typically passed in using the
// __FILE__ macro.
// DWORD dwLine The current line number, typically passed in using the
// __LINE__ macro.
// HRESULT hr An HRESULT that will be traced to the debug stream.
// CHAR* strMsg A string that will be traced to the debug stream (may be NULL)
// BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info.
//
// Return: The hr that was passed in.
//
//HRESULT __stdcall DXTraceA( char* strFile, DWORD dwLine, HRESULT hr, char* strMsg, BOOL bPopMsgBox = FALSE );
//HRESULT __stdcall DXTraceW( char* strFile, DWORD dwLine, HRESULT hr, WCHAR* strMsg, BOOL bPopMsgBox = FALSE );
HRESULT __stdcall DXTraceA( char* strFile, DWORD dwLine, HRESULT hr, char* strMsg, BOOL bPopMsgBox);
HRESULT __stdcall DXTraceW( char* strFile, DWORD dwLine, HRESULT hr, WCHAR* strMsg, BOOL bPopMsgBox);
#ifdef UNICODE
#define DXTrace DXTraceW
#else
#define DXTrace DXTraceA
#endif
//
// Helper macros
//
#if defined(DEBUG) | defined(_DEBUG)
#define DXTRACE_MSG(str) DXTrace( __FILE__, (DWORD)__LINE__, 0, str, FALSE )
#define DXTRACE_ERR(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, TRUE )
#define DXTRACE_ERR_NOMSGBOX(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, FALSE )
#else
#define DXTRACE_MSG(str) (0L)
#define DXTRACE_ERR(str,hr) (hr)
#define DXTRACE_ERR_NOMSGBOX(str,hr) (hr)
#endif
#endif

View file

@ -1,346 +0,0 @@
/****************************************************************************
*
* Mesa 3-D graphics library
* Direct3D Driver Interface
*
* ========================================================================
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* ======================================================================
*
* Language: ANSI C
* Environment: Windows 9x/2000/XP/XBox (Win32)
*
* Description: GL extensions
*
****************************************************************************/
//#include "../GLDirect.h"
//#include "../gld_log.h"
//#include "../gld_settings.h"
#include <windows.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/gl.h>
#include <GL/glext.h>
//#include "ddlog.h"
//#include "gld_dx8.h"
#include "glheader.h"
#include "context.h"
#include "colormac.h"
#include "depth.h"
#include "extensions.h"
#include "macros.h"
#include "matrix.h"
// #include "mem.h"
//#include "mmath.h"
#include "mtypes.h"
#include "texformat.h"
#include "texstore.h"
#include "vbo/vbo.h"
#include "swrast_setup/swrast_setup.h"
#include "swrast_setup/ss_context.h"
#include "tnl/tnl.h"
#include "tnl/t_context.h"
#include "tnl/t_pipeline.h"
#include "dglcontext.h"
#include "extensions.h"
// For some reason this is not defined in an above header...
extern void _mesa_enable_imaging_extensions(struct gl_context *ctx);
//---------------------------------------------------------------------------
// Hack for the SGIS_multitexture extension that was removed from Mesa
// NOTE: SGIS_multitexture enums also clash with GL_SGIX_async_pixel
// NOTE: Quake2 ran *slower* with this enabled, so I've
// disabled it for now.
// To enable, uncomment:
// _mesa_add_extension(ctx, GL_TRUE, szGL_SGIS_multitexture, 0);
//---------------------------------------------------------------------------
enum {
/* Quake2 GL_SGIS_multitexture */
GL_SELECTED_TEXTURE_SGIS = 0x835B,
GL_SELECTED_TEXTURE_COORD_SET_SGIS = 0x835C,
GL_MAX_TEXTURES_SGIS = 0x835D,
GL_TEXTURE0_SGIS = 0x835E,
GL_TEXTURE1_SGIS = 0x835F,
GL_TEXTURE2_SGIS = 0x8360,
GL_TEXTURE3_SGIS = 0x8361,
GL_TEXTURE_COORD_SET_SOURCE_SGIS = 0x8363,
};
//---------------------------------------------------------------------------
void APIENTRY gldSelectTextureSGIS(
GLenum target)
{
GLenum ARB_target = GL_TEXTURE0_ARB + (target - GL_TEXTURE0_SGIS);
glActiveTextureARB(ARB_target);
}
//---------------------------------------------------------------------------
void APIENTRY gldMTexCoord2fSGIS(
GLenum target,
GLfloat s,
GLfloat t)
{
GLenum ARB_target = GL_TEXTURE0_ARB + (target - GL_TEXTURE0_SGIS);
glMultiTexCoord2fARB(ARB_target, s, t);
}
//---------------------------------------------------------------------------
void APIENTRY gldMTexCoord2fvSGIS(
GLenum target,
const GLfloat *v)
{
GLenum ARB_target = GL_TEXTURE0_ARB + (target - GL_TEXTURE0_SGIS);
glMultiTexCoord2fvARB(ARB_target, v);
}
//---------------------------------------------------------------------------
// Extensions
//---------------------------------------------------------------------------
typedef struct {
PROC proc;
char *name;
} GLD_extension;
GLD_extension GLD_extList[] = {
#ifdef GL_EXT_polygon_offset
{ (PROC)glPolygonOffsetEXT, "glPolygonOffsetEXT" },
#endif
{ (PROC)glBlendEquationEXT, "glBlendEquationEXT" },
{ (PROC)glBlendColorEXT, "glBlendColorExt" },
{ (PROC)glVertexPointerEXT, "glVertexPointerEXT" },
{ (PROC)glNormalPointerEXT, "glNormalPointerEXT" },
{ (PROC)glColorPointerEXT, "glColorPointerEXT" },
{ (PROC)glIndexPointerEXT, "glIndexPointerEXT" },
{ (PROC)glTexCoordPointerEXT, "glTexCoordPointer" },
{ (PROC)glEdgeFlagPointerEXT, "glEdgeFlagPointerEXT" },
{ (PROC)glGetPointervEXT, "glGetPointervEXT" },
{ (PROC)glArrayElementEXT, "glArrayElementEXT" },
{ (PROC)glDrawArraysEXT, "glDrawArrayEXT" },
{ (PROC)glAreTexturesResidentEXT, "glAreTexturesResidentEXT" },
{ (PROC)glBindTextureEXT, "glBindTextureEXT" },
{ (PROC)glDeleteTexturesEXT, "glDeleteTexturesEXT" },
{ (PROC)glGenTexturesEXT, "glGenTexturesEXT" },
{ (PROC)glIsTextureEXT, "glIsTextureEXT" },
{ (PROC)glPrioritizeTexturesEXT, "glPrioritizeTexturesEXT" },
{ (PROC)glCopyTexSubImage3DEXT, "glCopyTexSubImage3DEXT" },
{ (PROC)glTexImage3DEXT, "glTexImage3DEXT" },
{ (PROC)glTexSubImage3DEXT, "glTexSubImage3DEXT" },
{ (PROC)glPointParameterfEXT, "glPointParameterfEXT" },
{ (PROC)glPointParameterfvEXT, "glPointParameterfvEXT" },
{ (PROC)glLockArraysEXT, "glLockArraysEXT" },
{ (PROC)glUnlockArraysEXT, "glUnlockArraysEXT" },
{ NULL, "\0" }
};
GLD_extension GLD_multitexList[] = {
/*
{ (PROC)glMultiTexCoord1dSGIS, "glMTexCoord1dSGIS" },
{ (PROC)glMultiTexCoord1dvSGIS, "glMTexCoord1dvSGIS" },
{ (PROC)glMultiTexCoord1fSGIS, "glMTexCoord1fSGIS" },
{ (PROC)glMultiTexCoord1fvSGIS, "glMTexCoord1fvSGIS" },
{ (PROC)glMultiTexCoord1iSGIS, "glMTexCoord1iSGIS" },
{ (PROC)glMultiTexCoord1ivSGIS, "glMTexCoord1ivSGIS" },
{ (PROC)glMultiTexCoord1sSGIS, "glMTexCoord1sSGIS" },
{ (PROC)glMultiTexCoord1svSGIS, "glMTexCoord1svSGIS" },
{ (PROC)glMultiTexCoord2dSGIS, "glMTexCoord2dSGIS" },
{ (PROC)glMultiTexCoord2dvSGIS, "glMTexCoord2dvSGIS" },
{ (PROC)glMultiTexCoord2fSGIS, "glMTexCoord2fSGIS" },
{ (PROC)glMultiTexCoord2fvSGIS, "glMTexCoord2fvSGIS" },
{ (PROC)glMultiTexCoord2iSGIS, "glMTexCoord2iSGIS" },
{ (PROC)glMultiTexCoord2ivSGIS, "glMTexCoord2ivSGIS" },
{ (PROC)glMultiTexCoord2sSGIS, "glMTexCoord2sSGIS" },
{ (PROC)glMultiTexCoord2svSGIS, "glMTexCoord2svSGIS" },
{ (PROC)glMultiTexCoord3dSGIS, "glMTexCoord3dSGIS" },
{ (PROC)glMultiTexCoord3dvSGIS, "glMTexCoord3dvSGIS" },
{ (PROC)glMultiTexCoord3fSGIS, "glMTexCoord3fSGIS" },
{ (PROC)glMultiTexCoord3fvSGIS, "glMTexCoord3fvSGIS" },
{ (PROC)glMultiTexCoord3iSGIS, "glMTexCoord3iSGIS" },
{ (PROC)glMultiTexCoord3ivSGIS, "glMTexCoord3ivSGIS" },
{ (PROC)glMultiTexCoord3sSGIS, "glMTexCoord3sSGIS" },
{ (PROC)glMultiTexCoord3svSGIS, "glMTexCoord3svSGIS" },
{ (PROC)glMultiTexCoord4dSGIS, "glMTexCoord4dSGIS" },
{ (PROC)glMultiTexCoord4dvSGIS, "glMTexCoord4dvSGIS" },
{ (PROC)glMultiTexCoord4fSGIS, "glMTexCoord4fSGIS" },
{ (PROC)glMultiTexCoord4fvSGIS, "glMTexCoord4fvSGIS" },
{ (PROC)glMultiTexCoord4iSGIS, "glMTexCoord4iSGIS" },
{ (PROC)glMultiTexCoord4ivSGIS, "glMTexCoord4ivSGIS" },
{ (PROC)glMultiTexCoord4sSGIS, "glMTexCoord4sSGIS" },
{ (PROC)glMultiTexCoord4svSGIS, "glMTexCoord4svSGIS" },
{ (PROC)glMultiTexCoordPointerSGIS, "glMTexCoordPointerSGIS" },
{ (PROC)glSelectTextureSGIS, "glSelectTextureSGIS" },
{ (PROC)glSelectTextureCoordSetSGIS, "glSelectTextureCoordSetSGIS" },
*/
{ (PROC)glActiveTextureARB, "glActiveTextureARB" },
{ (PROC)glClientActiveTextureARB, "glClientActiveTextureARB" },
{ (PROC)glMultiTexCoord1dARB, "glMultiTexCoord1dARB" },
{ (PROC)glMultiTexCoord1dvARB, "glMultiTexCoord1dvARB" },
{ (PROC)glMultiTexCoord1fARB, "glMultiTexCoord1fARB" },
{ (PROC)glMultiTexCoord1fvARB, "glMultiTexCoord1fvARB" },
{ (PROC)glMultiTexCoord1iARB, "glMultiTexCoord1iARB" },
{ (PROC)glMultiTexCoord1ivARB, "glMultiTexCoord1ivARB" },
{ (PROC)glMultiTexCoord1sARB, "glMultiTexCoord1sARB" },
{ (PROC)glMultiTexCoord1svARB, "glMultiTexCoord1svARB" },
{ (PROC)glMultiTexCoord2dARB, "glMultiTexCoord2dARB" },
{ (PROC)glMultiTexCoord2dvARB, "glMultiTexCoord2dvARB" },
{ (PROC)glMultiTexCoord2fARB, "glMultiTexCoord2fARB" },
{ (PROC)glMultiTexCoord2fvARB, "glMultiTexCoord2fvARB" },
{ (PROC)glMultiTexCoord2iARB, "glMultiTexCoord2iARB" },
{ (PROC)glMultiTexCoord2ivARB, "glMultiTexCoord2ivARB" },
{ (PROC)glMultiTexCoord2sARB, "glMultiTexCoord2sARB" },
{ (PROC)glMultiTexCoord2svARB, "glMultiTexCoord2svARB" },
{ (PROC)glMultiTexCoord3dARB, "glMultiTexCoord3dARB" },
{ (PROC)glMultiTexCoord3dvARB, "glMultiTexCoord3dvARB" },
{ (PROC)glMultiTexCoord3fARB, "glMultiTexCoord3fARB" },
{ (PROC)glMultiTexCoord3fvARB, "glMultiTexCoord3fvARB" },
{ (PROC)glMultiTexCoord3iARB, "glMultiTexCoord3iARB" },
{ (PROC)glMultiTexCoord3ivARB, "glMultiTexCoord3ivARB" },
{ (PROC)glMultiTexCoord3sARB, "glMultiTexCoord3sARB" },
{ (PROC)glMultiTexCoord3svARB, "glMultiTexCoord3svARB" },
{ (PROC)glMultiTexCoord4dARB, "glMultiTexCoord4dARB" },
{ (PROC)glMultiTexCoord4dvARB, "glMultiTexCoord4dvARB" },
{ (PROC)glMultiTexCoord4fARB, "glMultiTexCoord4fARB" },
{ (PROC)glMultiTexCoord4fvARB, "glMultiTexCoord4fvARB" },
{ (PROC)glMultiTexCoord4iARB, "glMultiTexCoord4iARB" },
{ (PROC)glMultiTexCoord4ivARB, "glMultiTexCoord4ivARB" },
{ (PROC)glMultiTexCoord4sARB, "glMultiTexCoord4sARB" },
{ (PROC)glMultiTexCoord4svARB, "glMultiTexCoord4svARB" },
// Descent3 doesn't use correct string, hence this hack
{ (PROC)glMultiTexCoord4fARB, "glMultiTexCoord4f" },
// Quake2 SGIS multitexture
{ (PROC)gldSelectTextureSGIS, "glSelectTextureSGIS" },
{ (PROC)gldMTexCoord2fSGIS, "glMTexCoord2fSGIS" },
{ (PROC)gldMTexCoord2fvSGIS, "glMTexCoord2fvSGIS" },
{ NULL, "\0" }
};
//---------------------------------------------------------------------------
PROC gldGetProcAddress_DX(
LPCSTR a)
{
int i;
PROC proc = NULL;
for (i=0; GLD_extList[i].proc; i++) {
if (!strcmp(a, GLD_extList[i].name)) {
proc = GLD_extList[i].proc;
break;
}
}
if (glb.bMultitexture) {
for (i=0; GLD_multitexList[i].proc; i++) {
if (!strcmp(a, GLD_multitexList[i].name)) {
proc = GLD_multitexList[i].proc;
break;
}
}
}
gldLogPrintf(GLDLOG_INFO, "GetProcAddress: %s (%s)", a, proc ? "OK" : "Failed");
return proc;
}
//---------------------------------------------------------------------------
void gldEnableExtensions_DX7(
struct gl_context *ctx)
{
GLuint i;
// Mesa enables some extensions by default.
// This table decides which ones we want to switch off again.
// NOTE: GL_EXT_compiled_vertex_array appears broken.
const char *gld_disable_extensions[] = {
// "GL_ARB_transpose_matrix",
// "GL_EXT_compiled_vertex_array",
// "GL_EXT_polygon_offset",
// "GL_EXT_rescale_normal",
"GL_EXT_texture3D",
// "GL_NV_texgen_reflection",
"GL_EXT_abgr",
"GL_EXT_bgra",
NULL
};
const char *gld_multitex_extensions[] = {
"GL_ARB_multitexture", // Quake 3
NULL
};
// Quake 2 engines
const char *szGL_SGIS_multitexture = "GL_SGIS_multitexture";
const char *gld_enable_extensions[] = {
"GL_EXT_texture_env_add", // Quake 3
"GL_ARB_texture_env_add", // Quake 3
NULL
};
for (i=0; gld_disable_extensions[i]; i++) {
_mesa_disable_extension(ctx, gld_disable_extensions[i]);
}
for (i=0; gld_enable_extensions[i]; i++) {
_mesa_enable_extension(ctx, gld_enable_extensions[i]);
}
if (glb.bMultitexture) {
for (i=0; gld_multitex_extensions[i]; i++) {
_mesa_enable_extension(ctx, gld_multitex_extensions[i]);
}
// GL_SGIS_multitexture
// NOTE: Quake2 ran *slower* with this enabled, so I've
// disabled it for now.
// Fair bit slower on GeForce256,
// Much slower on 3dfx Voodoo5 5500.
// _mesa_add_extension(ctx, GL_TRUE, szGL_SGIS_multitexture, 0);
}
_mesa_enable_imaging_extensions(ctx);
_mesa_enable_1_3_extensions(ctx);
_mesa_enable_1_4_extensions(ctx);
}
//---------------------------------------------------------------------------

View file

@ -1,77 +0,0 @@
/****************************************************************************
*
* Mesa 3-D graphics library
* Direct3D Driver Interface
*
* ========================================================================
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* ======================================================================
*
* Language: ANSI C
* Environment: Windows 9x/2000/XP/XBox (Win32)
*
* Description: Mesa transformation pipeline with GLDirect fastpath
*
****************************************************************************/
//#include "../GLDirect.h"
#include "dglcontext.h"
#include "ddlog.h"
#include "gld_dx7.h"
#include "tnl/tnl.h"
#include "tnl/t_context.h"
#include "tnl/t_pipeline.h"
//---------------------------------------------------------------------------
extern struct tnl_pipeline_stage _gld_d3d_render_stage;
extern struct tnl_pipeline_stage _gld_mesa_render_stage;
static const struct tnl_pipeline_stage *gld_pipeline[] = {
&_gld_d3d_render_stage, // Direct3D TnL
&_tnl_vertex_transform_stage,
&_tnl_normal_transform_stage,
&_tnl_lighting_stage,
&_tnl_fog_coordinate_stage, /* TODO: Omit fog stage. ??? */
&_tnl_texgen_stage,
&_tnl_texture_transform_stage,
&_tnl_point_attenuation_stage,
&_gld_mesa_render_stage, // Mesa TnL, D3D rendering
0,
};
//---------------------------------------------------------------------------
void gldInstallPipeline_DX7(
struct gl_context *ctx)
{
// Remove any existing pipeline stages,
// then install GLDirect pipeline stages.
_tnl_destroy_pipeline(ctx);
_tnl_install_pipeline(ctx, gld_pipeline);
}
//---------------------------------------------------------------------------

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,257 +0,0 @@
/****************************************************************************
*
* Mesa 3-D graphics library
* Direct3D Driver Interface
*
* ========================================================================
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* ======================================================================
*
* Language: ANSI C
* Environment: Windows 9x/2000/XP/XBox (Win32)
*
* Description: GLDirect fastpath pipeline stage
*
****************************************************************************/
//---------------------------------------------------------------------------
//#include "../GLDirect.h"
//#include "../gld_log.h"
//#include "gld_dx8.h"
#include "dglcontext.h"
#include "ddlog.h"
#include "gld_dx7.h"
//---------------------------------------------------------------------------
#include "glheader.h"
#include "context.h"
#include "macros.h"
// #include "mem.h"
#include "mtypes.h"
//#include "mmath.h"
#include "math/m_matrix.h"
#include "math/m_xform.h"
#include "tnl/t_pipeline.h"
//---------------------------------------------------------------------------
/*
__inline void _gldSetVertexShaderConstants(
struct gl_context *ctx,
GLD_driver_dx8 *gld)
{
D3DXMATRIX mat, matView, matProj;
GLfloat *pM;
// Mesa 5: Altered to a Stack
//pM = ctx->ModelView.m;
pM = ctx->ModelviewMatrixStack.Top->m;
matView._11 = pM[0];
matView._12 = pM[1];
matView._13 = pM[2];
matView._14 = pM[3];
matView._21 = pM[4];
matView._22 = pM[5];
matView._23 = pM[6];
matView._24 = pM[7];
matView._31 = pM[8];
matView._32 = pM[9];
matView._33 = pM[10];
matView._34 = pM[11];
matView._41 = pM[12];
matView._42 = pM[13];
matView._43 = pM[14];
matView._44 = pM[15];
// Mesa 5: Altered to a Stack
//pM = ctx->ProjectionMatrix.m;
pM = ctx->ProjectionMatrixStack.Top->m;
matProj._11 = pM[0];
matProj._12 = pM[1];
matProj._13 = pM[2];
matProj._14 = pM[3];
matProj._21 = pM[4];
matProj._22 = pM[5];
matProj._23 = pM[6];
matProj._24 = pM[7];
matProj._31 = pM[8];
matProj._32 = pM[9];
matProj._33 = pM[10];
matProj._34 = pM[11];
matProj._41 = pM[12];
matProj._42 = pM[13];
matProj._43 = pM[14];
matProj._44 = pM[15];
D3DXMatrixMultiply( &mat, &matView, &matProj );
D3DXMatrixTranspose( &mat, &mat );
_GLD_DX8_DEV(SetVertexShaderConstant(gld->pDev, 0, &mat, 4));
}
*/
//---------------------------------------------------------------------------
static GLboolean gld_d3d_render_stage_run(
struct gl_context *ctx,
struct tnl_pipeline_stage *stage)
{
GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx);
TNLcontext *tnl;
struct vertex_buffer *VB;
tnl_render_func *tab;
GLint pass;
GLD_pb_dx7 *gldPB = &gld->PB3d;
DWORD dwFlags;
/*
static int count = 0;
count++;
if (count != 2)
return GL_FALSE;
*/
// The "check" function should disable this stage,
// but we'll test gld->bUseMesaTnL anyway.
if (gld->bUseMesaTnL) {
// Do nothing in this stage, but continue pipeline
return GL_TRUE;
}
tnl = TNL_CONTEXT(ctx);
VB = &tnl->vb;
pass = 0;
tnl->Driver.Render.Start( ctx );
#if 0
// For debugging: Useful to see if an app passes colour data in
// an unusual format.
switch (VB->AttribPtr[_TNL_ATTRIB_COLOR0]->Type) {
case GL_FLOAT:
ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_FLOAT\n");
break;
case GL_UNSIGNED_BYTE:
ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_UNSIGNED_BYTE\n");
break;
default:
ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: *?*\n");
break;
}
#endif
tnl->Driver.Render.Points = gld_Points3D_DX7;
if (ctx->_TriangleCaps & DD_FLATSHADE) {
tnl->Driver.Render.Line = gld_Line3DFlat_DX7;
tnl->Driver.Render.Triangle = gld_Triangle3DFlat_DX7;
tnl->Driver.Render.Quad = gld_Quad3DFlat_DX7;
} else {
tnl->Driver.Render.Line = gld_Line3DSmooth_DX7;
tnl->Driver.Render.Triangle = gld_Triangle3DSmooth_DX7;
tnl->Driver.Render.Quad = gld_Quad3DSmooth_DX7;
}
// _GLD_DX7_VB(Lock(gldPB->pVB, 0, 0, &gldPB->pPoints, D3DLOCK_DISCARD));
dwFlags = DDLOCK_DISCARDCONTENTS | DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR | DDLOCK_WRITEONLY;
_GLD_DX7_VB(Lock(gldPB->pVB, dwFlags, &gldPB->pPoints, NULL));
gldPB->nPoints = gldPB->nLines = gldPB->nTriangles = 0;
// Allocate primitive pointers
// gldPB->pPoints is always first
gldPB->pLines = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstLine);
gldPB->pTriangles = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstTriangle);
ASSERT(tnl->Driver.Render.BuildVertices);
ASSERT(tnl->Driver.Render.PrimitiveNotify);
ASSERT(tnl->Driver.Render.Points);
ASSERT(tnl->Driver.Render.Line);
ASSERT(tnl->Driver.Render.Triangle);
ASSERT(tnl->Driver.Render.Quad);
ASSERT(tnl->Driver.Render.ResetLineStipple);
ASSERT(tnl->Driver.Render.Interp);
ASSERT(tnl->Driver.Render.CopyPV);
ASSERT(tnl->Driver.Render.ClippedLine);
ASSERT(tnl->Driver.Render.ClippedPolygon);
ASSERT(tnl->Driver.Render.Finish);
tab = (VB->Elts ? tnl->Driver.Render.PrimTabElts : tnl->Driver.Render.PrimTabVerts);
do {
GLuint i, length, flags = 0;
for (i = 0 ; !(flags & PRIM_END) ; i += length)
{
flags = VB->Primitive[i].mode;
length= VB->Primitive[i].count;
ASSERT(length || (flags & PRIM_END));
ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1);
if (length)
tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags );
}
} while (tnl->Driver.Render.Multipass &&
tnl->Driver.Render.Multipass( ctx, ++pass ));
_GLD_DX7_VB(Unlock(gldPB->pVB));
// _GLD_DX7_DEV(SetStreamSource(gld->pDev, 0, gldPB->pVB, gldPB->dwStride));
_GLD_DX7_DEV(SetTransform(gld->pDev, D3DTRANSFORMSTATE_PROJECTION, &gld->matProjection));
_GLD_DX7_DEV(SetTransform(gld->pDev, D3DTRANSFORMSTATE_WORLD, &gld->matModelView));
if (gldPB->nPoints) {
// _GLD_DX7_DEV(DrawPrimitive(gld->pDev, D3DPT_POINTLIST, 0, gldPB->nPoints));
_GLD_DX7_DEV(DrawPrimitiveVB(gld->pDev, D3DPT_POINTLIST, gldPB->pVB, 0, gldPB->nPoints, 0));
gldPB->nPoints = 0;
}
if (gldPB->nLines) {
// _GLD_DX7_DEV(DrawPrimitive(gld->pDev, D3DPT_LINELIST, gldPB->iFirstLine, gldPB->nLines));
_GLD_DX7_DEV(DrawPrimitiveVB(gld->pDev, D3DPT_LINELIST, gldPB->pVB, gldPB->iFirstLine, gldPB->nLines, 0));
gldPB->nLines = 0;
}
if (gldPB->nTriangles) {
// _GLD_DX7_DEV(DrawPrimitive(gld->pDev, D3DPT_TRIANGLELIST, gldPB->iFirstTriangle, gldPB->nTriangles));
_GLD_DX7_DEV(DrawPrimitiveVB(gld->pDev, D3DPT_TRIANGLELIST, gldPB->pVB, gldPB->iFirstTriangle, gldPB->nTriangles, 0));
gldPB->nTriangles = 0;
}
return GL_FALSE; /* finished the pipe */
}
//---------------------------------------------------------------------------
const struct tnl_pipeline_stage _gld_d3d_render_stage =
{
"gld_d3d_render_stage",
NULL,
NULL,
NULL,
NULL,
gld_d3d_render_stage_run /* run */
};
//---------------------------------------------------------------------------

View file

@ -1,422 +0,0 @@
/*
* Mesa 3-D graphics library
* Version: 3.5
*
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
* Keith Whitwell <keithw@valinux.com>
*/
/*
* Render whole vertex buffers, including projection of vertices from
* clip space and clipping of primitives.
*
* This file makes calls to project vertices and to the point, line
* and triangle rasterizers via the function pointers:
*
* context->Driver.Render.*
*
*/
//---------------------------------------------------------------------------
//#include "../GLDirect.h"
//#include "../gld_log.h"
//#include "gld_dx8.h"
#include "dglcontext.h"
#include "ddlog.h"
#include "gld_dx7.h"
//---------------------------------------------------------------------------
#include "glheader.h"
#include "context.h"
#include "macros.h"
// #include "mem.h"
#include "mtypes.h"
//#include "mmath.h"
#include "math/m_matrix.h"
#include "math/m_xform.h"
#include "tnl/t_pipeline.h"
/**********************************************************************/
/* Clip single primitives */
/**********************************************************************/
#if defined(USE_IEEE)
#define NEGATIVE(x) (GET_FLOAT_BITS(x) & (1<<31))
//#define DIFFERENT_SIGNS(x,y) ((GET_FLOAT_BITS(x) ^ GET_FLOAT_BITS(y)) & (1<<31))
#else
#define NEGATIVE(x) (x < 0)
//#define DIFFERENT_SIGNS(x,y) (x * y <= 0 && x - y != 0)
/* Could just use (x*y<0) except for the flatshading requirements.
* Maybe there's a better way?
*/
#endif
#define W(i) coord[i][3]
#define Z(i) coord[i][2]
#define Y(i) coord[i][1]
#define X(i) coord[i][0]
#define SIZE 4
#define TAG(x) x##_4
#include "tnl/t_vb_cliptmp.h"
/**********************************************************************/
/* Clip and render whole begin/end objects */
/**********************************************************************/
#define NEED_EDGEFLAG_SETUP (ctx->_TriangleCaps & DD_TRI_UNFILLED)
#define EDGEFLAG_GET(idx) VB->EdgeFlag[idx]
#define EDGEFLAG_SET(idx, val) VB->EdgeFlag[idx] = val
/* Vertices, with the possibility of clipping.
*/
#define RENDER_POINTS( start, count ) \
tnl->Driver.Render.Points( ctx, start, count )
#define RENDER_LINE( v1, v2 ) \
do { \
GLubyte c1 = mask[v1], c2 = mask[v2]; \
GLubyte ormask = c1|c2; \
if (!ormask) \
LineFunc( ctx, v1, v2 ); \
else if (!(c1 & c2 & 0x3f)) \
clip_line_4( ctx, v1, v2, ormask ); \
} while (0)
#define RENDER_TRI( v1, v2, v3 ) \
do { \
GLubyte c1 = mask[v1], c2 = mask[v2], c3 = mask[v3]; \
GLubyte ormask = c1|c2|c3; \
if (!ormask) \
TriangleFunc( ctx, v1, v2, v3 ); \
else if (!(c1 & c2 & c3 & 0x3f)) \
clip_tri_4( ctx, v1, v2, v3, ormask ); \
} while (0)
#define RENDER_QUAD( v1, v2, v3, v4 ) \
do { \
GLubyte c1 = mask[v1], c2 = mask[v2]; \
GLubyte c3 = mask[v3], c4 = mask[v4]; \
GLubyte ormask = c1|c2|c3|c4; \
if (!ormask) \
QuadFunc( ctx, v1, v2, v3, v4 ); \
else if (!(c1 & c2 & c3 & c4 & 0x3f)) \
clip_quad_4( ctx, v1, v2, v3, v4, ormask ); \
} while (0)
#define LOCAL_VARS \
TNLcontext *tnl = TNL_CONTEXT(ctx); \
struct vertex_buffer *VB = &tnl->vb; \
const GLuint * const elt = VB->Elts; \
const GLubyte *mask = VB->ClipMask; \
const GLuint sz = VB->ClipPtr->size; \
const tnl_line_func LineFunc = tnl->Driver.Render.Line; \
const tnl_triangle_func TriangleFunc = tnl->Driver.Render.Triangle; \
const tnl_quad_func QuadFunc = tnl->Driver.Render.Quad; \
const GLboolean stipple = ctx->Line.StippleFlag; \
(void) (LineFunc && TriangleFunc && QuadFunc); \
(void) elt; (void) mask; (void) sz; (void) stipple;
#define TAG(x) clip_##x##_verts
#define INIT(x) tnl->Driver.Render.PrimitiveNotify( ctx, x )
#define RESET_STIPPLE if (stipple) tnl->Driver.Render.ResetLineStipple( ctx )
#define PRESERVE_VB_DEFS
#include "tnl/t_vb_rendertmp.h"
/* Elts, with the possibility of clipping.
*/
#undef ELT
#undef TAG
#define ELT(x) elt[x]
#define TAG(x) clip_##x##_elts
#include "tnl/t_vb_rendertmp.h"
/* TODO: do this for all primitives, verts and elts:
*/
static void clip_elt_triangles( struct gl_context *ctx,
GLuint start,
GLuint count,
GLuint flags )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
tnl_render_func render_tris = tnl->Driver.Render.PrimTabElts[GL_TRIANGLES];
struct vertex_buffer *VB = &tnl->vb;
const GLuint * const elt = VB->Elts;
GLubyte *mask = VB->ClipMask;
GLuint last = count-2;
GLuint j;
(void) flags;
tnl->Driver.Render.PrimitiveNotify( ctx, GL_TRIANGLES );
for (j=start; j < last; j+=3 ) {
GLubyte c1 = mask[elt[j]];
GLubyte c2 = mask[elt[j+1]];
GLubyte c3 = mask[elt[j+2]];
GLubyte ormask = c1|c2|c3;
if (ormask) {
if (start < j)
render_tris( ctx, start, j, 0 );
if (!(c1&c2&c3&0x3f))
clip_tri_4( ctx, elt[j], elt[j+1], elt[j+2], ormask );
start = j+3;
}
}
if (start < j)
render_tris( ctx, start, j, 0 );
}
/**********************************************************************/
/* Render whole begin/end objects */
/**********************************************************************/
#define NEED_EDGEFLAG_SETUP (ctx->_TriangleCaps & DD_TRI_UNFILLED)
#define EDGEFLAG_GET(idx) VB->EdgeFlag[idx]
#define EDGEFLAG_SET(idx, val) VB->EdgeFlag[idx] = val
/* Vertices, no clipping.
*/
#define RENDER_POINTS( start, count ) \
tnl->Driver.Render.Points( ctx, start, count )
#define RENDER_LINE( v1, v2 ) \
LineFunc( ctx, v1, v2 )
#define RENDER_TRI( v1, v2, v3 ) \
TriangleFunc( ctx, v1, v2, v3 )
#define RENDER_QUAD( v1, v2, v3, v4 ) \
QuadFunc( ctx, v1, v2, v3, v4 )
#define TAG(x) _gld_tnl_##x##_verts
#define LOCAL_VARS \
TNLcontext *tnl = TNL_CONTEXT(ctx); \
struct vertex_buffer *VB = &tnl->vb; \
const GLuint * const elt = VB->Elts; \
const tnl_line_func LineFunc = tnl->Driver.Render.Line; \
const tnl_triangle_func TriangleFunc = tnl->Driver.Render.Triangle; \
const tnl_quad_func QuadFunc = tnl->Driver.Render.Quad; \
(void) (LineFunc && TriangleFunc && QuadFunc); \
(void) elt;
#define RESET_STIPPLE tnl->Driver.Render.ResetLineStipple( ctx )
#define INIT(x) tnl->Driver.Render.PrimitiveNotify( ctx, x )
#define RENDER_TAB_QUALIFIER
#define PRESERVE_VB_DEFS
#include "tnl/t_vb_rendertmp.h"
/* Elts, no clipping.
*/
#undef ELT
#define TAG(x) _gld_tnl_##x##_elts
#define ELT(x) elt[x]
#include "tnl/t_vb_rendertmp.h"
/**********************************************************************/
/* Helper functions for drivers */
/**********************************************************************/
/*
void _tnl_RenderClippedPolygon( struct gl_context *ctx, const GLuint *elts, GLuint n )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct vertex_buffer *VB = &tnl->vb;
GLuint *tmp = VB->Elts;
VB->Elts = (GLuint *)elts;
tnl->Driver.Render.PrimTabElts[GL_POLYGON]( ctx, 0, n, PRIM_BEGIN|PRIM_END );
VB->Elts = tmp;
}
void _tnl_RenderClippedLine( struct gl_context *ctx, GLuint ii, GLuint jj )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
tnl->Driver.Render.Line( ctx, ii, jj );
}
*/
/**********************************************************************/
/* Clip and render whole vertex buffers */
/**********************************************************************/
tnl_points_func _gldSetupPoints[4] = {
gld_Points2D_DX7,
gld_Points2D_DX7,
gld_Points2D_DX7,
gld_Points2D_DX7
};
tnl_line_func _gldSetupLine[4] = {
gld_Line2DFlat_DX7,
gld_Line2DSmooth_DX7,
gld_Line2DFlat_DX7,
gld_Line2DSmooth_DX7,
};
tnl_triangle_func _gldSetupTriangle[4] = {
gld_Triangle2DFlat_DX7,
gld_Triangle2DSmooth_DX7,
gld_Triangle2DFlatExtras_DX7,
gld_Triangle2DSmoothExtras_DX7
};
tnl_quad_func _gldSetupQuad[4] = {
gld_Quad2DFlat_DX7,
gld_Quad2DSmooth_DX7,
gld_Quad2DFlatExtras_DX7,
gld_Quad2DSmoothExtras_DX7
};
//---------------------------------------------------------------------------
static GLboolean _gld_mesa_render_stage_run(
struct gl_context *ctx,
struct tnl_pipeline_stage *stage)
{
GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
GLD_driver_dx7 *gld = GLD_GET_DX7_DRIVER(gldCtx);
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct vertex_buffer *VB = &tnl->vb;
tnl_render_func *tab;
GLint pass = 0;
GLD_pb_dx7 *gldPB;
DWORD dwFlags;
/* Allow the drivers to lock before projected verts are built so
* that window coordinates are guarenteed not to change before
* rendering.
*/
ASSERT(tnl->Driver.Render.Start);
tnl->Driver.Render.Start( ctx );
gldPB = &gld->PB2d;
tnl->Driver.Render.Points = _gldSetupPoints[gld->iSetupFunc];
tnl->Driver.Render.Line = _gldSetupLine[gld->iSetupFunc];
tnl->Driver.Render.Triangle = _gldSetupTriangle[gld->iSetupFunc];
tnl->Driver.Render.Quad = _gldSetupQuad[gld->iSetupFunc];
dwFlags = DDLOCK_DISCARDCONTENTS | DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR | DDLOCK_WRITEONLY;
_GLD_DX7_VB(Lock(gldPB->pVB, dwFlags, &gldPB->pPoints, NULL));
gldPB->nPoints = gldPB->nLines = gldPB->nTriangles = 0;
// Allocate primitive pointers - gldPB->pPoints is always first
gldPB->pLines = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstLine);
gldPB->pTriangles = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstTriangle);
ASSERT(tnl->Driver.Render.BuildVertices);
ASSERT(tnl->Driver.Render.PrimitiveNotify);
ASSERT(tnl->Driver.Render.Points);
ASSERT(tnl->Driver.Render.Line);
ASSERT(tnl->Driver.Render.Triangle);
ASSERT(tnl->Driver.Render.Quad);
ASSERT(tnl->Driver.Render.ResetLineStipple);
ASSERT(tnl->Driver.Render.Interp);
ASSERT(tnl->Driver.Render.CopyPV);
ASSERT(tnl->Driver.Render.ClippedLine);
ASSERT(tnl->Driver.Render.ClippedPolygon);
ASSERT(tnl->Driver.Render.Finish);
tnl->Driver.Render.BuildVertices( ctx, 0, VB->Count, ~0 );
if (VB->ClipOrMask) {
tab = VB->Elts ? clip_render_tab_elts : clip_render_tab_verts;
clip_render_tab_elts[GL_TRIANGLES] = clip_elt_triangles;
}
else {
tab = (VB->Elts ?
tnl->Driver.Render.PrimTabElts :
tnl->Driver.Render.PrimTabVerts);
}
do {
GLuint i, length, flags = 0;
for (i = 0 ; !(flags & PRIM_END) ; i += length) {
flags = VB->Primitive[i].mode;
length= VB->Primitive[i].count;
ASSERT(length || (flags & PRIM_END));
ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1);
if (length)
tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags );
}
} while (tnl->Driver.Render.Multipass &&
tnl->Driver.Render.Multipass( ctx, ++pass ));
// tnl->Driver.Render.Finish( ctx );
_GLD_DX7_VB(Unlock(gldPB->pVB));
if (gldPB->nPoints) {
_GLD_DX7_DEV(DrawPrimitiveVB(gld->pDev, D3DPT_POINTLIST, gldPB->pVB, 0, gldPB->nPoints, 0));
gldPB->nPoints = 0;
}
if (gldPB->nLines) {
_GLD_DX7_DEV(DrawPrimitiveVB(gld->pDev, D3DPT_LINELIST, gldPB->pVB, gldPB->iFirstLine, gldPB->nLines*2, 0));
gldPB->nLines = 0;
}
if (gldPB->nTriangles) {
_GLD_DX7_DEV(DrawPrimitiveVB(gld->pDev, D3DPT_TRIANGLELIST, gldPB->pVB, gldPB->iFirstTriangle, gldPB->nTriangles*3, 0));
gldPB->nTriangles = 0;
}
return GL_FALSE; /* finished the pipe */
}
/**********************************************************************/
/* Render pipeline stage */
/**********************************************************************/
const struct tnl_pipeline_stage _gld_mesa_render_stage =
{
"gld_mesa_render_stage",
NULL,
NULL,
NULL,
NULL,
_gld_mesa_render_stage_run /* run */
};
//---------------------------------------------------------------------------

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,324 +0,0 @@
/****************************************************************************
*
* Mesa 3-D graphics library
* Direct3D Driver Interface
*
* ========================================================================
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* ======================================================================
*
* Language: ANSI C
* Environment: Windows 9x/2000/XP/XBox (Win32)
*
* Description: GLDirect Direct3D 8.0 header file
*
****************************************************************************/
#ifndef _GLD_DX8_H
#define _GLD_DX8_H
//---------------------------------------------------------------------------
// Windows includes
//---------------------------------------------------------------------------
//#ifndef STRICT
//#define STRICT
//#endif
//#define WIN32_LEAN_AND_MEAN
//#include <windows.h>
#include <d3d8.h>
#include <d3dx8.h>
// MS screwed up with the DX8.1 SDK - there's no compile-time
// method of compiling for 8.0 via the 8.1 SDK unless you
// "make sure you don't use any 8.1 interfaces".
// We CAN use 8.1 D3DX static functions, though - just not new 8.1 interfaces.
//
// D3D_SDK_VERSION is 120 for 8.0 (supported by Windows 95).
// D3D_SDK_VERSION is 220 for 8.1 (NOT supported by Windows 95).
//
#define D3D_SDK_VERSION_DX8_SUPPORT_WIN95 120
// Typedef for obtaining function from d3d8.dll
typedef IDirect3D8* (WINAPI *FNDIRECT3DCREATE8) (UINT);
//---------------------------------------------------------------------------
// Defines
//---------------------------------------------------------------------------
#ifdef _DEBUG
#define _GLD_TEST_HRESULT(h) \
{ \
HRESULT _hr = (h); \
if (FAILED(_hr)) { \
gldLogError(GLDLOG_ERROR, #h, _hr); \
} \
}
#define _GLD_DX8(func) _GLD_TEST_HRESULT(IDirect3D8_##func##)
#define _GLD_DX8_DEV(func) _GLD_TEST_HRESULT(IDirect3DDevice8_##func##)
#define _GLD_DX8_VB(func) _GLD_TEST_HRESULT(IDirect3DVertexBuffer8_##func##)
#define _GLD_DX8_TEX(func) _GLD_TEST_HRESULT(IDirect3DTexture8_##func##)
#else
#define _GLD_DX8(func) IDirect3D8_##func
#define _GLD_DX8_DEV(func) IDirect3DDevice8_##func
#define _GLD_DX8_VB(func) IDirect3DVertexBuffer8_##func
#define _GLD_DX8_TEX(func) IDirect3DTexture8_##func
#endif
#define SAFE_RELEASE(p) \
{ \
if (p) { \
(p)->lpVtbl->Release(p); \
(p) = NULL; \
} \
}
#define SAFE_RELEASE_VB8(p) \
{ \
if (p) { \
IDirect3DVertexBuffer8_Release((p)); \
(p) = NULL; \
} \
}
#define SAFE_RELEASE_SURFACE8(p) \
{ \
if (p) { \
IDirect3DSurface8_Release((p)); \
(p) = NULL; \
} \
}
// Setup index.
enum {
GLD_SI_FLAT = 0,
GLD_SI_SMOOTH = 1,
GLD_SI_FLAT_EXTRAS = 2,
GLD_SI_SMOOTH_EXTRAS = 3,
};
/*
// Internal pipeline
typedef enum {
GLD_PIPELINE_MESA = 0, // Mesa pipeline
GLD_PIPELINE_D3D_FVF = 1, // Direct3D Fixed-function pipeline
GLD_PIPELINE_D3D_VS_TWOSIDE = 2 // Direct3D two-sided-lighting vertex shader
} GLD_tnl_pipeline;
*/
//---------------------------------------------------------------------------
// Vertex definitions for Fixed-Function pipeline
//---------------------------------------------------------------------------
//
// NOTE: If the number of texture units is altered then most of
// the texture code will need to be revised.
//
#define GLD_MAX_TEXTURE_UNITS_DX8 2
//
// 2D vertex transformed by Mesa
//
#define GLD_FVF_2D_VERTEX ( D3DFVF_XYZRHW | \
D3DFVF_DIFFUSE | \
D3DFVF_SPECULAR | \
D3DFVF_TEX2)
typedef struct {
FLOAT x, y; // 2D raster coords
FLOAT sz; // Screen Z (depth)
FLOAT rhw; // Reciprocal homogenous W
DWORD diffuse; // Diffuse colour
DWORD specular; // For separate-specular support
FLOAT t0_u, t0_v; // 1st set of texture coords
FLOAT t1_u, t1_v; // 2nd set of texture coords
} GLD_2D_VERTEX;
//
// 3D vertex transformed by Direct3D
//
#define GLD_FVF_3D_VERTEX ( D3DFVF_XYZ | \
D3DFVF_DIFFUSE | \
D3DFVF_TEX2)
typedef struct {
D3DXVECTOR3 Position; // XYZ Vector in object space
D3DCOLOR Diffuse; // Diffuse colour
D3DXVECTOR2 TexUnit0; // Texture unit 0
D3DXVECTOR2 TexUnit1; // Texture unit 1
} GLD_3D_VERTEX;
//---------------------------------------------------------------------------
// Vertex Shaders
//---------------------------------------------------------------------------
/*
// DX8 Vertex Shader
typedef struct {
DWORD hShader; // If NULL, shader is invalid and cannot be used
BOOL bHardware; // If TRUE then shader was created for hardware,
// otherwise shader was created for software.
} GLD_vertexShader;
*/
//---------------------------------------------------------------------------
// Structs
//---------------------------------------------------------------------------
// This keeps a count of how many times we choose each individual internal
// pathway. Useful for seeing if a certain pathway was ever used by an app, and
// how much each pathway is biased.
// Zero the members at context creation and dump stats at context deletion.
typedef struct {
// Note: DWORD is probably too small
ULARGE_INTEGER qwMesa; // Mesa TnL pipeline
ULARGE_INTEGER qwD3DFVF; // Direct3D Fixed-Function pipeline
// ULARGE_INTEGER dwD3D2SVS; // Direct3D Two-Sided Vertex Shader pipeline
} GLD_pipeline_usage;
// GLDirect Primitive Buffer (points, lines, triangles and quads)
typedef struct {
// Data for IDirect3DDevice8::CreateVertexBuffer()
DWORD dwStride; // Stride of vertex
DWORD dwUsage; // Usage flags
DWORD dwFVF; // Direct3D Flexible Vertex Format
DWORD dwPool; // Pool flags
IDirect3DVertexBuffer8 *pVB; // Holds points, lines, tris and quads.
// Point list is assumed to be at start of buffer
DWORD iFirstLine; // Index of start of line list
DWORD iFirstTriangle; // Index of start of triangle list
BYTE *pPoints; // Pointer to next free point
BYTE *pLines; // Pointer to next free line
BYTE *pTriangles; // Pointer to next free triangle
DWORD nPoints; // Number of points ready to render
DWORD nLines; // Number of lines ready to render
DWORD nTriangles; // Number of triangles ready to render
} GLD_pb_dx8;
// GLDirect DX8 driver data
typedef struct {
// GLDirect vars
BOOL bDoublebuffer; // Doublebuffer (otherwise single-buffered)
BOOL bDepthStencil; // Depth buffer needed (stencil optional)
D3DFORMAT RenderFormat; // Format of back/front buffer
D3DFORMAT DepthFormat; // Format of depth/stencil
// float fFlipWindowY; // Value for flipping viewport Y coord
// Direct3D vars
D3DCAPS8 d3dCaps8;
BOOL bHasHWTnL; // Device has Hardware Transform/Light?
IDirect3D8 *pD3D; // Base Direct3D8 interface
IDirect3DDevice8 *pDev; // Direct3D8 Device interface
GLD_pb_dx8 PB2d; // Vertices transformed by Mesa
GLD_pb_dx8 PB3d; // Vertices transformed by Direct3D
D3DPRIMITIVETYPE d3dpt; // Current Direct3D primitive type
D3DXMATRIX matProjection; // Projection matrix for D3D TnL
D3DXMATRIX matModelView; // Model/View matrix for D3D TnL
int iSetupFunc; // Which setup functions to use
BOOL bUseMesaTnL; // Whether to use Mesa or D3D for TnL
// Direct3D vars for two-sided lighting
// GLD_vertexShader VStwosidelight; // Vertex Shader for two-sided lighting
// D3DXMATRIX matWorldViewProj;// World/View/Projection matrix for shaders
// GLD_tnl_pipeline TnLPipeline; // Index of current internal pipeline
GLD_pipeline_usage PipelineUsage;
} GLD_driver_dx8;
#define GLD_GET_DX8_DRIVER(c) (GLD_driver_dx8*)(c)->glPriv
//---------------------------------------------------------------------------
// Function prototypes
//---------------------------------------------------------------------------
PROC gldGetProcAddress_DX8(LPCSTR a);
void gldEnableExtensions_DX8(struct gl_context *ctx);
void gldInstallPipeline_DX8(struct gl_context *ctx);
void gldSetupDriverPointers_DX8(struct gl_context *ctx);
//void gldResizeBuffers_DX8(struct gl_context *ctx);
void gldResizeBuffers_DX8(struct gl_framebuffer *fb);
// Texture functions
void gldCopyTexImage1D_DX8(struct gl_context *ctx, GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border);
void gldCopyTexImage2D_DX8(struct gl_context *ctx, GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
void gldCopyTexSubImage1D_DX8(struct gl_context *ctx, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width );
void gldCopyTexSubImage2D_DX8(struct gl_context *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height );
void gldCopyTexSubImage3D_DX8(struct gl_context *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height );
void gld_NEW_TEXTURE_DX8(struct gl_context *ctx);
void gld_DrawPixels_DX8(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels);
void gld_ReadPixels_DX8(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, const struct gl_pixelstore_attrib *unpack, GLvoid *dest);
void gld_CopyPixels_DX8(struct gl_context *ctx, GLint srcx, GLint srcy, GLsizei width, GLsizei height, GLint dstx, GLint dsty, GLenum type);
void gld_Bitmap_DX8(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei height, const struct gl_pixelstore_attrib *unpack, const GLubyte *bitmap);
const struct gl_texture_format* gld_ChooseTextureFormat_DX8(struct gl_context *ctx, GLint internalFormat, GLenum srcFormat, GLenum srcType);
void gld_TexImage2D_DX8(struct gl_context *ctx, GLenum target, GLint level, GLint internalFormat, GLint width, GLint height, GLint border, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *tObj, struct gl_texture_image *texImage);
void gld_TexImage1D_DX8(struct gl_context *ctx, GLenum target, GLint level, GLint internalFormat, GLint width, GLint border, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage );
void gld_TexSubImage2D_DX8( struct gl_context *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage );
void gld_TexSubImage1D_DX8(struct gl_context *ctx, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage);
void gld_DeleteTexture_DX8(struct gl_context *ctx, struct gl_texture_object *tObj);
void gld_ResetLineStipple_DX8(struct gl_context *ctx);
// 2D primitive functions
void gld_Points2D_DX8(struct gl_context *ctx, GLuint first, GLuint last);
void gld_Line2DFlat_DX8(struct gl_context *ctx, GLuint v0, GLuint v1);
void gld_Line2DSmooth_DX8(struct gl_context *ctx, GLuint v0, GLuint v1);
void gld_Triangle2DFlat_DX8(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
void gld_Triangle2DSmooth_DX8(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
void gld_Triangle2DFlatExtras_DX8(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
void gld_Triangle2DSmoothExtras_DX8(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
void gld_Quad2DFlat_DX8(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
void gld_Quad2DSmooth_DX8(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
void gld_Quad2DFlatExtras_DX8(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
void gld_Quad2DSmoothExtras_DX8(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
// 3D primitive functions
void gld_Points3D_DX8(struct gl_context *ctx, GLuint first, GLuint last);
void gld_Line3DFlat_DX8(struct gl_context *ctx, GLuint v0, GLuint v1);
void gld_Triangle3DFlat_DX8(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
void gld_Quad3DFlat_DX8(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
void gld_Line3DSmooth_DX8(struct gl_context *ctx, GLuint v0, GLuint v1);
void gld_Triangle3DSmooth_DX8(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
void gld_Quad3DSmooth_DX8(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
// Primitive functions for Two-sided-lighting Vertex Shader
void gld_Points2DTwoside_DX8(struct gl_context *ctx, GLuint first, GLuint last);
void gld_Line2DFlatTwoside_DX8(struct gl_context *ctx, GLuint v0, GLuint v1);
void gld_Line2DSmoothTwoside_DX8(struct gl_context *ctx, GLuint v0, GLuint v1);
void gld_Triangle2DFlatTwoside_DX8(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
void gld_Triangle2DSmoothTwoside_DX8(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
void gld_Quad2DFlatTwoside_DX8(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
void gld_Quad2DSmoothTwoside_DX8(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
#endif

View file

@ -1,77 +0,0 @@
/*==========================================================================;
*
*
* File: dxerr8.h
* Content: DirectX Error Library Include File
*
****************************************************************************/
#ifndef _GLD_DXERR8_H_
#define _GLD_DXERR8_H_
#include <d3d8.h>
//
// DXGetErrorString8
//
// Desc: Converts an DirectX HRESULT to a string
//
// Args: HRESULT hr Can be any error code from
// DPLAY D3D8 D3DX8 DMUSIC DSOUND
//
// Return: Converted string
//
const char* __stdcall DXGetErrorString8A(HRESULT hr);
const WCHAR* __stdcall DXGetErrorString8W(HRESULT hr);
#ifdef UNICODE
#define DXGetErrorString8 DXGetErrorString8W
#else
#define DXGetErrorString8 DXGetErrorString8A
#endif
//
// DXTrace
//
// Desc: Outputs a formatted error message to the debug stream
//
// Args: CHAR* strFile The current file, typically passed in using the
// __FILE__ macro.
// DWORD dwLine The current line number, typically passed in using the
// __LINE__ macro.
// HRESULT hr An HRESULT that will be traced to the debug stream.
// CHAR* strMsg A string that will be traced to the debug stream (may be NULL)
// BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info.
//
// Return: The hr that was passed in.
//
//HRESULT __stdcall DXTraceA( char* strFile, DWORD dwLine, HRESULT hr, char* strMsg, BOOL bPopMsgBox = FALSE );
//HRESULT __stdcall DXTraceW( char* strFile, DWORD dwLine, HRESULT hr, WCHAR* strMsg, BOOL bPopMsgBox = FALSE );
HRESULT __stdcall DXTraceA( char* strFile, DWORD dwLine, HRESULT hr, char* strMsg, BOOL bPopMsgBox);
HRESULT __stdcall DXTraceW( char* strFile, DWORD dwLine, HRESULT hr, WCHAR* strMsg, BOOL bPopMsgBox);
#ifdef UNICODE
#define DXTrace DXTraceW
#else
#define DXTrace DXTraceA
#endif
//
// Helper macros
//
#if defined(DEBUG) | defined(_DEBUG)
#define DXTRACE_MSG(str) DXTrace( __FILE__, (DWORD)__LINE__, 0, str, FALSE )
#define DXTRACE_ERR(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, TRUE )
#define DXTRACE_ERR_NOMSGBOX(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, FALSE )
#else
#define DXTRACE_MSG(str) (0L)
#define DXTRACE_ERR(str,hr) (hr)
#define DXTRACE_ERR_NOMSGBOX(str,hr) (hr)
#endif
#endif

View file

@ -1,344 +0,0 @@
/****************************************************************************
*
* Mesa 3-D graphics library
* Direct3D Driver Interface
*
* ========================================================================
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* ======================================================================
*
* Language: ANSI C
* Environment: Windows 9x/2000/XP/XBox (Win32)
*
* Description: GL extensions
*
****************************************************************************/
//#include "../GLDirect.h"
//#include "../gld_log.h"
//#include "../gld_settings.h"
#include <windows.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/gl.h>
#include <GL/glext.h>
//#include "ddlog.h"
//#include "gld_dx8.h"
#include "glheader.h"
#include "context.h"
#include "colormac.h"
#include "depth.h"
#include "extensions.h"
#include "macros.h"
#include "matrix.h"
// #include "mem.h"
//#include "mmath.h"
#include "mtypes.h"
#include "texformat.h"
#include "texstore.h"
#include "vbo/vbo.h"
#include "swrast_setup/swrast_setup.h"
#include "swrast_setup/ss_context.h"
#include "tnl/tnl.h"
#include "tnl/t_context.h"
#include "tnl/t_pipeline.h"
#include "dglcontext.h"
#include "extensions.h"
// For some reason this is not defined in an above header...
extern void _mesa_enable_imaging_extensions(struct gl_context *ctx);
//---------------------------------------------------------------------------
// Hack for the SGIS_multitexture extension that was removed from Mesa
// NOTE: SGIS_multitexture enums also clash with GL_SGIX_async_pixel
// NOTE: Quake2 ran *slower* with this enabled, so I've
// disabled it for now.
// To enable, uncomment:
// _mesa_add_extension(ctx, GL_TRUE, szGL_SGIS_multitexture, 0);
//---------------------------------------------------------------------------
enum {
/* Quake2 GL_SGIS_multitexture */
GL_SELECTED_TEXTURE_SGIS = 0x835B,
GL_SELECTED_TEXTURE_COORD_SET_SGIS = 0x835C,
GL_MAX_TEXTURES_SGIS = 0x835D,
GL_TEXTURE0_SGIS = 0x835E,
GL_TEXTURE1_SGIS = 0x835F,
GL_TEXTURE2_SGIS = 0x8360,
GL_TEXTURE3_SGIS = 0x8361,
GL_TEXTURE_COORD_SET_SOURCE_SGIS = 0x8363,
};
//---------------------------------------------------------------------------
void APIENTRY gldSelectTextureSGIS(
GLenum target)
{
GLenum ARB_target = GL_TEXTURE0_ARB + (target - GL_TEXTURE0_SGIS);
glActiveTextureARB(ARB_target);
}
//---------------------------------------------------------------------------
void APIENTRY gldMTexCoord2fSGIS(
GLenum target,
GLfloat s,
GLfloat t)
{
GLenum ARB_target = GL_TEXTURE0_ARB + (target - GL_TEXTURE0_SGIS);
glMultiTexCoord2fARB(ARB_target, s, t);
}
//---------------------------------------------------------------------------
void APIENTRY gldMTexCoord2fvSGIS(
GLenum target,
const GLfloat *v)
{
GLenum ARB_target = GL_TEXTURE0_ARB + (target - GL_TEXTURE0_SGIS);
glMultiTexCoord2fvARB(ARB_target, v);
}
//---------------------------------------------------------------------------
// Extensions
//---------------------------------------------------------------------------
typedef struct {
PROC proc;
char *name;
} GLD_extension;
GLD_extension GLD_extList[] = {
#ifdef GL_EXT_polygon_offset
{ (PROC)glPolygonOffsetEXT, "glPolygonOffsetEXT" },
#endif
{ (PROC)glBlendEquationEXT, "glBlendEquationEXT" },
{ (PROC)glBlendColorEXT, "glBlendColorExt" },
{ (PROC)glVertexPointerEXT, "glVertexPointerEXT" },
{ (PROC)glNormalPointerEXT, "glNormalPointerEXT" },
{ (PROC)glColorPointerEXT, "glColorPointerEXT" },
{ (PROC)glIndexPointerEXT, "glIndexPointerEXT" },
{ (PROC)glTexCoordPointerEXT, "glTexCoordPointer" },
{ (PROC)glEdgeFlagPointerEXT, "glEdgeFlagPointerEXT" },
{ (PROC)glGetPointervEXT, "glGetPointervEXT" },
{ (PROC)glArrayElementEXT, "glArrayElementEXT" },
{ (PROC)glDrawArraysEXT, "glDrawArrayEXT" },
{ (PROC)glAreTexturesResidentEXT, "glAreTexturesResidentEXT" },
{ (PROC)glBindTextureEXT, "glBindTextureEXT" },
{ (PROC)glDeleteTexturesEXT, "glDeleteTexturesEXT" },
{ (PROC)glGenTexturesEXT, "glGenTexturesEXT" },
{ (PROC)glIsTextureEXT, "glIsTextureEXT" },
{ (PROC)glPrioritizeTexturesEXT, "glPrioritizeTexturesEXT" },
{ (PROC)glCopyTexSubImage3DEXT, "glCopyTexSubImage3DEXT" },
{ (PROC)glTexImage3DEXT, "glTexImage3DEXT" },
{ (PROC)glTexSubImage3DEXT, "glTexSubImage3DEXT" },
{ (PROC)glPointParameterfEXT, "glPointParameterfEXT" },
{ (PROC)glPointParameterfvEXT, "glPointParameterfvEXT" },
{ (PROC)glLockArraysEXT, "glLockArraysEXT" },
{ (PROC)glUnlockArraysEXT, "glUnlockArraysEXT" },
{ NULL, "\0" }
};
GLD_extension GLD_multitexList[] = {
/*
{ (PROC)glMultiTexCoord1dSGIS, "glMTexCoord1dSGIS" },
{ (PROC)glMultiTexCoord1dvSGIS, "glMTexCoord1dvSGIS" },
{ (PROC)glMultiTexCoord1fSGIS, "glMTexCoord1fSGIS" },
{ (PROC)glMultiTexCoord1fvSGIS, "glMTexCoord1fvSGIS" },
{ (PROC)glMultiTexCoord1iSGIS, "glMTexCoord1iSGIS" },
{ (PROC)glMultiTexCoord1ivSGIS, "glMTexCoord1ivSGIS" },
{ (PROC)glMultiTexCoord1sSGIS, "glMTexCoord1sSGIS" },
{ (PROC)glMultiTexCoord1svSGIS, "glMTexCoord1svSGIS" },
{ (PROC)glMultiTexCoord2dSGIS, "glMTexCoord2dSGIS" },
{ (PROC)glMultiTexCoord2dvSGIS, "glMTexCoord2dvSGIS" },
{ (PROC)glMultiTexCoord2fSGIS, "glMTexCoord2fSGIS" },
{ (PROC)glMultiTexCoord2fvSGIS, "glMTexCoord2fvSGIS" },
{ (PROC)glMultiTexCoord2iSGIS, "glMTexCoord2iSGIS" },
{ (PROC)glMultiTexCoord2ivSGIS, "glMTexCoord2ivSGIS" },
{ (PROC)glMultiTexCoord2sSGIS, "glMTexCoord2sSGIS" },
{ (PROC)glMultiTexCoord2svSGIS, "glMTexCoord2svSGIS" },
{ (PROC)glMultiTexCoord3dSGIS, "glMTexCoord3dSGIS" },
{ (PROC)glMultiTexCoord3dvSGIS, "glMTexCoord3dvSGIS" },
{ (PROC)glMultiTexCoord3fSGIS, "glMTexCoord3fSGIS" },
{ (PROC)glMultiTexCoord3fvSGIS, "glMTexCoord3fvSGIS" },
{ (PROC)glMultiTexCoord3iSGIS, "glMTexCoord3iSGIS" },
{ (PROC)glMultiTexCoord3ivSGIS, "glMTexCoord3ivSGIS" },
{ (PROC)glMultiTexCoord3sSGIS, "glMTexCoord3sSGIS" },
{ (PROC)glMultiTexCoord3svSGIS, "glMTexCoord3svSGIS" },
{ (PROC)glMultiTexCoord4dSGIS, "glMTexCoord4dSGIS" },
{ (PROC)glMultiTexCoord4dvSGIS, "glMTexCoord4dvSGIS" },
{ (PROC)glMultiTexCoord4fSGIS, "glMTexCoord4fSGIS" },
{ (PROC)glMultiTexCoord4fvSGIS, "glMTexCoord4fvSGIS" },
{ (PROC)glMultiTexCoord4iSGIS, "glMTexCoord4iSGIS" },
{ (PROC)glMultiTexCoord4ivSGIS, "glMTexCoord4ivSGIS" },
{ (PROC)glMultiTexCoord4sSGIS, "glMTexCoord4sSGIS" },
{ (PROC)glMultiTexCoord4svSGIS, "glMTexCoord4svSGIS" },
{ (PROC)glMultiTexCoordPointerSGIS, "glMTexCoordPointerSGIS" },
{ (PROC)glSelectTextureSGIS, "glSelectTextureSGIS" },
{ (PROC)glSelectTextureCoordSetSGIS, "glSelectTextureCoordSetSGIS" },
*/
{ (PROC)glActiveTextureARB, "glActiveTextureARB" },
{ (PROC)glClientActiveTextureARB, "glClientActiveTextureARB" },
{ (PROC)glMultiTexCoord1dARB, "glMultiTexCoord1dARB" },
{ (PROC)glMultiTexCoord1dvARB, "glMultiTexCoord1dvARB" },
{ (PROC)glMultiTexCoord1fARB, "glMultiTexCoord1fARB" },
{ (PROC)glMultiTexCoord1fvARB, "glMultiTexCoord1fvARB" },
{ (PROC)glMultiTexCoord1iARB, "glMultiTexCoord1iARB" },
{ (PROC)glMultiTexCoord1ivARB, "glMultiTexCoord1ivARB" },
{ (PROC)glMultiTexCoord1sARB, "glMultiTexCoord1sARB" },
{ (PROC)glMultiTexCoord1svARB, "glMultiTexCoord1svARB" },
{ (PROC)glMultiTexCoord2dARB, "glMultiTexCoord2dARB" },
{ (PROC)glMultiTexCoord2dvARB, "glMultiTexCoord2dvARB" },
{ (PROC)glMultiTexCoord2fARB, "glMultiTexCoord2fARB" },
{ (PROC)glMultiTexCoord2fvARB, "glMultiTexCoord2fvARB" },
{ (PROC)glMultiTexCoord2iARB, "glMultiTexCoord2iARB" },
{ (PROC)glMultiTexCoord2ivARB, "glMultiTexCoord2ivARB" },
{ (PROC)glMultiTexCoord2sARB, "glMultiTexCoord2sARB" },
{ (PROC)glMultiTexCoord2svARB, "glMultiTexCoord2svARB" },
{ (PROC)glMultiTexCoord3dARB, "glMultiTexCoord3dARB" },
{ (PROC)glMultiTexCoord3dvARB, "glMultiTexCoord3dvARB" },
{ (PROC)glMultiTexCoord3fARB, "glMultiTexCoord3fARB" },
{ (PROC)glMultiTexCoord3fvARB, "glMultiTexCoord3fvARB" },
{ (PROC)glMultiTexCoord3iARB, "glMultiTexCoord3iARB" },
{ (PROC)glMultiTexCoord3ivARB, "glMultiTexCoord3ivARB" },
{ (PROC)glMultiTexCoord3sARB, "glMultiTexCoord3sARB" },
{ (PROC)glMultiTexCoord3svARB, "glMultiTexCoord3svARB" },
{ (PROC)glMultiTexCoord4dARB, "glMultiTexCoord4dARB" },
{ (PROC)glMultiTexCoord4dvARB, "glMultiTexCoord4dvARB" },
{ (PROC)glMultiTexCoord4fARB, "glMultiTexCoord4fARB" },
{ (PROC)glMultiTexCoord4fvARB, "glMultiTexCoord4fvARB" },
{ (PROC)glMultiTexCoord4iARB, "glMultiTexCoord4iARB" },
{ (PROC)glMultiTexCoord4ivARB, "glMultiTexCoord4ivARB" },
{ (PROC)glMultiTexCoord4sARB, "glMultiTexCoord4sARB" },
{ (PROC)glMultiTexCoord4svARB, "glMultiTexCoord4svARB" },
// Descent3 doesn't use correct string, hence this hack
{ (PROC)glMultiTexCoord4fARB, "glMultiTexCoord4f" },
// Quake2 SGIS multitexture
{ (PROC)gldSelectTextureSGIS, "glSelectTextureSGIS" },
{ (PROC)gldMTexCoord2fSGIS, "glMTexCoord2fSGIS" },
{ (PROC)gldMTexCoord2fvSGIS, "glMTexCoord2fvSGIS" },
{ NULL, "\0" }
};
//---------------------------------------------------------------------------
PROC gldGetProcAddress_DX(
LPCSTR a)
{
int i;
PROC proc = NULL;
for (i=0; GLD_extList[i].proc; i++) {
if (!strcmp(a, GLD_extList[i].name)) {
proc = GLD_extList[i].proc;
break;
}
}
if (glb.bMultitexture) {
for (i=0; GLD_multitexList[i].proc; i++) {
if (!strcmp(a, GLD_multitexList[i].name)) {
proc = GLD_multitexList[i].proc;
break;
}
}
}
gldLogPrintf(GLDLOG_INFO, "GetProcAddress: %s (%s)", a, proc ? "OK" : "Failed");
return proc;
}
//---------------------------------------------------------------------------
void gldEnableExtensions_DX8(
struct gl_context *ctx)
{
GLuint i;
// Mesa enables some extensions by default.
// This table decides which ones we want to switch off again.
// NOTE: GL_EXT_compiled_vertex_array appears broken.
const char *gld_disable_extensions[] = {
// "GL_ARB_transpose_matrix",
// "GL_EXT_compiled_vertex_array",
// "GL_EXT_polygon_offset",
// "GL_EXT_rescale_normal",
"GL_EXT_texture3D",
// "GL_NV_texgen_reflection",
NULL
};
const char *gld_multitex_extensions[] = {
"GL_ARB_multitexture", // Quake 3
NULL
};
// Quake 2 engines
const char *szGL_SGIS_multitexture = "GL_SGIS_multitexture";
const char *gld_enable_extensions[] = {
"GL_EXT_texture_env_add", // Quake 3
"GL_ARB_texture_env_add", // Quake 3
NULL
};
for (i=0; gld_disable_extensions[i]; i++) {
_mesa_disable_extension(ctx, gld_disable_extensions[i]);
}
for (i=0; gld_enable_extensions[i]; i++) {
_mesa_enable_extension(ctx, gld_enable_extensions[i]);
}
if (glb.bMultitexture) {
for (i=0; gld_multitex_extensions[i]; i++) {
_mesa_enable_extension(ctx, gld_multitex_extensions[i]);
}
// GL_SGIS_multitexture
// NOTE: Quake2 ran *slower* with this enabled, so I've
// disabled it for now.
// Fair bit slower on GeForce256,
// Much slower on 3dfx Voodoo5 5500.
// _mesa_add_extension(ctx, GL_TRUE, szGL_SGIS_multitexture, 0);
}
_mesa_enable_imaging_extensions(ctx);
_mesa_enable_1_3_extensions(ctx);
_mesa_enable_1_4_extensions(ctx);
}
//---------------------------------------------------------------------------

View file

@ -1,77 +0,0 @@
/****************************************************************************
*
* Mesa 3-D graphics library
* Direct3D Driver Interface
*
* ========================================================================
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* ======================================================================
*
* Language: ANSI C
* Environment: Windows 9x/2000/XP/XBox (Win32)
*
* Description: Mesa transformation pipeline with GLDirect fastpath
*
****************************************************************************/
//#include "../GLDirect.h"
#include "dglcontext.h"
#include "ddlog.h"
#include "gld_dx8.h"
#include "tnl/tnl.h"
#include "tnl/t_context.h"
#include "tnl/t_pipeline.h"
//---------------------------------------------------------------------------
extern struct tnl_pipeline_stage _gld_d3d_render_stage;
extern struct tnl_pipeline_stage _gld_mesa_render_stage;
static const struct tnl_pipeline_stage *gld_pipeline[] = {
&_gld_d3d_render_stage, // Direct3D TnL
&_tnl_vertex_transform_stage,
&_tnl_normal_transform_stage,
&_tnl_lighting_stage,
&_tnl_fog_coordinate_stage, /* TODO: Omit fog stage. ??? */
&_tnl_texgen_stage,
&_tnl_texture_transform_stage,
&_tnl_point_attenuation_stage,
&_gld_mesa_render_stage, // Mesa TnL, D3D rendering
0,
};
//---------------------------------------------------------------------------
void gldInstallPipeline_DX8(
struct gl_context *ctx)
{
// Remove any existing pipeline stages,
// then install GLDirect pipeline stages.
_tnl_destroy_pipeline(ctx);
_tnl_install_pipeline(ctx, gld_pipeline);
}
//---------------------------------------------------------------------------

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,249 +0,0 @@
/****************************************************************************
*
* Mesa 3-D graphics library
* Direct3D Driver Interface
*
* ========================================================================
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* ======================================================================
*
* Language: ANSI C
* Environment: Windows 9x/2000/XP/XBox (Win32)
*
* Description: GLDirect fastpath pipeline stage
*
****************************************************************************/
//---------------------------------------------------------------------------
//#include "../GLDirect.h"
//#include "../gld_log.h"
//#include "gld_dx8.h"
#include "dglcontext.h"
#include "ddlog.h"
#include "gld_dx8.h"
//---------------------------------------------------------------------------
#include "glheader.h"
#include "context.h"
#include "macros.h"
// #include "mem.h"
#include "mtypes.h"
//#include "mmath.h"
#include "math/m_matrix.h"
#include "math/m_xform.h"
#include "tnl/t_pipeline.h"
//---------------------------------------------------------------------------
__inline void _gldSetVertexShaderConstants(
struct gl_context *ctx,
GLD_driver_dx8 *gld)
{
D3DXMATRIX mat, matView, matProj;
GLfloat *pM;
// Mesa 5: Altered to a Stack
//pM = ctx->ModelView.m;
pM = ctx->ModelviewMatrixStack.Top->m;
matView._11 = pM[0];
matView._12 = pM[1];
matView._13 = pM[2];
matView._14 = pM[3];
matView._21 = pM[4];
matView._22 = pM[5];
matView._23 = pM[6];
matView._24 = pM[7];
matView._31 = pM[8];
matView._32 = pM[9];
matView._33 = pM[10];
matView._34 = pM[11];
matView._41 = pM[12];
matView._42 = pM[13];
matView._43 = pM[14];
matView._44 = pM[15];
// Mesa 5: Altered to a Stack
//pM = ctx->ProjectionMatrix.m;
pM = ctx->ProjectionMatrixStack.Top->m;
matProj._11 = pM[0];
matProj._12 = pM[1];
matProj._13 = pM[2];
matProj._14 = pM[3];
matProj._21 = pM[4];
matProj._22 = pM[5];
matProj._23 = pM[6];
matProj._24 = pM[7];
matProj._31 = pM[8];
matProj._32 = pM[9];
matProj._33 = pM[10];
matProj._34 = pM[11];
matProj._41 = pM[12];
matProj._42 = pM[13];
matProj._43 = pM[14];
matProj._44 = pM[15];
D3DXMatrixMultiply( &mat, &matView, &matProj );
D3DXMatrixTranspose( &mat, &mat );
_GLD_DX8_DEV(SetVertexShaderConstant(gld->pDev, 0, &mat, 4));
}
//---------------------------------------------------------------------------
static GLboolean gld_d3d_render_stage_run(
struct gl_context *ctx,
struct tnl_pipeline_stage *stage)
{
GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
TNLcontext *tnl;
struct vertex_buffer *VB;
tnl_render_func *tab;
GLint pass;
GLD_pb_dx8 *gldPB = &gld->PB3d;
/*
static int count = 0;
count++;
if (count != 2)
return GL_FALSE;
*/
// The "check" function should disable this stage,
// but we'll test gld->bUseMesaTnL anyway.
if (gld->bUseMesaTnL) {
// Do nothing in this stage, but continue pipeline
return GL_TRUE;
}
tnl = TNL_CONTEXT(ctx);
VB = &tnl->vb;
pass = 0;
tnl->Driver.Render.Start( ctx );
#if 0
// For debugging: Useful to see if an app passes colour data in
// an unusual format.
switch (VB->AttribPtr[_TNL_ATTRIB_COLOR0]->Type) {
case GL_FLOAT:
ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_FLOAT\n");
break;
case GL_UNSIGNED_BYTE:
ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_UNSIGNED_BYTE\n");
break;
default:
ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: *?*\n");
break;
}
#endif
tnl->Driver.Render.Points = gld_Points3D_DX8;
if (ctx->_TriangleCaps & DD_FLATSHADE) {
tnl->Driver.Render.Line = gld_Line3DFlat_DX8;
tnl->Driver.Render.Triangle = gld_Triangle3DFlat_DX8;
tnl->Driver.Render.Quad = gld_Quad3DFlat_DX8;
} else {
tnl->Driver.Render.Line = gld_Line3DSmooth_DX8;
tnl->Driver.Render.Triangle = gld_Triangle3DSmooth_DX8;
tnl->Driver.Render.Quad = gld_Quad3DSmooth_DX8;
}
_GLD_DX8_VB(Lock(gldPB->pVB, 0, 0, &gldPB->pPoints, D3DLOCK_DISCARD));
gldPB->nPoints = gldPB->nLines = gldPB->nTriangles = 0;
// Allocate primitive pointers
// gldPB->pPoints is always first
gldPB->pLines = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstLine);
gldPB->pTriangles = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstTriangle);
ASSERT(tnl->Driver.Render.BuildVertices);
ASSERT(tnl->Driver.Render.PrimitiveNotify);
ASSERT(tnl->Driver.Render.Points);
ASSERT(tnl->Driver.Render.Line);
ASSERT(tnl->Driver.Render.Triangle);
ASSERT(tnl->Driver.Render.Quad);
ASSERT(tnl->Driver.Render.ResetLineStipple);
ASSERT(tnl->Driver.Render.Interp);
ASSERT(tnl->Driver.Render.CopyPV);
ASSERT(tnl->Driver.Render.ClippedLine);
ASSERT(tnl->Driver.Render.ClippedPolygon);
ASSERT(tnl->Driver.Render.Finish);
tab = (VB->Elts ? tnl->Driver.Render.PrimTabElts : tnl->Driver.Render.PrimTabVerts);
do {
GLuint i, length, flags = 0;
for (i = 0 ; !(flags & PRIM_END) ; i += length)
{
flags = VB->Primitive[i].mode;
length= VB->Primitive[i].count;
ASSERT(length || (flags & PRIM_END));
ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1);
if (length)
tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags );
}
} while (tnl->Driver.Render.Multipass &&
tnl->Driver.Render.Multipass( ctx, ++pass ));
_GLD_DX8_VB(Unlock(gldPB->pVB));
_GLD_DX8_DEV(SetStreamSource(gld->pDev, 0, gldPB->pVB, gldPB->dwStride));
_GLD_DX8_DEV(SetTransform(gld->pDev, D3DTS_PROJECTION, &gld->matProjection));
_GLD_DX8_DEV(SetTransform(gld->pDev, D3DTS_WORLD, &gld->matModelView));
if (gldPB->nPoints) {
_GLD_DX8_DEV(DrawPrimitive(gld->pDev, D3DPT_POINTLIST, 0, gldPB->nPoints));
gldPB->nPoints = 0;
}
if (gldPB->nLines) {
_GLD_DX8_DEV(DrawPrimitive(gld->pDev, D3DPT_LINELIST, gldPB->iFirstLine, gldPB->nLines));
gldPB->nLines = 0;
}
if (gldPB->nTriangles) {
_GLD_DX8_DEV(DrawPrimitive(gld->pDev, D3DPT_TRIANGLELIST, gldPB->iFirstTriangle, gldPB->nTriangles));
gldPB->nTriangles = 0;
}
return GL_FALSE; /* finished the pipe */
}
//---------------------------------------------------------------------------
const struct tnl_pipeline_stage _gld_d3d_render_stage =
{
"gld_d3d_render_stage",
NULL,
NULL,
NULL,
NULL,
gld_d3d_render_stage_run /* run */
};
//---------------------------------------------------------------------------

View file

@ -1,448 +0,0 @@
/*
* Mesa 3-D graphics library
* Version: 3.5
*
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
* Keith Whitwell <keithw@valinux.com>
*/
/*
* Render whole vertex buffers, including projection of vertices from
* clip space and clipping of primitives.
*
* This file makes calls to project vertices and to the point, line
* and triangle rasterizers via the function pointers:
*
* context->Driver.Render.*
*
*/
//---------------------------------------------------------------------------
//#include "../GLDirect.h"
//#include "../gld_log.h"
//#include "gld_dx8.h"
#include "dglcontext.h"
#include "ddlog.h"
#include "gld_dx8.h"
//---------------------------------------------------------------------------
#include "glheader.h"
#include "context.h"
#include "macros.h"
// #include "mem.h"
#include "mtypes.h"
//#include "mmath.h"
#include "math/m_matrix.h"
#include "math/m_xform.h"
#include "tnl/t_pipeline.h"
/**********************************************************************/
/* Clip single primitives */
/**********************************************************************/
#if defined(USE_IEEE)
#define NEGATIVE(x) (GET_FLOAT_BITS(x) & (1<<31))
//#define DIFFERENT_SIGNS(x,y) ((GET_FLOAT_BITS(x) ^ GET_FLOAT_BITS(y)) & (1<<31))
#else
#define NEGATIVE(x) (x < 0)
//#define DIFFERENT_SIGNS(x,y) (x * y <= 0 && x - y != 0)
/* Could just use (x*y<0) except for the flatshading requirements.
* Maybe there's a better way?
*/
#endif
#define W(i) coord[i][3]
#define Z(i) coord[i][2]
#define Y(i) coord[i][1]
#define X(i) coord[i][0]
#define SIZE 4
#define TAG(x) x##_4
#include "tnl/t_vb_cliptmp.h"
/**********************************************************************/
/* Clip and render whole begin/end objects */
/**********************************************************************/
#define NEED_EDGEFLAG_SETUP (ctx->_TriangleCaps & DD_TRI_UNFILLED)
#define EDGEFLAG_GET(idx) VB->EdgeFlag[idx]
#define EDGEFLAG_SET(idx, val) VB->EdgeFlag[idx] = val
/* Vertices, with the possibility of clipping.
*/
#define RENDER_POINTS( start, count ) \
tnl->Driver.Render.Points( ctx, start, count )
#define RENDER_LINE( v1, v2 ) \
do { \
GLubyte c1 = mask[v1], c2 = mask[v2]; \
GLubyte ormask = c1|c2; \
if (!ormask) \
LineFunc( ctx, v1, v2 ); \
else if (!(c1 & c2 & 0x3f)) \
clip_line_4( ctx, v1, v2, ormask ); \
} while (0)
#define RENDER_TRI( v1, v2, v3 ) \
do { \
GLubyte c1 = mask[v1], c2 = mask[v2], c3 = mask[v3]; \
GLubyte ormask = c1|c2|c3; \
if (!ormask) \
TriangleFunc( ctx, v1, v2, v3 ); \
else if (!(c1 & c2 & c3 & 0x3f)) \
clip_tri_4( ctx, v1, v2, v3, ormask ); \
} while (0)
#define RENDER_QUAD( v1, v2, v3, v4 ) \
do { \
GLubyte c1 = mask[v1], c2 = mask[v2]; \
GLubyte c3 = mask[v3], c4 = mask[v4]; \
GLubyte ormask = c1|c2|c3|c4; \
if (!ormask) \
QuadFunc( ctx, v1, v2, v3, v4 ); \
else if (!(c1 & c2 & c3 & c4 & 0x3f)) \
clip_quad_4( ctx, v1, v2, v3, v4, ormask ); \
} while (0)
#define LOCAL_VARS \
TNLcontext *tnl = TNL_CONTEXT(ctx); \
struct vertex_buffer *VB = &tnl->vb; \
const GLuint * const elt = VB->Elts; \
const GLubyte *mask = VB->ClipMask; \
const GLuint sz = VB->ClipPtr->size; \
const tnl_line_func LineFunc = tnl->Driver.Render.Line; \
const tnl_triangle_func TriangleFunc = tnl->Driver.Render.Triangle; \
const tnl_quad_func QuadFunc = tnl->Driver.Render.Quad; \
const GLboolean stipple = ctx->Line.StippleFlag; \
(void) (LineFunc && TriangleFunc && QuadFunc); \
(void) elt; (void) mask; (void) sz; (void) stipple;
#define TAG(x) clip_##x##_verts
#define INIT(x) tnl->Driver.Render.PrimitiveNotify( ctx, x )
#define RESET_STIPPLE if (stipple) tnl->Driver.Render.ResetLineStipple( ctx )
#define PRESERVE_VB_DEFS
#include "tnl/t_vb_rendertmp.h"
/* Elts, with the possibility of clipping.
*/
#undef ELT
#undef TAG
#define ELT(x) elt[x]
#define TAG(x) clip_##x##_elts
#include "tnl/t_vb_rendertmp.h"
/* TODO: do this for all primitives, verts and elts:
*/
static void clip_elt_triangles( struct gl_context *ctx,
GLuint start,
GLuint count,
GLuint flags )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
tnl_render_func render_tris = tnl->Driver.Render.PrimTabElts[GL_TRIANGLES];
struct vertex_buffer *VB = &tnl->vb;
const GLuint * const elt = VB->Elts;
GLubyte *mask = VB->ClipMask;
GLuint last = count-2;
GLuint j;
(void) flags;
tnl->Driver.Render.PrimitiveNotify( ctx, GL_TRIANGLES );
for (j=start; j < last; j+=3 ) {
GLubyte c1 = mask[elt[j]];
GLubyte c2 = mask[elt[j+1]];
GLubyte c3 = mask[elt[j+2]];
GLubyte ormask = c1|c2|c3;
if (ormask) {
if (start < j)
render_tris( ctx, start, j, 0 );
if (!(c1&c2&c3&0x3f))
clip_tri_4( ctx, elt[j], elt[j+1], elt[j+2], ormask );
start = j+3;
}
}
if (start < j)
render_tris( ctx, start, j, 0 );
}
/**********************************************************************/
/* Render whole begin/end objects */
/**********************************************************************/
#define NEED_EDGEFLAG_SETUP (ctx->_TriangleCaps & DD_TRI_UNFILLED)
#define EDGEFLAG_GET(idx) VB->EdgeFlag[idx]
#define EDGEFLAG_SET(idx, val) VB->EdgeFlag[idx] = val
/* Vertices, no clipping.
*/
#define RENDER_POINTS( start, count ) \
tnl->Driver.Render.Points( ctx, start, count )
#define RENDER_LINE( v1, v2 ) \
LineFunc( ctx, v1, v2 )
#define RENDER_TRI( v1, v2, v3 ) \
TriangleFunc( ctx, v1, v2, v3 )
#define RENDER_QUAD( v1, v2, v3, v4 ) \
QuadFunc( ctx, v1, v2, v3, v4 )
#define TAG(x) _gld_tnl_##x##_verts
#define LOCAL_VARS \
TNLcontext *tnl = TNL_CONTEXT(ctx); \
struct vertex_buffer *VB = &tnl->vb; \
const GLuint * const elt = VB->Elts; \
const tnl_line_func LineFunc = tnl->Driver.Render.Line; \
const tnl_triangle_func TriangleFunc = tnl->Driver.Render.Triangle; \
const tnl_quad_func QuadFunc = tnl->Driver.Render.Quad; \
(void) (LineFunc && TriangleFunc && QuadFunc); \
(void) elt;
#define RESET_STIPPLE tnl->Driver.Render.ResetLineStipple( ctx )
#define INIT(x) tnl->Driver.Render.PrimitiveNotify( ctx, x )
#define RENDER_TAB_QUALIFIER
#define PRESERVE_VB_DEFS
#include "tnl/t_vb_rendertmp.h"
/* Elts, no clipping.
*/
#undef ELT
#define TAG(x) _gld_tnl_##x##_elts
#define ELT(x) elt[x]
#include "tnl/t_vb_rendertmp.h"
/**********************************************************************/
/* Helper functions for drivers */
/**********************************************************************/
/*
void _tnl_RenderClippedPolygon( struct gl_context *ctx, const GLuint *elts, GLuint n )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct vertex_buffer *VB = &tnl->vb;
GLuint *tmp = VB->Elts;
VB->Elts = (GLuint *)elts;
tnl->Driver.Render.PrimTabElts[GL_POLYGON]( ctx, 0, n, PRIM_BEGIN|PRIM_END );
VB->Elts = tmp;
}
void _tnl_RenderClippedLine( struct gl_context *ctx, GLuint ii, GLuint jj )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
tnl->Driver.Render.Line( ctx, ii, jj );
}
*/
/**********************************************************************/
/* Clip and render whole vertex buffers */
/**********************************************************************/
tnl_points_func _gldSetupPoints[4] = {
gld_Points2D_DX8,
gld_Points2D_DX8,
gld_Points2D_DX8,
gld_Points2D_DX8
};
tnl_line_func _gldSetupLine[4] = {
gld_Line2DFlat_DX8,
gld_Line2DSmooth_DX8,
gld_Line2DFlat_DX8,
gld_Line2DSmooth_DX8,
};
tnl_triangle_func _gldSetupTriangle[4] = {
gld_Triangle2DFlat_DX8,
gld_Triangle2DSmooth_DX8,
gld_Triangle2DFlatExtras_DX8,
gld_Triangle2DSmoothExtras_DX8
};
tnl_quad_func _gldSetupQuad[4] = {
gld_Quad2DFlat_DX8,
gld_Quad2DSmooth_DX8,
gld_Quad2DFlatExtras_DX8,
gld_Quad2DSmoothExtras_DX8
};
//---------------------------------------------------------------------------
static GLboolean _gld_mesa_render_stage_run(
struct gl_context *ctx,
struct tnl_pipeline_stage *stage)
{
GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
GLD_driver_dx8 *gld = GLD_GET_DX8_DRIVER(gldCtx);
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct vertex_buffer *VB = &tnl->vb;
tnl_render_func *tab;
GLint pass = 0;
GLD_pb_dx8 *gldPB;
/* Allow the drivers to lock before projected verts are built so
* that window coordinates are guarenteed not to change before
* rendering.
*/
ASSERT(tnl->Driver.Render.Start);
tnl->Driver.Render.Start( ctx );
// NOTE: Setting D3DRS_SOFTWAREVERTEXPROCESSING for a mixed-mode device resets
// stream, indices and shader to default values of NULL or 0.
/* if ((ctx->_TriangleCaps & DD_TRI_LIGHT_TWOSIDE) &&
gld->VStwosidelight.hShader &&
!ctx->Fog.Enabled)
{
IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, !gld->VStwosidelight.bHardware);
_GLD_DX8_DEV(SetVertexShader(gld->pDev, gld->VStwosidelight.hShader));
gldPB = &gld->PBtwosidelight;
tnl->Driver.Render.Points = gld_Points2DTwoside_DX8;
if (ctx->_TriangleCaps & DD_FLATSHADE) {
tnl->Driver.Render.Line = gld_Line2DFlatTwoside_DX8;
tnl->Driver.Render.Triangle = gld_Triangle2DFlatTwoside_DX8;
tnl->Driver.Render.Quad = gld_Quad2DFlatTwoside_DX8;
} else {
tnl->Driver.Render.Line = gld_Line2DSmoothTwoside_DX8;
tnl->Driver.Render.Triangle = gld_Triangle2DSmoothTwoside_DX8;
tnl->Driver.Render.Quad = gld_Quad2DSmoothTwoside_DX8;
}
} else {*/
IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, TRUE);
gldPB = &gld->PB2d;
_GLD_DX8_DEV(SetVertexShader(gld->pDev, gldPB->dwFVF));
tnl->Driver.Render.Points = _gldSetupPoints[gld->iSetupFunc];
tnl->Driver.Render.Line = _gldSetupLine[gld->iSetupFunc];
tnl->Driver.Render.Triangle = _gldSetupTriangle[gld->iSetupFunc];
tnl->Driver.Render.Quad = _gldSetupQuad[gld->iSetupFunc];
// }
_GLD_DX8_VB(Lock(gldPB->pVB, 0, 0, &gldPB->pPoints, D3DLOCK_DISCARD));
gldPB->nPoints = gldPB->nLines = gldPB->nTriangles = 0;
// Allocate primitive pointers
// gldPB->pPoints is always first
gldPB->pLines = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstLine);
gldPB->pTriangles = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstTriangle);
ASSERT(tnl->Driver.Render.BuildVertices);
ASSERT(tnl->Driver.Render.PrimitiveNotify);
ASSERT(tnl->Driver.Render.Points);
ASSERT(tnl->Driver.Render.Line);
ASSERT(tnl->Driver.Render.Triangle);
ASSERT(tnl->Driver.Render.Quad);
ASSERT(tnl->Driver.Render.ResetLineStipple);
ASSERT(tnl->Driver.Render.Interp);
ASSERT(tnl->Driver.Render.CopyPV);
ASSERT(tnl->Driver.Render.ClippedLine);
ASSERT(tnl->Driver.Render.ClippedPolygon);
ASSERT(tnl->Driver.Render.Finish);
tnl->Driver.Render.BuildVertices( ctx, 0, VB->Count, ~0 );
if (VB->ClipOrMask) {
tab = VB->Elts ? clip_render_tab_elts : clip_render_tab_verts;
clip_render_tab_elts[GL_TRIANGLES] = clip_elt_triangles;
}
else {
tab = (VB->Elts ?
tnl->Driver.Render.PrimTabElts :
tnl->Driver.Render.PrimTabVerts);
}
do {
GLuint i, length, flags = 0;
for (i = 0 ; !(flags & PRIM_END) ; i += length) {
flags = VB->Primitive[i].mode;
length= VB->Primitive[i].count;
ASSERT(length || (flags & PRIM_END));
ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1);
if (length)
tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags );
}
} while (tnl->Driver.Render.Multipass &&
tnl->Driver.Render.Multipass( ctx, ++pass ));
// tnl->Driver.Render.Finish( ctx );
_GLD_DX8_VB(Unlock(gldPB->pVB));
_GLD_DX8_DEV(SetStreamSource(gld->pDev, 0, gldPB->pVB, gldPB->dwStride));
if (gldPB->nPoints) {
_GLD_DX8_DEV(DrawPrimitive(gld->pDev, D3DPT_POINTLIST, 0, gldPB->nPoints));
gldPB->nPoints = 0;
}
if (gldPB->nLines) {
_GLD_DX8_DEV(DrawPrimitive(gld->pDev, D3DPT_LINELIST, gldPB->iFirstLine, gldPB->nLines));
gldPB->nLines = 0;
}
if (gldPB->nTriangles) {
_GLD_DX8_DEV(DrawPrimitive(gld->pDev, D3DPT_TRIANGLELIST, gldPB->iFirstTriangle, gldPB->nTriangles));
gldPB->nTriangles = 0;
}
return GL_FALSE; /* finished the pipe */
}
/**********************************************************************/
/* Render pipeline stage */
/**********************************************************************/
//---------------------------------------------------------------------------
const struct tnl_pipeline_stage _gld_mesa_render_stage =
{
"gld_mesa_render_stage",
NULL,
NULL,
NULL,
NULL,
_gld_mesa_render_stage_run /* run */
};
//---------------------------------------------------------------------------

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,327 +0,0 @@
/****************************************************************************
*
* Mesa 3-D graphics library
* Direct3D Driver Interface
*
* ========================================================================
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* ======================================================================
*
* Language: ANSI C
* Environment: Windows 9x/2000/XP/XBox (Win32)
*
* Description: GLDirect Direct3D 9.0 header file
*
****************************************************************************/
#ifndef _GLD_DX9_H
#define _GLD_DX9_H
//---------------------------------------------------------------------------
// Windows includes
//---------------------------------------------------------------------------
//#ifndef STRICT
//#define STRICT
//#endif
//#define WIN32_LEAN_AND_MEAN
//#include <windows.h>
#include <d3d9.h>
#include <d3dx9.h>
// MS screwed up with the DX8.1 SDK - there's no compile-time
// method of compiling for 8.0 via the 8.1 SDK unless you
// "make sure you don't use any 8.1 interfaces".
// We CAN use 8.1 D3DX static functions, though - just not new 8.1 interfaces.
//
// D3D_SDK_VERSION is 120 for 8.0 (supported by Windows 95).
// D3D_SDK_VERSION is 220 for 8.1 (NOT supported by Windows 95).
//
//#define D3D_SDK_VERSION_DX9_SUPPORT_WIN95 120
//#define D3D_SDK_VERSION_DX91 220
// Typedef for obtaining function from d3d8.dll
typedef IDirect3D9* (WINAPI *FNDIRECT3DCREATE9) (UINT);
//---------------------------------------------------------------------------
// Defines
//---------------------------------------------------------------------------
#ifdef _DEBUG
#define _GLD_TEST_HRESULT(h) \
{ \
HRESULT _hr = (h); \
if (FAILED(_hr)) { \
gldLogError(GLDLOG_ERROR, #h, _hr); \
} \
}
#define _GLD_DX9(func) _GLD_TEST_HRESULT(IDirect3D9_##func##)
#define _GLD_DX9_DEV(func) _GLD_TEST_HRESULT(IDirect3DDevice9_##func##)
#define _GLD_DX9_VB(func) _GLD_TEST_HRESULT(IDirect3DVertexBuffer9_##func##)
#define _GLD_DX9_TEX(func) _GLD_TEST_HRESULT(IDirect3DTexture9_##func##)
#else
#define _GLD_DX9(func) IDirect3D9_##func
#define _GLD_DX9_DEV(func) IDirect3DDevice9_##func
#define _GLD_DX9_VB(func) IDirect3DVertexBuffer9_##func
#define _GLD_DX9_TEX(func) IDirect3DTexture9_##func
#endif
#define SAFE_RELEASE(p) \
{ \
if (p) { \
(p)->lpVtbl->Release(p); \
(p) = NULL; \
} \
}
#define SAFE_RELEASE_VB9(p) \
{ \
if (p) { \
IDirect3DVertexBuffer9_Release((p)); \
(p) = NULL; \
} \
}
#define SAFE_RELEASE_SURFACE9(p) \
{ \
if (p) { \
IDirect3DSurface9_Release((p)); \
(p) = NULL; \
} \
}
// Setup index.
enum {
GLD_SI_FLAT = 0,
GLD_SI_SMOOTH = 1,
GLD_SI_FLAT_EXTRAS = 2,
GLD_SI_SMOOTH_EXTRAS = 3,
};
/*
// Internal pipeline
typedef enum {
GLD_PIPELINE_MESA = 0, // Mesa pipeline
GLD_PIPELINE_D3D_FVF = 1, // Direct3D Fixed-function pipeline
GLD_PIPELINE_D3D_VS_TWOSIDE = 2 // Direct3D two-sided-lighting vertex shader
} GLD_tnl_pipeline;
*/
//---------------------------------------------------------------------------
// Vertex definitions for Fixed-Function pipeline
//---------------------------------------------------------------------------
//
// NOTE: If the number of texture units is altered then most of
// the texture code will need to be revised.
//
#define GLD_MAX_TEXTURE_UNITS_DX9 2
//
// 2D vertex transformed by Mesa
//
#define GLD_FVF_2D_VERTEX ( D3DFVF_XYZRHW | \
D3DFVF_DIFFUSE | \
D3DFVF_SPECULAR | \
D3DFVF_TEX2)
typedef struct {
FLOAT x, y; // 2D raster coords
FLOAT sz; // Screen Z (depth)
FLOAT rhw; // Reciprocal homogenous W
DWORD diffuse; // Diffuse colour
DWORD specular; // For separate-specular support
FLOAT t0_u, t0_v; // 1st set of texture coords
FLOAT t1_u, t1_v; // 2nd set of texture coords
} GLD_2D_VERTEX;
//
// 3D vertex transformed by Direct3D
//
#define GLD_FVF_3D_VERTEX ( D3DFVF_XYZ | \
D3DFVF_DIFFUSE | \
D3DFVF_TEX2)
typedef struct {
D3DXVECTOR3 Position; // XYZ Vector in object space
D3DCOLOR Diffuse; // Diffuse colour
D3DXVECTOR2 TexUnit0; // Texture unit 0
D3DXVECTOR2 TexUnit1; // Texture unit 1
} GLD_3D_VERTEX;
//---------------------------------------------------------------------------
// Vertex Shaders
//---------------------------------------------------------------------------
/*
// DX8 Vertex Shader
typedef struct {
DWORD hShader; // If NULL, shader is invalid and cannot be used
BOOL bHardware; // If TRUE then shader was created for hardware,
// otherwise shader was created for software.
} GLD_vertexShader;
*/
//---------------------------------------------------------------------------
// Structs
//---------------------------------------------------------------------------
// This keeps a count of how many times we choose each individual internal
// pathway. Useful for seeing if a certain pathway was ever used by an app, and
// how much each pathway is biased.
// Zero the members at context creation and dump stats at context deletion.
typedef struct {
// Note: DWORD is probably too small
ULARGE_INTEGER qwMesa; // Mesa TnL pipeline
ULARGE_INTEGER qwD3DFVF; // Direct3D Fixed-Function pipeline
// ULARGE_INTEGER dwD3D2SVS; // Direct3D Two-Sided Vertex Shader pipeline
} GLD_pipeline_usage;
// GLDirect Primitive Buffer (points, lines, triangles and quads)
typedef struct {
// Data for IDirect3DDevice9::CreateVertexBuffer()
DWORD dwStride; // Stride of vertex
DWORD dwUsage; // Usage flags
DWORD dwFVF; // Direct3D Flexible Vertex Format
DWORD dwPool; // Pool flags
IDirect3DVertexBuffer9 *pVB; // Holds points, lines, tris and quads.
// Point list is assumed to be at start of buffer
DWORD iFirstLine; // Index of start of line list
DWORD iFirstTriangle; // Index of start of triangle list
BYTE *pPoints; // Pointer to next free point
BYTE *pLines; // Pointer to next free line
BYTE *pTriangles; // Pointer to next free triangle
DWORD nPoints; // Number of points ready to render
DWORD nLines; // Number of lines ready to render
DWORD nTriangles; // Number of triangles ready to render
} GLD_pb_dx9;
// GLDirect DX9 driver data
typedef struct {
// GLDirect vars
BOOL bDoublebuffer; // Doublebuffer (otherwise single-buffered)
BOOL bDepthStencil; // Depth buffer needed (stencil optional)
D3DFORMAT RenderFormat; // Format of back/front buffer
D3DFORMAT DepthFormat; // Format of depth/stencil
// float fFlipWindowY; // Value for flipping viewport Y coord
// Direct3D vars
D3DCAPS9 d3dCaps9;
BOOL bHasHWTnL; // Device has Hardware Transform/Light?
IDirect3D9 *pD3D; // Base Direct3D9 interface
IDirect3DDevice9 *pDev; // Direct3D9 Device interface
GLD_pb_dx9 PB2d; // Vertices transformed by Mesa
GLD_pb_dx9 PB3d; // Vertices transformed by Direct3D
D3DPRIMITIVETYPE d3dpt; // Current Direct3D primitive type
D3DXMATRIX matProjection; // Projection matrix for D3D TnL
D3DXMATRIX matModelView; // Model/View matrix for D3D TnL
int iSetupFunc; // Which setup functions to use
BOOL bUseMesaTnL; // Whether to use Mesa or D3D for TnL
// Direct3D vars for two-sided lighting
// GLD_vertexShader VStwosidelight; // Vertex Shader for two-sided lighting
// D3DXMATRIX matWorldViewProj;// World/View/Projection matrix for shaders
// GLD_tnl_pipeline TnLPipeline; // Index of current internal pipeline
GLD_pipeline_usage PipelineUsage;
BOOL bCanScissor; // Scissor test - new for DX9
} GLD_driver_dx9;
#define GLD_GET_DX9_DRIVER(c) (GLD_driver_dx9*)(c)->glPriv
//---------------------------------------------------------------------------
// Function prototypes
//---------------------------------------------------------------------------
PROC gldGetProcAddress_DX9(LPCSTR a);
void gldEnableExtensions_DX9(struct gl_context *ctx);
void gldInstallPipeline_DX9(struct gl_context *ctx);
void gldSetupDriverPointers_DX9(struct gl_context *ctx);
//void gldResizeBuffers_DX9(struct gl_context *ctx);
void gldResizeBuffers_DX9(struct gl_framebuffer *fb);
// Texture functions
void gldCopyTexImage1D_DX9(struct gl_context *ctx, GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border);
void gldCopyTexImage2D_DX9(struct gl_context *ctx, GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
void gldCopyTexSubImage1D_DX9(struct gl_context *ctx, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width );
void gldCopyTexSubImage2D_DX9(struct gl_context *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height );
void gldCopyTexSubImage3D_DX9(struct gl_context *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height );
void gld_NEW_TEXTURE_DX9(struct gl_context *ctx);
void gld_DrawPixels_DX9(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels);
void gld_ReadPixels_DX9(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, const struct gl_pixelstore_attrib *unpack, GLvoid *dest);
void gld_CopyPixels_DX9(struct gl_context *ctx, GLint srcx, GLint srcy, GLsizei width, GLsizei height, GLint dstx, GLint dsty, GLenum type);
void gld_Bitmap_DX9(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei height, const struct gl_pixelstore_attrib *unpack, const GLubyte *bitmap);
const struct gl_texture_format* gld_ChooseTextureFormat_DX9(struct gl_context *ctx, GLint internalFormat, GLenum srcFormat, GLenum srcType);
void gld_TexImage2D_DX9(struct gl_context *ctx, GLenum target, GLint level, GLint internalFormat, GLint width, GLint height, GLint border, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *tObj, struct gl_texture_image *texImage);
void gld_TexImage1D_DX9(struct gl_context *ctx, GLenum target, GLint level, GLint internalFormat, GLint width, GLint border, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage );
void gld_TexSubImage2D_DX9( struct gl_context *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage );
void gld_TexSubImage1D_DX9(struct gl_context *ctx, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage);
void gld_DeleteTexture_DX9(struct gl_context *ctx, struct gl_texture_object *tObj);
void gld_ResetLineStipple_DX9(struct gl_context *ctx);
// 2D primitive functions
void gld_Points2D_DX9(struct gl_context *ctx, GLuint first, GLuint last);
void gld_Line2DFlat_DX9(struct gl_context *ctx, GLuint v0, GLuint v1);
void gld_Line2DSmooth_DX9(struct gl_context *ctx, GLuint v0, GLuint v1);
void gld_Triangle2DFlat_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
void gld_Triangle2DSmooth_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
void gld_Triangle2DFlatExtras_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
void gld_Triangle2DSmoothExtras_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
void gld_Quad2DFlat_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
void gld_Quad2DSmooth_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
void gld_Quad2DFlatExtras_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
void gld_Quad2DSmoothExtras_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
// 3D primitive functions
void gld_Points3D_DX9(struct gl_context *ctx, GLuint first, GLuint last);
void gld_Line3DFlat_DX9(struct gl_context *ctx, GLuint v0, GLuint v1);
void gld_Triangle3DFlat_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
void gld_Quad3DFlat_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
void gld_Line3DSmooth_DX9(struct gl_context *ctx, GLuint v0, GLuint v1);
void gld_Triangle3DSmooth_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
void gld_Quad3DSmooth_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
// Primitive functions for Two-sided-lighting Vertex Shader
void gld_Points2DTwoside_DX9(struct gl_context *ctx, GLuint first, GLuint last);
void gld_Line2DFlatTwoside_DX9(struct gl_context *ctx, GLuint v0, GLuint v1);
void gld_Line2DSmoothTwoside_DX9(struct gl_context *ctx, GLuint v0, GLuint v1);
void gld_Triangle2DFlatTwoside_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
void gld_Triangle2DSmoothTwoside_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2);
void gld_Quad2DFlatTwoside_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
void gld_Quad2DSmoothTwoside_DX9(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
#endif

View file

@ -1,77 +0,0 @@
/*==========================================================================;
*
*
* File: dxerr9.h
* Content: DirectX Error Library Include File
*
****************************************************************************/
#ifndef _GLD_DXERR9_H_
#define _GLD_DXERR9_H_
#include <d3d9.h>
//
// DXGetErrorString9
//
// Desc: Converts an DirectX HRESULT to a string
//
// Args: HRESULT hr Can be any error code from
// DPLAY D3D8 D3DX8 DMUSIC DSOUND
//
// Return: Converted string
//
const char* __stdcall DXGetErrorString9A(HRESULT hr);
const WCHAR* __stdcall DXGetErrorString9W(HRESULT hr);
#ifdef UNICODE
#define DXGetErrorString9 DXGetErrorString9W
#else
#define DXGetErrorString9 DXGetErrorString9A
#endif
//
// DXTrace
//
// Desc: Outputs a formatted error message to the debug stream
//
// Args: CHAR* strFile The current file, typically passed in using the
// __FILE__ macro.
// DWORD dwLine The current line number, typically passed in using the
// __LINE__ macro.
// HRESULT hr An HRESULT that will be traced to the debug stream.
// CHAR* strMsg A string that will be traced to the debug stream (may be NULL)
// BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info.
//
// Return: The hr that was passed in.
//
//HRESULT __stdcall DXTraceA( char* strFile, DWORD dwLine, HRESULT hr, char* strMsg, BOOL bPopMsgBox = FALSE );
//HRESULT __stdcall DXTraceW( char* strFile, DWORD dwLine, HRESULT hr, WCHAR* strMsg, BOOL bPopMsgBox = FALSE );
HRESULT __stdcall DXTraceA( char* strFile, DWORD dwLine, HRESULT hr, char* strMsg, BOOL bPopMsgBox);
HRESULT __stdcall DXTraceW( char* strFile, DWORD dwLine, HRESULT hr, WCHAR* strMsg, BOOL bPopMsgBox);
#ifdef UNICODE
#define DXTrace DXTraceW
#else
#define DXTrace DXTraceA
#endif
//
// Helper macros
//
#if defined(DEBUG) | defined(_DEBUG)
#define DXTRACE_MSG(str) DXTrace( __FILE__, (DWORD)__LINE__, 0, str, FALSE )
#define DXTRACE_ERR(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, TRUE )
#define DXTRACE_ERR_NOMSGBOX(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, FALSE )
#else
#define DXTRACE_MSG(str) (0L)
#define DXTRACE_ERR(str,hr) (hr)
#define DXTRACE_ERR_NOMSGBOX(str,hr) (hr)
#endif
#endif

View file

@ -1,344 +0,0 @@
/****************************************************************************
*
* Mesa 3-D graphics library
* Direct3D Driver Interface
*
* ========================================================================
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* ======================================================================
*
* Language: ANSI C
* Environment: Windows 9x/2000/XP/XBox (Win32)
*
* Description: GL extensions
*
****************************************************************************/
//#include "../GLDirect.h"
//#include "../gld_log.h"
//#include "../gld_settings.h"
#include <windows.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/gl.h>
#include <GL/glext.h>
//#include "ddlog.h"
//#include "gld_dx8.h"
#include "glheader.h"
#include "context.h"
#include "colormac.h"
#include "depth.h"
#include "extensions.h"
#include "macros.h"
#include "matrix.h"
// #include "mem.h"
//#include "mmath.h"
#include "mtypes.h"
#include "texformat.h"
#include "texstore.h"
#include "vbo/vbo.h"
#include "swrast_setup/swrast_setup.h"
#include "swrast_setup/ss_context.h"
#include "tnl/tnl.h"
#include "tnl/t_context.h"
#include "tnl/t_pipeline.h"
#include "dglcontext.h"
#include "extensions.h"
// For some reason this is not defined in an above header...
extern void _mesa_enable_imaging_extensions(struct gl_context *ctx);
//---------------------------------------------------------------------------
// Hack for the SGIS_multitexture extension that was removed from Mesa
// NOTE: SGIS_multitexture enums also clash with GL_SGIX_async_pixel
// NOTE: Quake2 ran *slower* with this enabled, so I've
// disabled it for now.
// To enable, uncomment:
// _mesa_add_extension(ctx, GL_TRUE, szGL_SGIS_multitexture, 0);
//---------------------------------------------------------------------------
enum {
/* Quake2 GL_SGIS_multitexture */
GL_SELECTED_TEXTURE_SGIS = 0x835B,
GL_SELECTED_TEXTURE_COORD_SET_SGIS = 0x835C,
GL_MAX_TEXTURES_SGIS = 0x835D,
GL_TEXTURE0_SGIS = 0x835E,
GL_TEXTURE1_SGIS = 0x835F,
GL_TEXTURE2_SGIS = 0x8360,
GL_TEXTURE3_SGIS = 0x8361,
GL_TEXTURE_COORD_SET_SOURCE_SGIS = 0x8363,
};
//---------------------------------------------------------------------------
void APIENTRY gldSelectTextureSGIS(
GLenum target)
{
GLenum ARB_target = GL_TEXTURE0_ARB + (target - GL_TEXTURE0_SGIS);
glActiveTextureARB(ARB_target);
}
//---------------------------------------------------------------------------
void APIENTRY gldMTexCoord2fSGIS(
GLenum target,
GLfloat s,
GLfloat t)
{
GLenum ARB_target = GL_TEXTURE0_ARB + (target - GL_TEXTURE0_SGIS);
glMultiTexCoord2fARB(ARB_target, s, t);
}
//---------------------------------------------------------------------------
void APIENTRY gldMTexCoord2fvSGIS(
GLenum target,
const GLfloat *v)
{
GLenum ARB_target = GL_TEXTURE0_ARB + (target - GL_TEXTURE0_SGIS);
glMultiTexCoord2fvARB(ARB_target, v);
}
//---------------------------------------------------------------------------
// Extensions
//---------------------------------------------------------------------------
typedef struct {
PROC proc;
char *name;
} GLD_extension;
GLD_extension GLD_extList[] = {
#ifdef GL_EXT_polygon_offset
{ (PROC)glPolygonOffsetEXT, "glPolygonOffsetEXT" },
#endif
{ (PROC)glBlendEquationEXT, "glBlendEquationEXT" },
{ (PROC)glBlendColorEXT, "glBlendColorExt" },
{ (PROC)glVertexPointerEXT, "glVertexPointerEXT" },
{ (PROC)glNormalPointerEXT, "glNormalPointerEXT" },
{ (PROC)glColorPointerEXT, "glColorPointerEXT" },
{ (PROC)glIndexPointerEXT, "glIndexPointerEXT" },
{ (PROC)glTexCoordPointerEXT, "glTexCoordPointer" },
{ (PROC)glEdgeFlagPointerEXT, "glEdgeFlagPointerEXT" },
{ (PROC)glGetPointervEXT, "glGetPointervEXT" },
{ (PROC)glArrayElementEXT, "glArrayElementEXT" },
{ (PROC)glDrawArraysEXT, "glDrawArrayEXT" },
{ (PROC)glAreTexturesResidentEXT, "glAreTexturesResidentEXT" },
{ (PROC)glBindTextureEXT, "glBindTextureEXT" },
{ (PROC)glDeleteTexturesEXT, "glDeleteTexturesEXT" },
{ (PROC)glGenTexturesEXT, "glGenTexturesEXT" },
{ (PROC)glIsTextureEXT, "glIsTextureEXT" },
{ (PROC)glPrioritizeTexturesEXT, "glPrioritizeTexturesEXT" },
{ (PROC)glCopyTexSubImage3DEXT, "glCopyTexSubImage3DEXT" },
{ (PROC)glTexImage3DEXT, "glTexImage3DEXT" },
{ (PROC)glTexSubImage3DEXT, "glTexSubImage3DEXT" },
{ (PROC)glPointParameterfEXT, "glPointParameterfEXT" },
{ (PROC)glPointParameterfvEXT, "glPointParameterfvEXT" },
{ (PROC)glLockArraysEXT, "glLockArraysEXT" },
{ (PROC)glUnlockArraysEXT, "glUnlockArraysEXT" },
{ NULL, "\0" }
};
GLD_extension GLD_multitexList[] = {
/*
{ (PROC)glMultiTexCoord1dSGIS, "glMTexCoord1dSGIS" },
{ (PROC)glMultiTexCoord1dvSGIS, "glMTexCoord1dvSGIS" },
{ (PROC)glMultiTexCoord1fSGIS, "glMTexCoord1fSGIS" },
{ (PROC)glMultiTexCoord1fvSGIS, "glMTexCoord1fvSGIS" },
{ (PROC)glMultiTexCoord1iSGIS, "glMTexCoord1iSGIS" },
{ (PROC)glMultiTexCoord1ivSGIS, "glMTexCoord1ivSGIS" },
{ (PROC)glMultiTexCoord1sSGIS, "glMTexCoord1sSGIS" },
{ (PROC)glMultiTexCoord1svSGIS, "glMTexCoord1svSGIS" },
{ (PROC)glMultiTexCoord2dSGIS, "glMTexCoord2dSGIS" },
{ (PROC)glMultiTexCoord2dvSGIS, "glMTexCoord2dvSGIS" },
{ (PROC)glMultiTexCoord2fSGIS, "glMTexCoord2fSGIS" },
{ (PROC)glMultiTexCoord2fvSGIS, "glMTexCoord2fvSGIS" },
{ (PROC)glMultiTexCoord2iSGIS, "glMTexCoord2iSGIS" },
{ (PROC)glMultiTexCoord2ivSGIS, "glMTexCoord2ivSGIS" },
{ (PROC)glMultiTexCoord2sSGIS, "glMTexCoord2sSGIS" },
{ (PROC)glMultiTexCoord2svSGIS, "glMTexCoord2svSGIS" },
{ (PROC)glMultiTexCoord3dSGIS, "glMTexCoord3dSGIS" },
{ (PROC)glMultiTexCoord3dvSGIS, "glMTexCoord3dvSGIS" },
{ (PROC)glMultiTexCoord3fSGIS, "glMTexCoord3fSGIS" },
{ (PROC)glMultiTexCoord3fvSGIS, "glMTexCoord3fvSGIS" },
{ (PROC)glMultiTexCoord3iSGIS, "glMTexCoord3iSGIS" },
{ (PROC)glMultiTexCoord3ivSGIS, "glMTexCoord3ivSGIS" },
{ (PROC)glMultiTexCoord3sSGIS, "glMTexCoord3sSGIS" },
{ (PROC)glMultiTexCoord3svSGIS, "glMTexCoord3svSGIS" },
{ (PROC)glMultiTexCoord4dSGIS, "glMTexCoord4dSGIS" },
{ (PROC)glMultiTexCoord4dvSGIS, "glMTexCoord4dvSGIS" },
{ (PROC)glMultiTexCoord4fSGIS, "glMTexCoord4fSGIS" },
{ (PROC)glMultiTexCoord4fvSGIS, "glMTexCoord4fvSGIS" },
{ (PROC)glMultiTexCoord4iSGIS, "glMTexCoord4iSGIS" },
{ (PROC)glMultiTexCoord4ivSGIS, "glMTexCoord4ivSGIS" },
{ (PROC)glMultiTexCoord4sSGIS, "glMTexCoord4sSGIS" },
{ (PROC)glMultiTexCoord4svSGIS, "glMTexCoord4svSGIS" },
{ (PROC)glMultiTexCoordPointerSGIS, "glMTexCoordPointerSGIS" },
{ (PROC)glSelectTextureSGIS, "glSelectTextureSGIS" },
{ (PROC)glSelectTextureCoordSetSGIS, "glSelectTextureCoordSetSGIS" },
*/
{ (PROC)glActiveTextureARB, "glActiveTextureARB" },
{ (PROC)glClientActiveTextureARB, "glClientActiveTextureARB" },
{ (PROC)glMultiTexCoord1dARB, "glMultiTexCoord1dARB" },
{ (PROC)glMultiTexCoord1dvARB, "glMultiTexCoord1dvARB" },
{ (PROC)glMultiTexCoord1fARB, "glMultiTexCoord1fARB" },
{ (PROC)glMultiTexCoord1fvARB, "glMultiTexCoord1fvARB" },
{ (PROC)glMultiTexCoord1iARB, "glMultiTexCoord1iARB" },
{ (PROC)glMultiTexCoord1ivARB, "glMultiTexCoord1ivARB" },
{ (PROC)glMultiTexCoord1sARB, "glMultiTexCoord1sARB" },
{ (PROC)glMultiTexCoord1svARB, "glMultiTexCoord1svARB" },
{ (PROC)glMultiTexCoord2dARB, "glMultiTexCoord2dARB" },
{ (PROC)glMultiTexCoord2dvARB, "glMultiTexCoord2dvARB" },
{ (PROC)glMultiTexCoord2fARB, "glMultiTexCoord2fARB" },
{ (PROC)glMultiTexCoord2fvARB, "glMultiTexCoord2fvARB" },
{ (PROC)glMultiTexCoord2iARB, "glMultiTexCoord2iARB" },
{ (PROC)glMultiTexCoord2ivARB, "glMultiTexCoord2ivARB" },
{ (PROC)glMultiTexCoord2sARB, "glMultiTexCoord2sARB" },
{ (PROC)glMultiTexCoord2svARB, "glMultiTexCoord2svARB" },
{ (PROC)glMultiTexCoord3dARB, "glMultiTexCoord3dARB" },
{ (PROC)glMultiTexCoord3dvARB, "glMultiTexCoord3dvARB" },
{ (PROC)glMultiTexCoord3fARB, "glMultiTexCoord3fARB" },
{ (PROC)glMultiTexCoord3fvARB, "glMultiTexCoord3fvARB" },
{ (PROC)glMultiTexCoord3iARB, "glMultiTexCoord3iARB" },
{ (PROC)glMultiTexCoord3ivARB, "glMultiTexCoord3ivARB" },
{ (PROC)glMultiTexCoord3sARB, "glMultiTexCoord3sARB" },
{ (PROC)glMultiTexCoord3svARB, "glMultiTexCoord3svARB" },
{ (PROC)glMultiTexCoord4dARB, "glMultiTexCoord4dARB" },
{ (PROC)glMultiTexCoord4dvARB, "glMultiTexCoord4dvARB" },
{ (PROC)glMultiTexCoord4fARB, "glMultiTexCoord4fARB" },
{ (PROC)glMultiTexCoord4fvARB, "glMultiTexCoord4fvARB" },
{ (PROC)glMultiTexCoord4iARB, "glMultiTexCoord4iARB" },
{ (PROC)glMultiTexCoord4ivARB, "glMultiTexCoord4ivARB" },
{ (PROC)glMultiTexCoord4sARB, "glMultiTexCoord4sARB" },
{ (PROC)glMultiTexCoord4svARB, "glMultiTexCoord4svARB" },
// Descent3 doesn't use correct string, hence this hack
{ (PROC)glMultiTexCoord4fARB, "glMultiTexCoord4f" },
// Quake2 SGIS multitexture
{ (PROC)gldSelectTextureSGIS, "glSelectTextureSGIS" },
{ (PROC)gldMTexCoord2fSGIS, "glMTexCoord2fSGIS" },
{ (PROC)gldMTexCoord2fvSGIS, "glMTexCoord2fvSGIS" },
{ NULL, "\0" }
};
//---------------------------------------------------------------------------
PROC gldGetProcAddress_DX(
LPCSTR a)
{
int i;
PROC proc = NULL;
for (i=0; GLD_extList[i].proc; i++) {
if (!strcmp(a, GLD_extList[i].name)) {
proc = GLD_extList[i].proc;
break;
}
}
if (glb.bMultitexture) {
for (i=0; GLD_multitexList[i].proc; i++) {
if (!strcmp(a, GLD_multitexList[i].name)) {
proc = GLD_multitexList[i].proc;
break;
}
}
}
gldLogPrintf(GLDLOG_INFO, "GetProcAddress: %s (%s)", a, proc ? "OK" : "Failed");
return proc;
}
//---------------------------------------------------------------------------
void gldEnableExtensions_DX9(
struct gl_context *ctx)
{
GLuint i;
// Mesa enables some extensions by default.
// This table decides which ones we want to switch off again.
// NOTE: GL_EXT_compiled_vertex_array appears broken.
const char *gld_disable_extensions[] = {
// "GL_ARB_transpose_matrix",
// "GL_EXT_compiled_vertex_array",
// "GL_EXT_polygon_offset",
// "GL_EXT_rescale_normal",
"GL_EXT_texture3D",
// "GL_NV_texgen_reflection",
NULL
};
const char *gld_multitex_extensions[] = {
"GL_ARB_multitexture", // Quake 3
NULL
};
// Quake 2 engines
const char *szGL_SGIS_multitexture = "GL_SGIS_multitexture";
const char *gld_enable_extensions[] = {
"GL_EXT_texture_env_add", // Quake 3
"GL_ARB_texture_env_add", // Quake 3
NULL
};
for (i=0; gld_disable_extensions[i]; i++) {
_mesa_disable_extension(ctx, gld_disable_extensions[i]);
}
for (i=0; gld_enable_extensions[i]; i++) {
_mesa_enable_extension(ctx, gld_enable_extensions[i]);
}
if (glb.bMultitexture) {
for (i=0; gld_multitex_extensions[i]; i++) {
_mesa_enable_extension(ctx, gld_multitex_extensions[i]);
}
// GL_SGIS_multitexture
// NOTE: Quake2 ran *slower* with this enabled, so I've
// disabled it for now.
// Fair bit slower on GeForce256,
// Much slower on 3dfx Voodoo5 5500.
// _mesa_add_extension(ctx, GL_TRUE, szGL_SGIS_multitexture, 0);
}
_mesa_enable_imaging_extensions(ctx);
_mesa_enable_1_3_extensions(ctx);
_mesa_enable_1_4_extensions(ctx);
}
//---------------------------------------------------------------------------

View file

@ -1,77 +0,0 @@
/****************************************************************************
*
* Mesa 3-D graphics library
* Direct3D Driver Interface
*
* ========================================================================
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* ======================================================================
*
* Language: ANSI C
* Environment: Windows 9x/2000/XP/XBox (Win32)
*
* Description: Mesa transformation pipeline with GLDirect fastpath
*
****************************************************************************/
//#include "../GLDirect.h"
#include "dglcontext.h"
#include "ddlog.h"
#include "gld_dx9.h"
#include "tnl/tnl.h"
#include "tnl/t_context.h"
#include "tnl/t_pipeline.h"
//---------------------------------------------------------------------------
extern struct tnl_pipeline_stage _gld_d3d_render_stage;
extern struct tnl_pipeline_stage _gld_mesa_render_stage;
static const struct tnl_pipeline_stage *gld_pipeline[] = {
&_gld_d3d_render_stage, // Direct3D TnL
&_tnl_vertex_transform_stage,
&_tnl_normal_transform_stage,
&_tnl_lighting_stage,
&_tnl_fog_coordinate_stage, /* TODO: Omit fog stage. ??? */
&_tnl_texgen_stage,
&_tnl_texture_transform_stage,
&_tnl_point_attenuation_stage,
&_gld_mesa_render_stage, // Mesa TnL, D3D rendering
0,
};
//---------------------------------------------------------------------------
void gldInstallPipeline_DX9(
struct gl_context *ctx)
{
// Remove any existing pipeline stages,
// then install GLDirect pipeline stages.
_tnl_destroy_pipeline(ctx);
_tnl_install_pipeline(ctx, gld_pipeline);
}
//---------------------------------------------------------------------------

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,263 +0,0 @@
/****************************************************************************
*
* Mesa 3-D graphics library
* Direct3D Driver Interface
*
* ========================================================================
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* ======================================================================
*
* Language: ANSI C
* Environment: Windows 9x/2000/XP/XBox (Win32)
*
* Description: GLDirect fastpath pipeline stage
*
****************************************************************************/
//---------------------------------------------------------------------------
//#include "../GLDirect.h"
//#include "../gld_log.h"
//#include "gld_dx8.h"
#include "dglcontext.h"
#include "ddlog.h"
#include "gld_dx9.h"
//---------------------------------------------------------------------------
#include "glheader.h"
#include "context.h"
#include "macros.h"
// #include "mem.h"
#include "mtypes.h"
//#include "mmath.h"
#include "math/m_matrix.h"
#include "math/m_xform.h"
#include "tnl/t_pipeline.h"
//---------------------------------------------------------------------------
__inline void _gldSetVertexShaderConstants(
struct gl_context *ctx,
GLD_driver_dx9 *gld)
{
D3DXMATRIX mat, matView, matProj;
GLfloat *pM;
// Mesa 5: Altered to a Stack
//pM = ctx->ModelView.m;
pM = ctx->ModelviewMatrixStack.Top->m;
matView._11 = pM[0];
matView._12 = pM[1];
matView._13 = pM[2];
matView._14 = pM[3];
matView._21 = pM[4];
matView._22 = pM[5];
matView._23 = pM[6];
matView._24 = pM[7];
matView._31 = pM[8];
matView._32 = pM[9];
matView._33 = pM[10];
matView._34 = pM[11];
matView._41 = pM[12];
matView._42 = pM[13];
matView._43 = pM[14];
matView._44 = pM[15];
// Mesa 5: Altered to a Stack
//pM = ctx->ProjectionMatrix.m;
pM = ctx->ProjectionMatrixStack.Top->m;
matProj._11 = pM[0];
matProj._12 = pM[1];
matProj._13 = pM[2];
matProj._14 = pM[3];
matProj._21 = pM[4];
matProj._22 = pM[5];
matProj._23 = pM[6];
matProj._24 = pM[7];
matProj._31 = pM[8];
matProj._32 = pM[9];
matProj._33 = pM[10];
matProj._34 = pM[11];
matProj._41 = pM[12];
matProj._42 = pM[13];
matProj._43 = pM[14];
matProj._44 = pM[15];
D3DXMatrixMultiply( &mat, &matView, &matProj );
D3DXMatrixTranspose( &mat, &mat );
_GLD_DX9_DEV(SetVertexShaderConstantF(gld->pDev, 0, (float*)&mat, 4));
}
//---------------------------------------------------------------------------
static GLboolean gld_d3d_render_stage_run(
struct gl_context *ctx,
struct tnl_pipeline_stage *stage)
{
GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
TNLcontext *tnl;
struct vertex_buffer *VB;
tnl_render_func *tab;
GLint pass;
GLD_pb_dx9 *gldPB = &gld->PB3d;
/*
static int count = 0;
count++;
if (count != 2)
return GL_FALSE;
*/
// The "check" function should disable this stage,
// but we'll test gld->bUseMesaTnL anyway.
if (gld->bUseMesaTnL) {
// Do nothing in this stage, but continue pipeline
return GL_TRUE;
}
tnl = TNL_CONTEXT(ctx);
VB = &tnl->vb;
pass = 0;
tnl->Driver.Render.Start( ctx );
#if 0
// For debugging: Useful to see if an app passes colour data in
// an unusual format.
switch (VB->AttribPtr[_TNL_ATTRIB_COLOR0]->Type) {
case GL_FLOAT:
ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_FLOAT\n");
break;
case GL_UNSIGNED_BYTE:
ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_UNSIGNED_BYTE\n");
break;
default:
ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: *?*\n");
break;
}
#endif
tnl->Driver.Render.Points = gld_Points3D_DX9;
if (ctx->_TriangleCaps & DD_FLATSHADE) {
tnl->Driver.Render.Line = gld_Line3DFlat_DX9;
tnl->Driver.Render.Triangle = gld_Triangle3DFlat_DX9;
tnl->Driver.Render.Quad = gld_Quad3DFlat_DX9;
} else {
tnl->Driver.Render.Line = gld_Line3DSmooth_DX9;
tnl->Driver.Render.Triangle = gld_Triangle3DSmooth_DX9;
tnl->Driver.Render.Quad = gld_Quad3DSmooth_DX9;
}
_GLD_DX9_VB(Lock(gldPB->pVB, 0, 0, &gldPB->pPoints, D3DLOCK_DISCARD));
gldPB->nPoints = gldPB->nLines = gldPB->nTriangles = 0;
// Allocate primitive pointers
// gldPB->pPoints is always first
gldPB->pLines = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstLine);
gldPB->pTriangles = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstTriangle);
ASSERT(tnl->Driver.Render.BuildVertices);
ASSERT(tnl->Driver.Render.PrimitiveNotify);
ASSERT(tnl->Driver.Render.Points);
ASSERT(tnl->Driver.Render.Line);
ASSERT(tnl->Driver.Render.Triangle);
ASSERT(tnl->Driver.Render.Quad);
ASSERT(tnl->Driver.Render.ResetLineStipple);
ASSERT(tnl->Driver.Render.Interp);
ASSERT(tnl->Driver.Render.CopyPV);
ASSERT(tnl->Driver.Render.ClippedLine);
ASSERT(tnl->Driver.Render.ClippedPolygon);
ASSERT(tnl->Driver.Render.Finish);
tab = (VB->Elts ? tnl->Driver.Render.PrimTabElts : tnl->Driver.Render.PrimTabVerts);
do {
GLuint i, length, flags = 0;
for (i = 0 ; !(flags & PRIM_END) ; i += length)
{
flags = VB->Primitive[i].mode;
length= VB->Primitive[i].count;
ASSERT(length || (flags & PRIM_END));
ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1);
if (length)
tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags );
}
} while (tnl->Driver.Render.Multipass &&
tnl->Driver.Render.Multipass( ctx, ++pass ));
_GLD_DX9_VB(Unlock(gldPB->pVB));
_GLD_DX9_DEV(SetStreamSource(gld->pDev, 0, gldPB->pVB, 0, gldPB->dwStride));
_GLD_DX9_DEV(SetTransform(gld->pDev, D3DTS_PROJECTION, &gld->matProjection));
_GLD_DX9_DEV(SetTransform(gld->pDev, D3DTS_WORLD, &gld->matModelView));
if (gldPB->nPoints) {
_GLD_DX9_DEV(DrawPrimitive(gld->pDev, D3DPT_POINTLIST, 0, gldPB->nPoints));
gldPB->nPoints = 0;
}
if (gldPB->nLines) {
_GLD_DX9_DEV(DrawPrimitive(gld->pDev, D3DPT_LINELIST, gldPB->iFirstLine, gldPB->nLines));
gldPB->nLines = 0;
}
if (gldPB->nTriangles) {
_GLD_DX9_DEV(DrawPrimitive(gld->pDev, D3DPT_TRIANGLELIST, gldPB->iFirstTriangle, gldPB->nTriangles));
gldPB->nTriangles = 0;
}
return GL_FALSE; /* finished the pipe */
}
//---------------------------------------------------------------------------
static void gld_d3d_render_stage_check(
struct gl_context *ctx,
struct tnl_pipeline_stage *stage)
{
GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
// Is this thread safe?
stage->active = (gld->bUseMesaTnL) ? GL_FALSE : GL_TRUE;
return;
}
//---------------------------------------------------------------------------
const struct tnl_pipeline_stage _gld_d3d_render_stage =
{
"gld_d3d_render_stage",
NULL,
NULL,
NULL,
NULL,
gld_d3d_render_stage_run /* run */
};
//---------------------------------------------------------------------------

View file

@ -1,443 +0,0 @@
/*
* Mesa 3-D graphics library
* Version: 3.5
*
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
* Keith Whitwell <keithw@valinux.com>
*/
/*
* Render whole vertex buffers, including projection of vertices from
* clip space and clipping of primitives.
*
* This file makes calls to project vertices and to the point, line
* and triangle rasterizers via the function pointers:
*
* context->Driver.Render.*
*
*/
//---------------------------------------------------------------------------
#include "dglcontext.h"
#include "ddlog.h"
#include "gld_dx9.h"
//---------------------------------------------------------------------------
#include "glheader.h"
#include "context.h"
#include "macros.h"
#include "mtypes.h"
//#include "mmath.h"
#include "math/m_matrix.h"
#include "math/m_xform.h"
#include "tnl/t_pipeline.h"
/**********************************************************************/
/* Clip single primitives */
/**********************************************************************/
#if defined(USE_IEEE)
#define NEGATIVE(x) (GET_FLOAT_BITS(x) & (1<<31))
//#define DIFFERENT_SIGNS(x,y) ((GET_FLOAT_BITS(x) ^ GET_FLOAT_BITS(y)) & (1<<31))
#else
#define NEGATIVE(x) (x < 0)
//#define DIFFERENT_SIGNS(x,y) (x * y <= 0 && x - y != 0)
/* Could just use (x*y<0) except for the flatshading requirements.
* Maybe there's a better way?
*/
#endif
#define W(i) coord[i][3]
#define Z(i) coord[i][2]
#define Y(i) coord[i][1]
#define X(i) coord[i][0]
#define SIZE 4
#define TAG(x) x##_4
#include "tnl/t_vb_cliptmp.h"
/**********************************************************************/
/* Clip and render whole begin/end objects */
/**********************************************************************/
#define NEED_EDGEFLAG_SETUP (ctx->_TriangleCaps & DD_TRI_UNFILLED)
#define EDGEFLAG_GET(idx) VB->EdgeFlag[idx]
#define EDGEFLAG_SET(idx, val) VB->EdgeFlag[idx] = val
/* Vertices, with the possibility of clipping.
*/
#define RENDER_POINTS( start, count ) \
tnl->Driver.Render.Points( ctx, start, count )
#define RENDER_LINE( v1, v2 ) \
do { \
GLubyte c1 = mask[v1], c2 = mask[v2]; \
GLubyte ormask = c1|c2; \
if (!ormask) \
LineFunc( ctx, v1, v2 ); \
else if (!(c1 & c2 & 0x3f)) \
clip_line_4( ctx, v1, v2, ormask ); \
} while (0)
#define RENDER_TRI( v1, v2, v3 ) \
do { \
GLubyte c1 = mask[v1], c2 = mask[v2], c3 = mask[v3]; \
GLubyte ormask = c1|c2|c3; \
if (!ormask) \
TriangleFunc( ctx, v1, v2, v3 ); \
else if (!(c1 & c2 & c3 & 0x3f)) \
clip_tri_4( ctx, v1, v2, v3, ormask ); \
} while (0)
#define RENDER_QUAD( v1, v2, v3, v4 ) \
do { \
GLubyte c1 = mask[v1], c2 = mask[v2]; \
GLubyte c3 = mask[v3], c4 = mask[v4]; \
GLubyte ormask = c1|c2|c3|c4; \
if (!ormask) \
QuadFunc( ctx, v1, v2, v3, v4 ); \
else if (!(c1 & c2 & c3 & c4 & 0x3f)) \
clip_quad_4( ctx, v1, v2, v3, v4, ormask ); \
} while (0)
#define LOCAL_VARS \
TNLcontext *tnl = TNL_CONTEXT(ctx); \
struct vertex_buffer *VB = &tnl->vb; \
const GLuint * const elt = VB->Elts; \
const GLubyte *mask = VB->ClipMask; \
const GLuint sz = VB->ClipPtr->size; \
const tnl_line_func LineFunc = tnl->Driver.Render.Line; \
const tnl_triangle_func TriangleFunc = tnl->Driver.Render.Triangle; \
const tnl_quad_func QuadFunc = tnl->Driver.Render.Quad; \
const GLboolean stipple = ctx->Line.StippleFlag; \
(void) (LineFunc && TriangleFunc && QuadFunc); \
(void) elt; (void) mask; (void) sz; (void) stipple;
#define TAG(x) clip_##x##_verts
#define INIT(x) tnl->Driver.Render.PrimitiveNotify( ctx, x )
#define RESET_STIPPLE if (stipple) tnl->Driver.Render.ResetLineStipple( ctx )
#define PRESERVE_VB_DEFS
#include "tnl/t_vb_rendertmp.h"
/* Elts, with the possibility of clipping.
*/
#undef ELT
#undef TAG
#define ELT(x) elt[x]
#define TAG(x) clip_##x##_elts
#include "tnl/t_vb_rendertmp.h"
/* TODO: do this for all primitives, verts and elts:
*/
static void clip_elt_triangles( struct gl_context *ctx,
GLuint start,
GLuint count,
GLuint flags )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
tnl_render_func render_tris = tnl->Driver.Render.PrimTabElts[GL_TRIANGLES];
struct vertex_buffer *VB = &tnl->vb;
const GLuint * const elt = VB->Elts;
GLubyte *mask = VB->ClipMask;
GLuint last = count-2;
GLuint j;
(void) flags;
tnl->Driver.Render.PrimitiveNotify( ctx, GL_TRIANGLES );
for (j=start; j < last; j+=3 ) {
GLubyte c1 = mask[elt[j]];
GLubyte c2 = mask[elt[j+1]];
GLubyte c3 = mask[elt[j+2]];
GLubyte ormask = c1|c2|c3;
if (ormask) {
if (start < j)
render_tris( ctx, start, j, 0 );
if (!(c1&c2&c3&0x3f))
clip_tri_4( ctx, elt[j], elt[j+1], elt[j+2], ormask );
start = j+3;
}
}
if (start < j)
render_tris( ctx, start, j, 0 );
}
/**********************************************************************/
/* Render whole begin/end objects */
/**********************************************************************/
#define NEED_EDGEFLAG_SETUP (ctx->_TriangleCaps & DD_TRI_UNFILLED)
#define EDGEFLAG_GET(idx) VB->EdgeFlag[idx]
#define EDGEFLAG_SET(idx, val) VB->EdgeFlag[idx] = val
/* Vertices, no clipping.
*/
#define RENDER_POINTS( start, count ) \
tnl->Driver.Render.Points( ctx, start, count )
#define RENDER_LINE( v1, v2 ) \
LineFunc( ctx, v1, v2 )
#define RENDER_TRI( v1, v2, v3 ) \
TriangleFunc( ctx, v1, v2, v3 )
#define RENDER_QUAD( v1, v2, v3, v4 ) \
QuadFunc( ctx, v1, v2, v3, v4 )
#define TAG(x) _gld_tnl_##x##_verts
#define LOCAL_VARS \
TNLcontext *tnl = TNL_CONTEXT(ctx); \
struct vertex_buffer *VB = &tnl->vb; \
const GLuint * const elt = VB->Elts; \
const tnl_line_func LineFunc = tnl->Driver.Render.Line; \
const tnl_triangle_func TriangleFunc = tnl->Driver.Render.Triangle; \
const tnl_quad_func QuadFunc = tnl->Driver.Render.Quad; \
(void) (LineFunc && TriangleFunc && QuadFunc); \
(void) elt;
#define RESET_STIPPLE tnl->Driver.Render.ResetLineStipple( ctx )
#define INIT(x) tnl->Driver.Render.PrimitiveNotify( ctx, x )
#define RENDER_TAB_QUALIFIER
#define PRESERVE_VB_DEFS
#include "tnl/t_vb_rendertmp.h"
/* Elts, no clipping.
*/
#undef ELT
#define TAG(x) _gld_tnl_##x##_elts
#define ELT(x) elt[x]
#include "tnl/t_vb_rendertmp.h"
/**********************************************************************/
/* Helper functions for drivers */
/**********************************************************************/
/*
void _tnl_RenderClippedPolygon( struct gl_context *ctx, const GLuint *elts, GLuint n )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct vertex_buffer *VB = &tnl->vb;
GLuint *tmp = VB->Elts;
VB->Elts = (GLuint *)elts;
tnl->Driver.Render.PrimTabElts[GL_POLYGON]( ctx, 0, n, PRIM_BEGIN|PRIM_END );
VB->Elts = tmp;
}
void _tnl_RenderClippedLine( struct gl_context *ctx, GLuint ii, GLuint jj )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
tnl->Driver.Render.Line( ctx, ii, jj );
}
*/
/**********************************************************************/
/* Clip and render whole vertex buffers */
/**********************************************************************/
tnl_points_func _gldSetupPoints[4] = {
gld_Points2D_DX9,
gld_Points2D_DX9,
gld_Points2D_DX9,
gld_Points2D_DX9
};
tnl_line_func _gldSetupLine[4] = {
gld_Line2DFlat_DX9,
gld_Line2DSmooth_DX9,
gld_Line2DFlat_DX9,
gld_Line2DSmooth_DX9,
};
tnl_triangle_func _gldSetupTriangle[4] = {
gld_Triangle2DFlat_DX9,
gld_Triangle2DSmooth_DX9,
gld_Triangle2DFlatExtras_DX9,
gld_Triangle2DSmoothExtras_DX9
};
tnl_quad_func _gldSetupQuad[4] = {
gld_Quad2DFlat_DX9,
gld_Quad2DSmooth_DX9,
gld_Quad2DFlatExtras_DX9,
gld_Quad2DSmoothExtras_DX9
};
//---------------------------------------------------------------------------
static GLboolean _gld_mesa_render_stage_run(
struct gl_context *ctx,
struct tnl_pipeline_stage *stage)
{
GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
GLD_driver_dx9 *gld = GLD_GET_DX9_DRIVER(gldCtx);
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct vertex_buffer *VB = &tnl->vb;
tnl_render_func *tab;
GLint pass = 0;
GLD_pb_dx9 *gldPB;
/* Allow the drivers to lock before projected verts are built so
* that window coordinates are guarenteed not to change before
* rendering.
*/
ASSERT(tnl->Driver.Render.Start);
tnl->Driver.Render.Start( ctx );
// NOTE: Setting D3DRS_SOFTWAREVERTEXPROCESSING for a mixed-mode device resets
// stream, indices and shader to default values of NULL or 0.
/* if ((ctx->_TriangleCaps & DD_TRI_LIGHT_TWOSIDE) &&
gld->VStwosidelight.hShader &&
!ctx->Fog.Enabled)
{
IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, !gld->VStwosidelight.bHardware);
_GLD_DX9_DEV(SetVertexShader(gld->pDev, gld->VStwosidelight.hShader));
gldPB = &gld->PBtwosidelight;
tnl->Driver.Render.Points = gld_Points2DTwoside_DX9;
if (ctx->_TriangleCaps & DD_FLATSHADE) {
tnl->Driver.Render.Line = gld_Line2DFlatTwoside_DX9;
tnl->Driver.Render.Triangle = gld_Triangle2DFlatTwoside_DX9;
tnl->Driver.Render.Quad = gld_Quad2DFlatTwoside_DX9;
} else {
tnl->Driver.Render.Line = gld_Line2DSmoothTwoside_DX9;
tnl->Driver.Render.Triangle = gld_Triangle2DSmoothTwoside_DX9;
tnl->Driver.Render.Quad = gld_Quad2DSmoothTwoside_DX9;
}
} else {*/
// IDirect3DDevice8_SetRenderState(gld->pDev, D3DRS_SOFTWAREVERTEXPROCESSING, TRUE);
IDirect3DDevice9_SetSoftwareVertexProcessing(gld->pDev, TRUE);
gldPB = &gld->PB2d;
_GLD_DX9_DEV(SetVertexShader(gld->pDev, NULL));
_GLD_DX9_DEV(SetFVF(gld->pDev, gldPB->dwFVF));
tnl->Driver.Render.Points = _gldSetupPoints[gld->iSetupFunc];
tnl->Driver.Render.Line = _gldSetupLine[gld->iSetupFunc];
tnl->Driver.Render.Triangle = _gldSetupTriangle[gld->iSetupFunc];
tnl->Driver.Render.Quad = _gldSetupQuad[gld->iSetupFunc];
// }
_GLD_DX9_VB(Lock(gldPB->pVB, 0, 0, &gldPB->pPoints, D3DLOCK_DISCARD));
gldPB->nPoints = gldPB->nLines = gldPB->nTriangles = 0;
// Allocate primitive pointers
// gldPB->pPoints is always first
gldPB->pLines = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstLine);
gldPB->pTriangles = gldPB->pPoints + (gldPB->dwStride * gldPB->iFirstTriangle);
ASSERT(tnl->Driver.Render.BuildVertices);
ASSERT(tnl->Driver.Render.PrimitiveNotify);
ASSERT(tnl->Driver.Render.Points);
ASSERT(tnl->Driver.Render.Line);
ASSERT(tnl->Driver.Render.Triangle);
ASSERT(tnl->Driver.Render.Quad);
ASSERT(tnl->Driver.Render.ResetLineStipple);
ASSERT(tnl->Driver.Render.Interp);
ASSERT(tnl->Driver.Render.CopyPV);
ASSERT(tnl->Driver.Render.ClippedLine);
ASSERT(tnl->Driver.Render.ClippedPolygon);
ASSERT(tnl->Driver.Render.Finish);
tnl->Driver.Render.BuildVertices( ctx, 0, VB->Count, ~0 );
if (VB->ClipOrMask) {
tab = VB->Elts ? clip_render_tab_elts : clip_render_tab_verts;
clip_render_tab_elts[GL_TRIANGLES] = clip_elt_triangles;
}
else {
tab = (VB->Elts ?
tnl->Driver.Render.PrimTabElts :
tnl->Driver.Render.PrimTabVerts);
}
do {
GLuint i, length, flags = 0;
for (i = 0 ; !(flags & PRIM_END) ; i += length) {
flags = VB->Primitive[i].mode;
length= VB->Primitive[i].count;
ASSERT(length || (flags & PRIM_END));
ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1);
if (length)
tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags );
}
} while (tnl->Driver.Render.Multipass &&
tnl->Driver.Render.Multipass( ctx, ++pass ));
// tnl->Driver.Render.Finish( ctx );
_GLD_DX9_VB(Unlock(gldPB->pVB));
_GLD_DX9_DEV(SetStreamSource(gld->pDev, 0, gldPB->pVB, 0, gldPB->dwStride));
if (gldPB->nPoints) {
_GLD_DX9_DEV(DrawPrimitive(gld->pDev, D3DPT_POINTLIST, 0, gldPB->nPoints));
gldPB->nPoints = 0;
}
if (gldPB->nLines) {
_GLD_DX9_DEV(DrawPrimitive(gld->pDev, D3DPT_LINELIST, gldPB->iFirstLine, gldPB->nLines));
gldPB->nLines = 0;
}
if (gldPB->nTriangles) {
_GLD_DX9_DEV(DrawPrimitive(gld->pDev, D3DPT_TRIANGLELIST, gldPB->iFirstTriangle, gldPB->nTriangles));
gldPB->nTriangles = 0;
}
return GL_FALSE; /* finished the pipe */
}
/**********************************************************************/
/* Render pipeline stage */
/**********************************************************************/
const struct tnl_pipeline_stage _gld_mesa_render_stage =
{
"gld_mesa_render_stage",
NULL,
NULL,
NULL,
NULL,
_gld_mesa_render_stage_run /* run */
};
//---------------------------------------------------------------------------

File diff suppressed because it is too large Load diff

View file

@ -1,39 +0,0 @@
/*
* Mesa 3-D graphics library
* Version: 3.5
*
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
* Gareth Hughes <gareth@valinux.com>
*/
#ifdef DEBUG /* This code only used for debugging */
// Stub to enable Mesa to build. KeithH
#pragma message("NOTE: Using gld_debug_clip.c HACK")
void _math_test_all_cliptest_functions( char *description )
{
}
#endif /* DEBUG */

View file

@ -1,39 +0,0 @@
/*
* Mesa 3-D graphics library
* Version: 3.5
*
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Authors:
* Gareth Hughes <gareth@valinux.com>
*/
#ifdef DEBUG /* This code only used for debugging */
// Stub to enable Mesa to build. KeithH
#pragma message("NOTE: Using gld_debug_norm.c HACK")
void _math_test_all_normal_transform_functions( char *description )
{
}
#endif /* DEBUG */

View file

@ -1,41 +0,0 @@
/*
* Mesa 3-D graphics library
* Version: 3.5
*
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* Updated for P6 architecture by Gareth Hughes.
*/
#ifdef DEBUG /* This code only used for debugging */
// Stub to enable Mesa to build. KeithH
#pragma message("NOTE: Using gld_debug_xform.c HACK")
void _math_test_all_transform_functions( char *description )
{
}
#endif /* DEBUG */

View file

@ -1,73 +0,0 @@
/****************************************************************************
*
* Mesa 3-D graphics library
* Direct3D Driver Interface
*
* ========================================================================
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* ======================================================================
*
* Language: ANSI C
* Environment: Windows 9x/2000/XP/XBox (Win32)
*
* Description: Thread-aware dispatch table.
*
****************************************************************************/
#include "glheader.h"
#include "glapi.h"
#include "glapitable.h"
#include "mtypes.h"
#include "context.h"
#define KEYWORD1
#define KEYWORD2 GLAPIENTRY
#if defined(USE_MGL_NAMESPACE)
#define NAME(func) mgl##func
#else
#define NAME(func) gl##func
#endif
#if 0
// Altered these to get the dispatch table from
// the current context of the calling thread.
#define DISPATCH(FUNC, ARGS, MESSAGE) \
GET_CURRENT_CONTEXT(gc); \
(gc->CurrentDispatch->FUNC) ARGS
#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \
GET_CURRENT_CONTEXT(gc); \
return (gc->CurrentDispatch->FUNC) ARGS
#else // #if 0
#define DISPATCH(FUNC, ARGS, MESSAGE) \
GET_CURRENT_CONTEXT(gc); \
(_glapi_Dispatch->FUNC) ARGS
#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \
GET_CURRENT_CONTEXT(gc); \
return (_glapi_Dispatch->FUNC) ARGS
#endif // #if 0
#ifndef GLAPIENTRY
#define GLAPIENTRY
#endif
#include "glapitemp.h"

View file

@ -1,279 +0,0 @@
/****************************************************************************
*
* Mesa 3-D graphics library
* Direct3D Driver Interface
*
* ========================================================================
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* ======================================================================
*
* Language: ANSI C
* Environment: Windows 9x/2000/XP/XBox (Win32)
*
* Description: Driver functions and interfaces
*
****************************************************************************/
#define STRICT
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "gld_driver.h"
#include "ddlog.h"
#include "glheader.h"
// For glGetString().
#include "common_x86_asm.h"
//---------------------------------------------------------------------------
static char *szDriverError = "Driver used before initialisation!";
// This holds our dynamically created OpenGL renderer string.
// 256 chars should be plenty - remember that some apps display this.
static char _gldRendererString[256];
static char *szVendor = "SciTech Software, Inc.";
//---------------------------------------------------------------------------
extern BOOL gldGetDXErrorString_DX(HRESULT hr, char *buf, int nBufSize);
extern BOOL gldCreateDrawable_MesaSW(DGL_ctx *ctx, BOOL bPersistantInterface, BOOL bPersistantBuffers);
extern BOOL gldResizeDrawable_MesaSW(DGL_ctx *ctx, BOOL bDefaultDriver, BOOL bPersistantInterface, BOOL bPersistantBuffers);
extern BOOL gldDestroyDrawable_MesaSW(DGL_ctx *ctx);
extern BOOL gldCreatePrivateGlobals_MesaSW(void);
extern BOOL gldDestroyPrivateGlobals_MesaSW(void);
extern BOOL gldBuildPixelformatList_MesaSW(void);
extern BOOL gldInitialiseMesa_MesaSW(DGL_ctx *ctx);
extern BOOL gldSwapBuffers_MesaSW(DGL_ctx *ctx, HDC hDC, HWND hWnd);
extern PROC gldGetProcAddress_MesaSW(LPCSTR a);
extern BOOL gldGetDisplayMode_MesaSW(DGL_ctx *ctx, GLD_displayMode *glddm);
extern BOOL gldCreateDrawable_DX(DGL_ctx *ctx, BOOL bPersistantInterface, BOOL bPersistantBuffers);
extern BOOL gldResizeDrawable_DX(DGL_ctx *ctx, BOOL bDefaultDriver, BOOL bPersistantInterface, BOOL bPersistantBuffers);
extern BOOL gldDestroyDrawable_DX(DGL_ctx *ctx);
extern BOOL gldCreatePrivateGlobals_DX(void);
extern BOOL gldDestroyPrivateGlobals_DX(void);
extern BOOL gldBuildPixelformatList_DX(void);
extern BOOL gldInitialiseMesa_DX(DGL_ctx *ctx);
extern BOOL gldSwapBuffers_DX(DGL_ctx *ctx, HDC hDC, HWND hWnd);
extern PROC gldGetProcAddress_DX(LPCSTR a);
extern BOOL gldGetDisplayMode_DX(DGL_ctx *ctx, GLD_displayMode *glddm);
//---------------------------------------------------------------------------
// NOP functions. Called if proper driver functions are not set.
//---------------------------------------------------------------------------
static BOOL _gldDriverError(void)
{
ddlogMessage(DDLOG_CRITICAL, szDriverError);
return FALSE;
}
//---------------------------------------------------------------------------
static BOOL _GetDXErrorString_ERROR(
HRESULT hr,
char *buf,
int nBufSize)
{
return _gldDriverError();
}
//---------------------------------------------------------------------------
static BOOL _CreateDrawable_ERROR(
DGL_ctx *ctx,
BOOL bPersistantInterface,
BOOL bPersistantBuffers)
{
return _gldDriverError();
}
//---------------------------------------------------------------------------
static BOOL _ResizeDrawable_ERROR(
DGL_ctx *ctx,
BOOL bDefaultDriver,
BOOL bPersistantInterface,
BOOL bPersistantBuffers)
{
return _gldDriverError();
}
//---------------------------------------------------------------------------
static BOOL _DestroyDrawable_ERROR(
DGL_ctx *ctx)
{
return _gldDriverError();
}
//---------------------------------------------------------------------------
static BOOL _CreatePrivateGlobals_ERROR(void)
{
return _gldDriverError();
}
//---------------------------------------------------------------------------
static BOOL _DestroyPrivateGlobals_ERROR(void)
{
return _gldDriverError();
}
//---------------------------------------------------------------------------
static BOOL _BuildPixelformatList_ERROR(void)
{
return _gldDriverError();
}
//---------------------------------------------------------------------------
static BOOL _InitialiseMesa_ERROR(
DGL_ctx *ctx)
{
return _gldDriverError();
}
//---------------------------------------------------------------------------
static BOOL _SwapBuffers_ERROR(
DGL_ctx *ctx,
HDC hDC,
HWND hWnd)
{
return _gldDriverError();
}
//---------------------------------------------------------------------------
static PROC _GetProcAddress_ERROR(
LPCSTR a)
{
_gldDriverError();
return NULL;
}
//---------------------------------------------------------------------------
static BOOL _GetDisplayMode_ERROR(
DGL_ctx *ctx,
GLD_displayMode *glddm)
{
return _gldDriverError();
}
//---------------------------------------------------------------------------
// Functions useful to all drivers
//---------------------------------------------------------------------------
const GLubyte* _gldGetStringGeneric(
struct gl_context *ctx,
GLenum name)
{
if (!ctx)
return NULL;
switch (name) {
case GL_RENDERER:
sprintf(_gldRendererString, "GLDirect 4.0 %s%s%s%s (%s %s)",
_mesa_x86_cpu_features ? "/x86" : "",
cpu_has_mmx ? "/MMX" : "",
cpu_has_3dnow ? "/3DNow!" : "",
cpu_has_xmm ? "/SSE" : "",
__DATE__, __TIME__);
return (const GLubyte *) _gldRendererString;
case GL_VENDOR:
return (const GLubyte *) szVendor;
default:
return NULL;
}
}
//---------------------------------------------------------------------------
// Global driver function pointers, initially set to functions that
// will report an error when called.
//---------------------------------------------------------------------------
GLD_driver _gldDriver = {
_GetDXErrorString_ERROR,
_CreateDrawable_ERROR,
_ResizeDrawable_ERROR,
_DestroyDrawable_ERROR,
_CreatePrivateGlobals_ERROR,
_DestroyPrivateGlobals_ERROR,
_BuildPixelformatList_ERROR,
_InitialiseMesa_ERROR,
_SwapBuffers_ERROR,
_GetProcAddress_ERROR,
_GetDisplayMode_ERROR
};
//---------------------------------------------------------------------------
// Init function. Should be called as soon as regkeys/ini-settings are read.
//---------------------------------------------------------------------------
BOOL gldInitDriverPointers(
DWORD dwDriver)
{
_gldDriver.GetDXErrorString = gldGetDXErrorString_DX;
if (dwDriver == GLDS_DRIVER_MESA_SW) {
// Mesa Software driver
_gldDriver.CreateDrawable = gldCreateDrawable_MesaSW;
_gldDriver.ResizeDrawable = gldResizeDrawable_MesaSW;
_gldDriver.DestroyDrawable = gldDestroyDrawable_MesaSW;
_gldDriver.CreatePrivateGlobals = gldCreatePrivateGlobals_MesaSW;
_gldDriver.DestroyPrivateGlobals = gldDestroyPrivateGlobals_MesaSW;
_gldDriver.BuildPixelformatList = gldBuildPixelformatList_MesaSW;
_gldDriver.InitialiseMesa = gldInitialiseMesa_MesaSW;
_gldDriver.SwapBuffers = gldSwapBuffers_MesaSW;
_gldDriver.wglGetProcAddress = gldGetProcAddress_MesaSW;
_gldDriver.GetDisplayMode = gldGetDisplayMode_MesaSW;
return TRUE;
}
if ((dwDriver == GLDS_DRIVER_REF) || (dwDriver == GLDS_DRIVER_HAL)) {
// Direct3D driver, either HW or SW
_gldDriver.CreateDrawable = gldCreateDrawable_DX;
_gldDriver.ResizeDrawable = gldResizeDrawable_DX;
_gldDriver.DestroyDrawable = gldDestroyDrawable_DX;
_gldDriver.CreatePrivateGlobals = gldCreatePrivateGlobals_DX;
_gldDriver.DestroyPrivateGlobals = gldDestroyPrivateGlobals_DX;
_gldDriver.BuildPixelformatList = gldBuildPixelformatList_DX;
_gldDriver.InitialiseMesa = gldInitialiseMesa_DX;
_gldDriver.SwapBuffers = gldSwapBuffers_DX;
_gldDriver.wglGetProcAddress = gldGetProcAddress_DX;
_gldDriver.GetDisplayMode = gldGetDisplayMode_DX;
return TRUE;
};
return FALSE;
}
//---------------------------------------------------------------------------

View file

@ -1,90 +0,0 @@
/****************************************************************************
*
* Mesa 3-D graphics library
* Direct3D Driver Interface
*
* ========================================================================
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* ======================================================================
*
* Language: ANSI C
* Environment: Windows 9x/2000/XP/XBox (Win32)
*
* Description: Driver functions and interfaces
*
****************************************************************************/
#ifndef _GLD_DRIVER_H
#define _GLD_DRIVER_H
// This file is only useful is we're using the new GLD3 WGL code.
#ifdef _USE_GLD3_WGL
#include "dglcontext.h"
// Same as DX8 D3DDISPLAYMODE
typedef struct {
DWORD Width;
DWORD Height;
DWORD Refresh;
DWORD BPP;
} GLD_displayMode;
typedef struct {
// Returns a string for a given HRESULT error code.
BOOL (*GetDXErrorString)(HRESULT hr, char *buf, int nBufSize);
// Driver functions for managing drawables.
// Functions must respect persistant buffers / persistant interface.
// NOTE: Persistant interface is: DirectDraw, pre-DX8; Direct3D, DX8 and above.
BOOL (*CreateDrawable)(DGL_ctx *ctx, BOOL bPersistantInterface, BOOL bPersistantBuffers);
BOOL (*ResizeDrawable)(DGL_ctx *ctx, BOOL bDefaultDriver, BOOL bPersistantInterface, BOOL bPersistantBuffers);
BOOL (*DestroyDrawable)(DGL_ctx *ctx);
// Create/Destroy private globals belonging to driver
BOOL (*CreatePrivateGlobals)(void);
BOOL (*DestroyPrivateGlobals)(void);
// Build pixelformat list
BOOL (*BuildPixelformatList)(void);
// Initialise Mesa's driver pointers
BOOL (*InitialiseMesa)(DGL_ctx *ctx);
// Swap buffers
BOOL (*SwapBuffers)(DGL_ctx *ctx, HDC hDC, HWND hWnd);
// wglGetProcAddress()
PROC (*wglGetProcAddress)(LPCSTR a);
BOOL (*GetDisplayMode)(DGL_ctx *ctx, GLD_displayMode *glddm);
} GLD_driver;
extern GLD_driver _gldDriver;
BOOL gldInitDriverPointers(DWORD dwDriver);
const GLubyte* _gldGetStringGeneric(struct gl_context *ctx, GLenum name);
#endif // _USE_GLD3_WGL
#endif // _GLD_DRIVER_H

View file

@ -1,43 +0,0 @@
/****************************************************************************
*
* Mesa 3-D graphics library
* Direct3D Driver Interface
*
* ========================================================================
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* ======================================================================
*
* Language: Windows Resource Compiler
* Environment: Windows 95
*
****************************************************************************/
#ifndef WORKSHOP_INVOKED
#include <windows.h>
#endif
#define FILE_DESCRIPTION "SciTech GLDirect"
#define ORIG_FILENAME "opengl32.dll"
#define FILE_TYPE VFT_DLL
#include "gldirect/gldver.ver"

View file

@ -1,181 +0,0 @@
/****************************************************************************
*
* Mesa 3-D graphics library
* Direct3D Driver Interface
*
* ========================================================================
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* ======================================================================
*
* Language: ANSI C
* Environment: Windows 9x (Win32)
*
* Description: GLDirect utility for determining lame boards/drivers.
*
****************************************************************************/
#define STRICT
#define WIN32_LEAN_AND_MEAN
#include <d3d8.h>
/*
Ack. Broken out from gldlame.c because of broken D3D headers. KeithH
*/
/****************************************************************************
REMARKS:
Scans list of DirectDraw devices for specific device IDs.
****************************************************************************/
#define VENDORID_ATI 0x1002
static DWORD devATIRagePro[] = {
0x4742, // 3D RAGE PRO BGA AGP 1X/2X
0x4744, // 3D RAGE PRO BGA AGP 1X only
0x4749, // 3D RAGE PRO BGA PCI 33 MHz
0x4750, // 3D RAGE PRO PQFP PCI 33 MHz
0x4751, // 3D RAGE PRO PQFP PCI 33 MHz limited 3D
0x4C42, // 3D RAGE LT PRO BGA-312 AGP 133 MHz
0x4C44, // 3D RAGE LT PRO BGA-312 AGP 66 MHz
0x4C49, // 3D RAGE LT PRO BGA-312 PCI 33 MHz
0x4C50, // 3D RAGE LT PRO BGA-256 PCI 33 MHz
0x4C51, // 3D RAGE LT PRO BGA-256 PCI 33 MHz limited 3D
};
static DWORD devATIRageIIplus[] = {
0x4755, // 3D RAGE II+
0x4756, // 3D RAGE IIC PQFP PCI
0x4757, // 3D RAGE IIC BGA AGP
0x475A, // 3D RAGE IIC PQFP AGP
0x4C47, // 3D RAGE LT-G
};
static __inline BOOL IsDevice(
DWORD *lpDeviceIdList,
DWORD dwDeviceId,
int count)
{
int i;
for (i=0; i<count; i++)
if (dwDeviceId == lpDeviceIdList[i])
return TRUE;
return FALSE;
}
/****************************************************************************
REMARKS:
Test the Direct3D8 device for "lameness" with respect to GLDirect.
This is done on per-chipset basis, as in GLD CAD driver (DGLCONTEXT.C).
If bTestForWHQL is set then the device is tested to see if it is
certified, and bIsWHQL is set to indicate TRUE or FALSE. Otherwise bIsWHQL
is not set. [WHQL = Windows Hardware Quality Labs]
NOTE: There is a one- or two-second time penalty incurred in determining
the WHQL certification date.
****************************************************************************/
BOOL IsThisD3D8Lame(
IDirect3D8 *pD3D,
DWORD dwAdapter,
BOOL bTestForWHQL,
BOOL *bIsWHQL)
{
DWORD dwFlags = bTestForWHQL ? 0 : D3DENUM_NO_WHQL_LEVEL;
D3DADAPTER_IDENTIFIER8 d3dai;
HRESULT hr;
hr = IDirect3D8_GetAdapterIdentifier(pD3D, dwAdapter, dwFlags, &d3dai);
if (FAILED(hr))
return TRUE; // Definitely lame if adapter details can't be obtained!
if (bTestForWHQL) {
*bIsWHQL = d3dai.WHQLLevel ? TRUE : FALSE;
}
// Vendor 1: ATI
if (d3dai.VendorId == VENDORID_ATI) {
// Test A: ATI Rage PRO
if (IsDevice(devATIRagePro, d3dai.DeviceId, sizeof(devATIRagePro)))
return TRUE; // bad mipmapping
// Test B: ATI Rage II+
if (IsDevice(devATIRageIIplus, d3dai.DeviceId, sizeof(devATIRageIIplus)))
return TRUE; // bad HW alpha testing
}
return FALSE;
}
/****************************************************************************
REMARKS:
Test the Direct3DDevice8 device for "lameness" with respect to GLDirect.
This is done by querying for particular caps, as in GLD CPL (CPLMAIN.CPP).
****************************************************************************/
BOOL IsThisD3D8DeviceLame(
IDirect3DDevice8 *pDev)
{
D3DCAPS8 d3dCaps;
HRESULT hr;
hr = IDirect3DDevice8_GetDeviceCaps(pDev, &d3dCaps);
if (FAILED(hr))
return TRUE;
// Test 1: Perspective-correct textures
// Any card that cannot do perspective-textures is *exceptionally* lame.
if (!(d3dCaps.TextureCaps & D3DPTEXTURECAPS_PERSPECTIVE)) {
return TRUE; // Lame!
}
// Test 2: Bilinear filtering
if (!(d3dCaps.TextureFilterCaps & D3DPTFILTERCAPS_MINFLINEAR)) {
return TRUE; // Lame!
}
// Test 3: Mipmapping
if (!(d3dCaps.TextureCaps & D3DPTEXTURECAPS_MIPMAP)) {
return TRUE; // Lame!
}
// Test 4: Depth-test modes (?)
// Test 5: Blend Modes -- Based on DX7 D3DIM MTEXTURE.CPP caps test
// Accept devices that can do multipass, alpha blending
if( !((d3dCaps.DestBlendCaps & D3DPBLENDCAPS_INVSRCALPHA) &&
(d3dCaps.SrcBlendCaps & D3DPBLENDCAPS_SRCALPHA)) )
return TRUE;
// Accept devices that can do multipass, color blending
if( !((d3dCaps.DestBlendCaps & D3DPBLENDCAPS_SRCCOLOR) &&
(d3dCaps.SrcBlendCaps & D3DPBLENDCAPS_ZERO)) )
return TRUE;
// Accept devices that really support multiple textures.
if( !((d3dCaps.MaxTextureBlendStages > 1 ) &&
(d3dCaps.MaxSimultaneousTextures > 1 ) &&
(d3dCaps.TextureOpCaps & D3DTEXOPCAPS_MODULATE )) )
return TRUE;
return FALSE; // Not lame
}

View file

@ -1,520 +0,0 @@
/* File name : colors.h
* Version : 2.3
*
* Header file for display driver for Mesa 2.3 under
* Windows95 and WindowsNT
* This file defines macros and global variables needed
* for converting color format
*
* Copyright (C) 1996- Li Wei
* Address : Institute of Artificial Intelligence
* : & Robotics
* : Xi'an Jiaotong University
* Email : liwei@aiar.xjtu.edu.cn
* Web page : http://sun.aiar.xjtu.edu.cn
*
* This file and its associations are partially based on the
* Windows NT driver for Mesa, written by Mark Leaming
* (mark@rsinc.com).
*/
/*
* Macros for pixel format defined
*/
/*
* Revision 1.1 2004/04/20 11:13:11 alanh
* add SciTech's GLDirect driver for Windows.
*
* This code is donated to Mesa which allows the usage of
* a Direct3D layer (DX7, DX8, DX9 or complete software fallback).
*
* No build system exists for this code yet, that will come.....
*
* Revision 1.1.1.1 1999/08/19 00:55:42 jtg
* Imported sources
*
* Revision 1.2 1999/01/03 03:08:57 brianp
* Ted Jump's changes
*
* Revision 1.1 1999/01/03 03:08:12 brianp
* Initial revision
*
* Revision 2.0.2 1997/4/30 15:58:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn)
* Add LUTs need for dithering
*/
/*
* Revision 1.1 2004/04/20 11:13:11 alanh
* add SciTech's GLDirect driver for Windows.
*
* This code is donated to Mesa which allows the usage of
* a Direct3D layer (DX7, DX8, DX9 or complete software fallback).
*
* No build system exists for this code yet, that will come.....
*
* Revision 1.1.1.1 1999/08/19 00:55:42 jtg
* Imported sources
*
* Revision 1.2 1999/01/03 03:08:57 brianp
* Ted Jump's changes
*
* Revision 1.1 1999/01/03 03:08:12 brianp
* Initial revision
*
* Revision 2.0.1 1997/4/29 15:52:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn)
* Add BGR8 Macro
*/
/*
* Revision 1.1 2004/04/20 11:13:11 alanh
* add SciTech's GLDirect driver for Windows.
*
* This code is donated to Mesa which allows the usage of
* a Direct3D layer (DX7, DX8, DX9 or complete software fallback).
*
* No build system exists for this code yet, that will come.....
*
* Revision 1.1.1.1 1999/08/19 00:55:42 jtg
* Imported sources
*
* Revision 1.2 1999/01/03 03:08:57 brianp
* Ted Jump's changes
*
* Revision 1.1 1999/01/03 03:08:12 brianp
* Initial revision
*
* Revision 2.0 1996/11/15 10:55:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn)
* Initial revision
*/
/* Values for wmesa->pixelformat: */
#define PF_8A8B8G8R 3 /* 32-bit TrueColor: 8-A, 8-B, 8-G, 8-R */
#define PF_8R8G8B 4 /* 32-bit TrueColor: 8-R, 8-G, 8-B */
#define PF_5R6G5B 5 /* 16-bit TrueColor: 5-R, 6-G, 5-B bits */
#define PF_DITHER8 6 /* Dithered RGB using a lookup table */
#define PF_LOOKUP 7 /* Undithered RGB using a lookup table */
#define PF_GRAYSCALE 10 /* Grayscale or StaticGray */
#define PF_BADFORMAT 11
#define PF_INDEX8 12
char ColorMap16[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,
0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,
0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,
0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,
0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,
0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,
0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,
0x0B,0x0B,0x0B,0x0B,0x0B,0x0B,0x0B,0x0B,
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,
0x0D,0x0D,0x0D,0x0D,0x0D,0x0D,0x0D,0x0D,
0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,
0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,
0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,
0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,
0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14,
0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15,
0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,
0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,
0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,
0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,
0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,
0x1D,0x1D,0x1D,0x1D,0x1D,0x1D,0x1D,0x1D,
0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,
0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F};
#define BGR8(r,g,b) (unsigned)(((BYTE)(b & 0xc0 | (g & 0xe0)>>2 | (r & 0xe0)>>5)))
#ifdef DDRAW
#define BGR16(r,g,b) ((WORD)(((BYTE)(ColorMap16[b]) | ((BYTE)(g&0xfc) << 3)) | (((WORD)(BYTE)(ColorMap16[r])) << 11)))
#else
#define BGR16(r,g,b) ((WORD)(((BYTE)(ColorMap16[b]) | ((BYTE)(ColorMap16[g]) << 5)) | (((WORD)(BYTE)(ColorMap16[r])) << 10)))
#endif
#define BGR24(r,g,b) (unsigned long)(((DWORD)(((BYTE)(b)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(r))<<16))) << 8)
#define BGR32(r,g,b) (unsigned long)((DWORD)(((BYTE)(b)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(r))<<16)))
/*
* If pixelformat==PF_8A8B8G8R:
*/
#define PACK_8A8B8G8R( R, G, B, A ) \
( ((A) << 24) | ((B) << 16) | ((G) << 8) | (R) )
/*
* If pixelformat==PF_8R8G8B:
*/
#define PACK_8R8G8B( R, G, B) ( ((R) << 16) | ((G) << 8) | (B) )
/*
* If pixelformat==PF_5R6G5B:
*/
#ifdef DDRAW
#define PACK_5R6G5B( R, G, B) ((WORD)(((BYTE)(ColorMap16[B]) | ((BYTE)(G&0xfc) << 3)) | (((WORD)(BYTE)(ColorMap16[R])) << 11)))
#else
#define PACK_5R6G5B( R, G, B) ((WORD)(((BYTE)(ColorMap16[B]) | ((BYTE)(ColorMap16[G]) << 5)) | (((WORD)(BYTE)(ColorMap16[R])) << 10)))
#endif
/*----------------------------------------------------------------------------
Division lookup tables. These tables compute 0-255 divided by 51 and
modulo 51. These tables could approximate gamma correction.
*/
char unsigned const aDividedBy51Rounded[256] =
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
};
char unsigned const aDividedBy51[256] =
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5,
};
char unsigned const aModulo51[256] =
{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 0, 1, 2, 3, 4, 5, 6,
7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
44, 45, 46, 47, 48, 49, 50, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
49, 50, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 0, 1, 2, 3,
4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 0,
};
/*----------------------------------------------------------------------------
Multiplication LUTs. These compute 0-5 times 6 and 36.
*/
char unsigned const aTimes6[6] =
{
0, 6, 12, 18, 24, 30
};
char unsigned const aTimes36[6] =
{
0, 36, 72, 108, 144, 180
};
/*----------------------------------------------------------------------------
Dither matrices for 8 bit to 2.6 bit halftones.
*/
char unsigned const aHalftone16x16[256] =
{
0, 44, 9, 41, 3, 46, 12, 43, 1, 44, 10, 41, 3, 46, 12, 43,
34, 16, 25, 19, 37, 18, 28, 21, 35, 16, 26, 19, 37, 18, 28, 21,
38, 6, 47, 3, 40, 9, 50, 6, 38, 7, 47, 4, 40, 9, 49, 6,
22, 28, 13, 31, 25, 31, 15, 34, 22, 29, 13, 32, 24, 31, 15, 34,
2, 46, 12, 43, 1, 45, 10, 42, 2, 45, 11, 42, 1, 45, 11, 42,
37, 18, 27, 21, 35, 17, 26, 20, 36, 17, 27, 20, 36, 17, 26, 20,
40, 8, 49, 5, 38, 7, 48, 4, 39, 8, 48, 5, 39, 7, 48, 4,
24, 30, 15, 33, 23, 29, 13, 32, 23, 30, 14, 33, 23, 29, 14, 32,
2, 46, 12, 43, 0, 44, 10, 41, 3, 47, 12, 44, 0, 44, 10, 41,
37, 18, 27, 21, 35, 16, 25, 19, 37, 19, 28, 22, 35, 16, 25, 19,
40, 9, 49, 5, 38, 7, 47, 4, 40, 9, 50, 6, 38, 6, 47, 3,
24, 30, 15, 34, 22, 29, 13, 32, 25, 31, 15, 34, 22, 28, 13, 31,
1, 45, 11, 42, 2, 46, 11, 42, 1, 45, 10, 41, 2, 46, 11, 43,
36, 17, 26, 20, 36, 17, 27, 21, 35, 16, 26, 20, 36, 18, 27, 21,
39, 8, 48, 4, 39, 8, 49, 5, 38, 7, 48, 4, 39, 8, 49, 5,
23, 29, 14, 33, 24, 30, 14, 33, 23, 29, 13, 32, 24, 30, 14, 33,
};
char unsigned const aHalftone8x8[64] =
{
0, 38, 9, 47, 2, 40, 11, 50,
25, 12, 35, 22, 27, 15, 37, 24,
6, 44, 3, 41, 8, 47, 5, 43,
31, 19, 28, 15, 34, 21, 31, 18,
1, 39, 11, 49, 0, 39, 10, 48,
27, 14, 36, 23, 26, 13, 35, 23,
7, 46, 4, 43, 7, 45, 3, 42,
33, 20, 30, 17, 32, 19, 29, 16,
};
char unsigned const aHalftone4x4_1[16] =
{
0, 25, 6, 31,
38, 12, 44, 19,
9, 35, 3, 28,
47, 22, 41, 15
};
char unsigned const aHalftone4x4_2[16] =
{
41, 3, 9, 28,
35, 15, 22, 47,
6, 25, 38, 0,
19, 44, 31, 12
};
/***************************************************************************
aWinGHalftoneTranslation
Translates a 2.6 bit-per-pixel halftoned representation into the
slightly rearranged WinG Halftone Palette.
*/
char unsigned const aWinGHalftoneTranslation[216] =
{
0,
29,
30,
31,
32,
249,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48,
49,
50,
51,
52,
53,
54,
55,
56,
250,
250,
57,
58,
59,
251,
60,
61,
62,
63,
64,
65,
66,
67,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
78,
79,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
250,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
100,
101,
102,
103,
104,
105,
106,
107,
108,
109,
110,
111,
227,
112,
113,
114,
115,
116,
117,
118,
119,
151,
120,
121,
122,
123,
124,
228,
125,
126,
229,
133,
162,
135,
131,
132,
137,
166,
134,
140,
130,
136,
143,
138,
139,
174,
141,
142,
177,
129,
144,
145,
146,
147,
148,
149,
150,
157,
152,
153,
154,
155,
156,
192,
158,
159,
160,
161,
196,
163,
164,
165,
127,
199,
167,
168,
169,
170,
171,
172,
173,
207,
175,
176,
210,
178,
179,
180,
181,
182,
183,
184,
185,
186,
187,
188,
189,
190,
191,
224,
193,
194,
195,
252,
252,
197,
198,
128,
253,
252,
200,
201,
202,
203,
204,
205,
206,
230,
208,
209,
231,
211,
212,
213,
214,
215,
216,
217,
218,
219,
220,
221,
222,
254,
223,
232,
225,
226,
255,
};

File diff suppressed because it is too large Load diff

View file

@ -1,488 +0,0 @@
;****************************************************************************
;*
;* Mesa 3-D graphics library
;* Direct3D Driver Interface
;*
;* ========================================================================
;*
;* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
;*
;* Permission is hereby granted, free of charge, to any person obtaining a
;* copy of this software and associated documentation files (the "Software"),
;* to deal in the Software without restriction, including without limitation
;* the rights to use, copy, modify, merge, publish, distribute, sublicense,
;* and/or sell copies of the Software, and to permit persons to whom the
;* Software is furnished to do so, subject to the following conditions:
;*
;* The above copyright notice and this permission notice shall be included
;* in all copies or substantial portions of the Software.
;*
;* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
;* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
;* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
;* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
;* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
;* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
;* SOFTWARE.
;*
;* ======================================================================
;*
;* Language: ANSI C
;* Environment: Windows 9x/2000/XP/XBox (Win32)
;*
;* Description: DLL Module definition file
;*
;****************************************************************************/
DESCRIPTION 'GLDirect'
VERSION 3.0
EXPORTS
glAccum=glAccum @1
glAlphaFunc=glAlphaFunc @2
glAreTexturesResident=glAreTexturesResident @3
glArrayElement=glArrayElement @4
glBegin=glBegin @5
glBindTexture=glBindTexture @6
glBitmap=glBitmap @7
glBlendFunc=glBlendFunc @8
glCallList=glCallList @9
glCallLists=glCallLists @10
glClear=glClear @11
glClearAccum=glClearAccum @12
glClearIndex=glClearIndex @13
glClearColor=glClearColor @14
glClearDepth=glClearDepth @15
glClearStencil=glClearStencil @16
glClipPlane=glClipPlane @17
glColor3b=glColor3b @18
glColor3d=glColor3d @19
glColor3f=glColor3f @20
glColor3i=glColor3i @21
glColor3s=glColor3s @22
glColor3ub=glColor3ub @23
glColor3ui=glColor3ui @24
glColor3us=glColor3us @25
glColor4b=glColor4b @26
glColor4d=glColor4d @27
glColor4f=glColor4f @28
glColor4i=glColor4i @29
glColor4s=glColor4s @30
glColor4ub=glColor4ub @31
glColor4ui=glColor4ui @32
glColor4us=glColor4us @33
glColor3bv=glColor3bv @34
glColor3dv=glColor3dv @35
glColor3fv=glColor3fv @36
glColor3iv=glColor3iv @37
glColor3sv=glColor3sv @38
glColor3ubv=glColor3ubv @39
glColor3uiv=glColor3uiv @40
glColor3usv=glColor3usv @41
glColor4bv=glColor4bv @42
glColor4dv=glColor4dv @43
glColor4fv=glColor4fv @44
glColor4iv=glColor4iv @45
glColor4sv=glColor4sv @46
glColor4ubv=glColor4ubv @47
glColor4uiv=glColor4uiv @48
glColor4usv=glColor4usv @49
glColorMask=glColorMask @50
glColorMaterial=glColorMaterial @51
glColorPointer=glColorPointer @52
glColorTableEXT=glColorTableEXT @53
glColorSubTableEXT=glColorSubTableEXT @54
glCopyPixels=glCopyPixels @55
glCopyTexImage1D=glCopyTexImage1D @56
glCopyTexImage2D=glCopyTexImage2D @57
glCopyTexSubImage1D=glCopyTexSubImage1D @58
glCopyTexSubImage2D=glCopyTexSubImage2D @59
glCullFace=glCullFace @60
glDepthFunc=glDepthFunc @61
glDepthMask=glDepthMask @62
glDepthRange=glDepthRange @63
glDeleteLists=glDeleteLists @64
glDeleteTextures=glDeleteTextures @65
glDisable=glDisable @66
glDisableClientState=glDisableClientState @67
glDrawArrays=glDrawArrays @68
glDrawBuffer=glDrawBuffer @69
glDrawElements=glDrawElements @70
glDrawPixels=glDrawPixels @71
glEnable=glEnable @72
glEnableClientState=glEnableClientState @73
glEnd=glEnd @74
glEndList=glEndList @75
glEvalCoord1d=glEvalCoord1d @76
glEvalCoord1f=glEvalCoord1f @77
glEvalCoord1dv=glEvalCoord1dv @78
glEvalCoord1fv=glEvalCoord1fv @79
glEvalCoord2d=glEvalCoord2d @80
glEvalCoord2f=glEvalCoord2f @81
glEvalCoord2dv=glEvalCoord2dv @82
glEvalCoord2fv=glEvalCoord2fv @83
glEvalPoint1=glEvalPoint1 @84
glEvalPoint2=glEvalPoint2 @85
glEvalMesh1=glEvalMesh1 @86
glEdgeFlag=glEdgeFlag @87
glEdgeFlagv=glEdgeFlagv @88
glEdgeFlagPointer=glEdgeFlagPointer @89
glEvalMesh2=glEvalMesh2 @90
glFeedbackBuffer=glFeedbackBuffer @91
glFinish=glFinish @92
glFlush=glFlush @93
glFogf=glFogf @94
glFogi=glFogi @95
glFogfv=glFogfv @96
glFogiv=glFogiv @97
glFrontFace=glFrontFace @98
glFrustum=glFrustum @99
glGenLists=glGenLists @100
glGenTextures=glGenTextures @101
glGetBooleanv=glGetBooleanv @102
glGetClipPlane=glGetClipPlane @103
glGetColorTableEXT=glGetColorTableEXT @104
glGetColorTableParameterivEXT=glGetColorTableParameterivEXT @105
glGetColorTableParameterfvEXT=glGetColorTableParameterfvEXT @106
glGetDoublev=glGetDoublev @107
glGetError=glGetError @108
glGetFloatv=glGetFloatv @109
glGetIntegerv=glGetIntegerv @110
glGetLightfv=glGetLightfv @111
glGetLightiv=glGetLightiv @112
glGetMapdv=glGetMapdv @113
glGetMapfv=glGetMapfv @114
glGetMapiv=glGetMapiv @115
glGetMaterialfv=glGetMaterialfv @116
glGetMaterialiv=glGetMaterialiv @117
glGetPixelMapfv=glGetPixelMapfv @118
glGetPixelMapuiv=glGetPixelMapuiv @119
glGetPixelMapusv=glGetPixelMapusv @120
glGetPointerv=glGetPointerv @121
glGetPolygonStipple=glGetPolygonStipple @122
glGetString=glGetString @123
glGetTexEnvfv=glGetTexEnvfv @124
glGetTexEnviv=glGetTexEnviv @125
glGetTexGeniv=glGetTexGeniv @126
glGetTexGendv=glGetTexGendv @127
glGetTexGenfv=glGetTexGenfv @128
glGetTexImage=glGetTexImage @129
glGetTexLevelParameterfv=glGetTexLevelParameterfv @130
glGetTexLevelParameteriv=glGetTexLevelParameteriv @131
glGetTexParameterfv=glGetTexParameterfv @132
glGetTexParameteriv=glGetTexParameteriv @133
glHint=glHint @134
glIndexd=glIndexd @135
glIndexf=glIndexf @136
glIndexi=glIndexi @137
glIndexs=glIndexs @138
glIndexub=glIndexub @139
glIndexdv=glIndexdv @140
glIndexfv=glIndexfv @141
glIndexiv=glIndexiv @142
glIndexsv=glIndexsv @143
glIndexubv=glIndexubv @144
glIndexMask=glIndexMask @145
glIndexPointer=glIndexPointer @146
glInterleavedArrays=glInterleavedArrays @147
glInitNames=glInitNames @148
glIsList=glIsList @149
glIsTexture=glIsTexture @150
glLightf=glLightf @151
glLighti=glLighti @152
glLightfv=glLightfv @153
glLightiv=glLightiv @154
glLightModelf=glLightModelf @155
glLightModeli=glLightModeli @156
glLightModelfv=glLightModelfv @157
glLightModeliv=glLightModeliv @158
glLineWidth=glLineWidth @159
glLineStipple=glLineStipple @160
glListBase=glListBase @161
glLoadIdentity=glLoadIdentity @162
glLoadMatrixd=glLoadMatrixd @163
glLoadMatrixf=glLoadMatrixf @164
glLoadName=glLoadName @165
glLogicOp=glLogicOp @166
glMap1d=glMap1d @167
glMap1f=glMap1f @168
glMap2d=glMap2d @169
glMap2f=glMap2f @170
glMapGrid1d=glMapGrid1d @171
glMapGrid1f=glMapGrid1f @172
glMapGrid2d=glMapGrid2d @173
glMapGrid2f=glMapGrid2f @174
glMaterialf=glMaterialf @175
glMateriali=glMateriali @176
glMaterialfv=glMaterialfv @177
glMaterialiv=glMaterialiv @178
glMatrixMode=glMatrixMode @179
glMultMatrixd=glMultMatrixd @180
glMultMatrixf=glMultMatrixf @181
glNewList=glNewList @182
glNormal3b=glNormal3b @183
glNormal3d=glNormal3d @184
glNormal3f=glNormal3f @185
glNormal3i=glNormal3i @186
glNormal3s=glNormal3s @187
glNormal3bv=glNormal3bv @188
glNormal3dv=glNormal3dv @189
glNormal3fv=glNormal3fv @190
glNormal3iv=glNormal3iv @191
glNormal3sv=glNormal3sv @192
glNormalPointer=glNormalPointer @193
glOrtho=glOrtho @194
glPassThrough=glPassThrough @195
glPixelMapfv=glPixelMapfv @196
glPixelMapuiv=glPixelMapuiv @197
glPixelMapusv=glPixelMapusv @198
glPixelStoref=glPixelStoref @199
glPixelStorei=glPixelStorei @200
glPixelTransferf=glPixelTransferf @201
glPixelTransferi=glPixelTransferi @202
glPixelZoom=glPixelZoom @203
glPointSize=glPointSize @204
glPolygonMode=glPolygonMode @205
glPolygonOffset=glPolygonOffset @206
glPolygonOffsetEXT=glPolygonOffsetEXT @207
glPolygonStipple=glPolygonStipple @208
glPopAttrib=glPopAttrib @209
glPopClientAttrib=glPopClientAttrib @210
glPopMatrix=glPopMatrix @211
glPopName=glPopName @212
glPrioritizeTextures=glPrioritizeTextures @213
glPushMatrix=glPushMatrix @214
glRasterPos2d=glRasterPos2d @215
glRasterPos2f=glRasterPos2f @216
glRasterPos2i=glRasterPos2i @217
glRasterPos2s=glRasterPos2s @218
glRasterPos3d=glRasterPos3d @219
glRasterPos3f=glRasterPos3f @220
glRasterPos3i=glRasterPos3i @221
glRasterPos3s=glRasterPos3s @222
glRasterPos4d=glRasterPos4d @223
glRasterPos4f=glRasterPos4f @224
glRasterPos4i=glRasterPos4i @225
glRasterPos4s=glRasterPos4s @226
glRasterPos2dv=glRasterPos2dv @227
glRasterPos2fv=glRasterPos2fv @228
glRasterPos2iv=glRasterPos2iv @229
glRasterPos2sv=glRasterPos2sv @230
glRasterPos3dv=glRasterPos3dv @231
glRasterPos3fv=glRasterPos3fv @232
glRasterPos3iv=glRasterPos3iv @233
glRasterPos3sv=glRasterPos3sv @234
glRasterPos4dv=glRasterPos4dv @235
glRasterPos4fv=glRasterPos4fv @236
glRasterPos4iv=glRasterPos4iv @237
glRasterPos4sv=glRasterPos4sv @238
glReadBuffer=glReadBuffer @239
glReadPixels=glReadPixels @240
glRectd=glRectd @241
glRectf=glRectf @242
glRecti=glRecti @243
glRects=glRects @244
glRectdv=glRectdv @245
glRectfv=glRectfv @246
glRectiv=glRectiv @247
glRectsv=glRectsv @248
glScissor=glScissor @249
glIsEnabled=glIsEnabled @250
glPushAttrib=glPushAttrib @251
glPushClientAttrib=glPushClientAttrib @252
glPushName=glPushName @253
glRenderMode=glRenderMode @254
glRotated=glRotated @255
glRotatef=glRotatef @256
glSelectBuffer=glSelectBuffer @257
glScaled=glScaled @258
glScalef=glScalef @259
glShadeModel=glShadeModel @260
glStencilFunc=glStencilFunc @261
glStencilMask=glStencilMask @262
glStencilOp=glStencilOp @263
glTexCoord1d=glTexCoord1d @264
glTexCoord1f=glTexCoord1f @265
glTexCoord1i=glTexCoord1i @266
glTexCoord1s=glTexCoord1s @267
glTexCoord2d=glTexCoord2d @268
glTexCoord2f=glTexCoord2f @269
glTexCoord2i=glTexCoord2i @270
glTexCoord2s=glTexCoord2s @271
glTexCoord3d=glTexCoord3d @272
glTexCoord3f=glTexCoord3f @273
glTexCoord3i=glTexCoord3i @274
glTexCoord3s=glTexCoord3s @275
glTexCoord4d=glTexCoord4d @276
glTexCoord4f=glTexCoord4f @277
glTexCoord4i=glTexCoord4i @278
glTexCoord4s=glTexCoord4s @279
glTexCoord1dv=glTexCoord1dv @280
glTexCoord1fv=glTexCoord1fv @281
glTexCoord1iv=glTexCoord1iv @282
glTexCoord1sv=glTexCoord1sv @283
glTexCoord2dv=glTexCoord2dv @284
glTexCoord2fv=glTexCoord2fv @285
glTexCoord2iv=glTexCoord2iv @286
glTexCoord2sv=glTexCoord2sv @287
glTexCoord3dv=glTexCoord3dv @288
glTexCoord3fv=glTexCoord3fv @289
glTexCoord3iv=glTexCoord3iv @290
glTexCoord3sv=glTexCoord3sv @291
glTexCoord4dv=glTexCoord4dv @292
glTexCoord4fv=glTexCoord4fv @293
glTexCoord4iv=glTexCoord4iv @294
glTexCoord4sv=glTexCoord4sv @295
glTexCoordPointer=glTexCoordPointer @296
glTexGend=glTexGend @297
glTexGenf=glTexGenf @298
glTexGeni=glTexGeni @299
glTexGendv=glTexGendv @300
glTexGeniv=glTexGeniv @301
glTexGenfv=glTexGenfv @302
glTexEnvf=glTexEnvf @303
glTexEnvi=glTexEnvi @304
glTexEnvfv=glTexEnvfv @305
glTexEnviv=glTexEnviv @306
glTexImage1D=glTexImage1D @307
glTexImage2D=glTexImage2D @308
glTexParameterf=glTexParameterf @309
glTexParameteri=glTexParameteri @310
glTexParameterfv=glTexParameterfv @311
glTexParameteriv=glTexParameteriv @312
glTexSubImage1D=glTexSubImage1D @313
glTexSubImage2D=glTexSubImage2D @314
glTranslated=glTranslated @315
glTranslatef=glTranslatef @316
glVertex2d=glVertex2d @317
glVertex2f=glVertex2f @318
glVertex2i=glVertex2i @319
glVertex2s=glVertex2s @320
glVertex3d=glVertex3d @321
glVertex3f=glVertex3f @322
glVertex3i=glVertex3i @323
glVertex3s=glVertex3s @324
glVertex4d=glVertex4d @325
glVertex4f=glVertex4f @326
glVertex4i=glVertex4i @327
glVertex4s=glVertex4s @328
glVertex2dv=glVertex2dv @329
glVertex2fv=glVertex2fv @330
glVertex2iv=glVertex2iv @331
glVertex2sv=glVertex2sv @332
glVertex3dv=glVertex3dv @333
glVertex3fv=glVertex3fv @334
glVertex3iv=glVertex3iv @335
glVertex3sv=glVertex3sv @336
glVertex4dv=glVertex4dv @337
glVertex4fv=glVertex4fv @338
glVertex4iv=glVertex4iv @339
glVertex4sv=glVertex4sv @340
glVertexPointer=glVertexPointer @341
glViewport=glViewport @342
glBlendEquationEXT=glBlendEquationEXT @343
glBlendColorEXT=glBlendColorEXT @344
glVertexPointerEXT=glVertexPointerEXT @345
glNormalPointerEXT=glNormalPointerEXT @346
glColorPointerEXT=glColorPointerEXT @347
glIndexPointerEXT=glIndexPointerEXT @348
glTexCoordPointerEXT=glTexCoordPointerEXT @349
glEdgeFlagPointerEXT=glEdgeFlagPointerEXT @350
glGetPointervEXT=glGetPointervEXT @351
glArrayElementEXT=glArrayElementEXT @352
glDrawArraysEXT=glDrawArraysEXT @353
glBindTextureEXT=glBindTextureEXT @354
glDeleteTexturesEXT=glDeleteTexturesEXT @355
glGenTexturesEXT=glGenTexturesEXT @356
glPrioritizeTexturesEXT=glPrioritizeTexturesEXT @357
glCopyTexSubImage3DEXT=glCopyTexSubImage3DEXT @358
glTexImage3DEXT=glTexImage3DEXT @359
glTexSubImage3DEXT=glTexSubImage3DEXT @360
glWindowPos4fMESA=glWindowPos4fMESA @361
glWindowPos2iMESA=glWindowPos2iMESA @362
glWindowPos2sMESA=glWindowPos2sMESA @363
glWindowPos2fMESA=glWindowPos2fMESA @364
glWindowPos2dMESA=glWindowPos2dMESA @365
glWindowPos2ivMESA=glWindowPos2ivMESA @366
glWindowPos2svMESA=glWindowPos2svMESA @367
glWindowPos2fvMESA=glWindowPos2fvMESA @368
glWindowPos2dvMESA=glWindowPos2dvMESA @369
glWindowPos3iMESA=glWindowPos3iMESA @370
glWindowPos3sMESA=glWindowPos3sMESA @371
glWindowPos3fMESA=glWindowPos3fMESA @372
glWindowPos3dMESA=glWindowPos3dMESA @373
glWindowPos3ivMESA=glWindowPos3ivMESA @374
glWindowPos3svMESA=glWindowPos3svMESA @375
glWindowPos3fvMESA=glWindowPos3fvMESA @376
glWindowPos3dvMESA=glWindowPos3dvMESA @377
glWindowPos4iMESA=glWindowPos4iMESA @378
glWindowPos4sMESA=glWindowPos4sMESA @379
glWindowPos4dMESA=glWindowPos4dMESA @380
glWindowPos4ivMESA=glWindowPos4ivMESA @381
glWindowPos4svMESA=glWindowPos4svMESA @382
glWindowPos4fvMESA=glWindowPos4fvMESA @383
glWindowPos4dvMESA=glWindowPos4dvMESA @384
glResizeBuffersMESA=glResizeBuffersMESA @385
wglCopyContext=wglCopyContext @386
wglCreateContext=wglCreateContext @387
wglCreateLayerContext=wglCreateLayerContext @388
wglDeleteContext=wglDeleteContext @389
wglDescribeLayerPlane=wglDescribeLayerPlane @390
wglGetCurrentContext=wglGetCurrentContext @391
wglGetCurrentDC=wglGetCurrentDC @392
wglGetLayerPaletteEntries=wglGetLayerPaletteEntries @393
wglGetProcAddress=wglGetProcAddress @394
wglMakeCurrent=wglMakeCurrent @395
wglRealizeLayerPalette=wglRealizeLayerPalette @396
wglSetLayerPaletteEntries=wglSetLayerPaletteEntries @397
wglShareLists=wglShareLists @398
wglSwapLayerBuffers=wglSwapLayerBuffers @399
wglUseFontBitmapsA=wglUseFontBitmapsA @400
wglUseFontBitmapsW=wglUseFontBitmapsW @401
wglUseFontOutlinesA=wglUseFontOutlinesA @402
wglUseFontOutlinesW=wglUseFontOutlinesW @403
ChoosePixelFormat=ChoosePixelFormat @404
DescribePixelFormat=DescribePixelFormat @405
GetPixelFormat=GetPixelFormat @406
SetPixelFormat=SetPixelFormat @407
SwapBuffers=SwapBuffers @408
wglChoosePixelFormat=wglChoosePixelFormat @409
wglDescribePixelFormat=wglDescribePixelFormat @410
wglGetPixelFormat=wglGetPixelFormat @411
wglSetPixelFormat=wglSetPixelFormat @412
wglSwapBuffers=wglSwapBuffers @413
glActiveTextureARB=glActiveTextureARB @414
glClientActiveTextureARB=glClientActiveTextureARB @415
glMultiTexCoord1dARB=glMultiTexCoord1dARB @416
glMultiTexCoord1dvARB=glMultiTexCoord1dvARB @417
glMultiTexCoord1fARB=glMultiTexCoord1fARB @418
glMultiTexCoord1fvARB=glMultiTexCoord1fvARB @419
glMultiTexCoord1iARB=glMultiTexCoord1iARB @420
glMultiTexCoord1ivARB=glMultiTexCoord1ivARB @421
glMultiTexCoord1sARB=glMultiTexCoord1sARB @422
glMultiTexCoord1svARB=glMultiTexCoord1svARB @423
glMultiTexCoord2dARB=glMultiTexCoord2dARB @424
glMultiTexCoord2dvARB=glMultiTexCoord2dvARB @425
glMultiTexCoord2fARB=glMultiTexCoord2fARB @426
glMultiTexCoord2fvARB=glMultiTexCoord2fvARB @427
glMultiTexCoord2iARB=glMultiTexCoord2iARB @428
glMultiTexCoord2ivARB=glMultiTexCoord2ivARB @429
glMultiTexCoord2sARB=glMultiTexCoord2sARB @430
glMultiTexCoord2svARB=glMultiTexCoord2svARB @431
glMultiTexCoord3dARB=glMultiTexCoord3dARB @432
glMultiTexCoord3dvARB=glMultiTexCoord3dvARB @433
glMultiTexCoord3fARB=glMultiTexCoord3fARB @434
glMultiTexCoord3fvARB=glMultiTexCoord3fvARB @435
glMultiTexCoord3iARB=glMultiTexCoord3iARB @436
glMultiTexCoord3ivARB=glMultiTexCoord3ivARB @437
glMultiTexCoord3sARB=glMultiTexCoord3sARB @438
glMultiTexCoord3svARB=glMultiTexCoord3svARB @439
glMultiTexCoord4dARB=glMultiTexCoord4dARB @440
glMultiTexCoord4dvARB=glMultiTexCoord4dvARB @441
glMultiTexCoord4fARB=glMultiTexCoord4fARB @442
glMultiTexCoord4fvARB=glMultiTexCoord4fvARB @443
glMultiTexCoord4iARB=glMultiTexCoord4iARB @444
glMultiTexCoord4ivARB=glMultiTexCoord4ivARB @445
glMultiTexCoord4sARB=glMultiTexCoord4sARB @446
glMultiTexCoord4svARB=glMultiTexCoord4svARB @447

View file

@ -1,495 +0,0 @@
;****************************************************************************
;*
;* Mesa 3-D graphics library
;* Direct3D Driver Interface
;*
;* ========================================================================
;*
;* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
;*
;* Permission is hereby granted, free of charge, to any person obtaining a
;* copy of this software and associated documentation files (the "Software"),
;* to deal in the Software without restriction, including without limitation
;* the rights to use, copy, modify, merge, publish, distribute, sublicense,
;* and/or sell copies of the Software, and to permit persons to whom the
;* Software is furnished to do so, subject to the following conditions:
;*
;* The above copyright notice and this permission notice shall be included
;* in all copies or substantial portions of the Software.
;*
;* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
;* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
;* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
;* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
;* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
;* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
;* SOFTWARE.
;*
;* ======================================================================
;*
;* Language: ANSI C
;* Environment: Windows 9x/2000/XP/XBox (Win32)
;*
;* Description: DLL Module definition file
;*
;****************************************************************************/
DESCRIPTION 'GLDirect'
VERSION 3.0
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
;These functions are identical and therefore share the same addresses
ChoosePixelFormat = wglChoosePixelFormat
DescribePixelFormat = wglDescribePixelFormat
GetPixelFormat = wglGetPixelFormat
SetPixelFormat = wglSetPixelFormat
SwapBuffers = wglSwapBuffers
wglChoosePixelFormat
wglDescribePixelFormat
wglGetPixelFormat
wglSetPixelFormat
wglSwapBuffers
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

View file

@ -1,108 +0,0 @@
/****************************************************************************
*
* Mesa 3-D graphics library
* Direct3D Driver Interface
*
* ========================================================================
*
* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* ======================================================================
*
* Language: ANSI C
* Environment: Windows 9x (Win32)
*
* Description: Pixel packing functions.
*
****************************************************************************/
#ifndef __PIXPACK_H
#define __PIXPACK_H
#include <GL\gl.h>
#include <ddraw.h>
#include "ddlog.h"
/*---------------------- Macros and type definitions ----------------------*/
#define PXAPI
// Typedef that can be used for pixel packing function pointers.
#define PX_PACK_FUNC(a) void PXAPI (a)(unsigned char *pixdata, void *dst, GLenum Format, const LPDDSURFACEDESC2 lpDDSD2)
typedef void (PXAPI *PX_packFunc)(unsigned char *pixdata, void *dst, GLenum Format, const LPDDSURFACEDESC2 lpDDSD2);
// Typedef that can be used for pixel unpacking function pointers.
#define PX_UNPACK_FUNC(a) void PXAPI (a)(unsigned char *pixdata, void *src, GLenum Format, const LPDDSURFACEDESC2 lpDDSD2)
typedef void (PXAPI *PX_unpackFunc)(unsigned char *pixdata, void *src, GLenum Format, const LPDDSURFACEDESC2 lpDDSD2);
// Typedef that can be used for pixel span packing function pointers.
#define PX_PACK_SPAN_FUNC(a) void PXAPI (a)(GLuint n, unsigned char *pixdata, unsigned char *dst, GLenum Format, const LPDDSURFACEDESC2 lpDDSD2)
typedef void (PXAPI *PX_packSpanFunc)(GLuint n, unsigned char *pixdata, unsigned char *dst, GLenum Format, const LPDDSURFACEDESC2 lpDDSD2);
/*------------------------- Function Prototypes ---------------------------*/
#ifdef __cplusplus
extern "C" {
#endif
// Function that examines a pixel format and returns the relevent
// pixel-packing function
void PXAPI pxClassifyPixelFormat(const LPDDPIXELFORMAT lpddpf, PX_packFunc *lpPackFn ,PX_unpackFunc *lpUnpackFn, PX_packSpanFunc *lpPackSpanFn);
// Packing functions
PX_PACK_FUNC(pxPackGeneric);
PX_PACK_FUNC(pxPackRGB555);
PX_PACK_FUNC(pxPackARGB4444);
PX_PACK_FUNC(pxPackARGB1555);
PX_PACK_FUNC(pxPackRGB565);
PX_PACK_FUNC(pxPackRGB332);
PX_PACK_FUNC(pxPackRGB888);
PX_PACK_FUNC(pxPackARGB8888);
PX_PACK_FUNC(pxPackPAL8);
// Unpacking functions
PX_UNPACK_FUNC(pxUnpackGeneric);
PX_UNPACK_FUNC(pxUnpackRGB555);
PX_UNPACK_FUNC(pxUnpackARGB4444);
PX_UNPACK_FUNC(pxUnpackARGB1555);
PX_UNPACK_FUNC(pxUnpackRGB565);
PX_UNPACK_FUNC(pxUnpackRGB332);
PX_UNPACK_FUNC(pxUnpackRGB888);
PX_UNPACK_FUNC(pxUnpackARGB8888);
PX_UNPACK_FUNC(pxUnpackPAL8);
// Span Packing functions
PX_PACK_SPAN_FUNC(pxPackSpanGeneric);
PX_PACK_SPAN_FUNC(pxPackSpanRGB555);
PX_PACK_SPAN_FUNC(pxPackSpanARGB4444);
PX_PACK_SPAN_FUNC(pxPackSpanARGB1555);
PX_PACK_SPAN_FUNC(pxPackSpanRGB565);
PX_PACK_SPAN_FUNC(pxPackSpanRGB332);
PX_PACK_SPAN_FUNC(pxPackSpanRGB888);
PX_PACK_SPAN_FUNC(pxPackSpanARGB8888);
PX_PACK_SPAN_FUNC(pxPackSpanPAL8);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,347 +0,0 @@
/*
* Mesa 3-D graphics library
* Version: 6.1
*
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* File name: icd.c
* Author: Gregor Anich
*
* ICD (Installable Client Driver) interface.
* Based on the windows GDI/WGL driver.
*/
#ifdef __cplusplus
extern "C" {
#endif
#include <windows.h>
#define GL_GLEXT_PROTOTYPES
#include "GL/gl.h"
#include "GL/glext.h"
#ifdef __cplusplus
}
#endif
#include <stdio.h>
#include <tchar.h>
#include "GL/wmesa.h"
#include "mtypes.h"
#include "glapi.h"
#define MAX_MESA_ATTRS 20
typedef struct wmesa_context *PWMC;
typedef struct _icdTable {
DWORD size;
PROC table[336];
} ICDTABLE, *PICDTABLE;
#ifdef USE_MGL_NAMESPACE
# define GL_FUNC(func) mgl##func
#else
# define GL_FUNC(func) gl##func
#endif
static ICDTABLE icdTable = { 336, {
#define ICD_ENTRY(func) (PROC)GL_FUNC(func),
#include "icdlist.h"
#undef ICD_ENTRY
} };
struct __pixelformat__
{
PIXELFORMATDESCRIPTOR pfd;
GLboolean doubleBuffered;
};
struct __pixelformat__ pix[] =
{
/* Double Buffer, alpha */
{ { sizeof(PIXELFORMATDESCRIPTOR), 1,
PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|PFD_DOUBLEBUFFER|PFD_SWAP_COPY,
PFD_TYPE_RGBA,
24, 8, 0, 8, 8, 8, 16, 8, 24,
0, 0, 0, 0, 0, 16, 8, 0, 0, 0, 0, 0, 0 },
GL_TRUE
},
/* Single Buffer, alpha */
{ { sizeof(PIXELFORMATDESCRIPTOR), 1,
PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL, /* | PFD_SUPPORT_GDI ? */
PFD_TYPE_RGBA,
24, 8, 0, 8, 8, 8, 16, 8, 24,
0, 0, 0, 0, 0, 16, 8, 0, 0, 0, 0, 0, 0 },
GL_FALSE
},
/* Double Buffer, no alpha */
{ { sizeof(PIXELFORMATDESCRIPTOR), 1,
PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|PFD_DOUBLEBUFFER|PFD_SWAP_COPY,
PFD_TYPE_RGBA,
24, 8, 0, 8, 8, 8, 16, 0, 0,
0, 0, 0, 0, 0, 16, 8, 0, 0, 0, 0, 0, 0 },
GL_TRUE
},
/* Single Buffer, no alpha */
{ { sizeof(PIXELFORMATDESCRIPTOR), 1,
PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL, /* | PFD_SUPPORT_GDI ? */
PFD_TYPE_RGBA,
24, 8, 0, 8, 8, 8, 16, 0, 0,
0, 0, 0, 0, 0, 16, 8, 0, 0, 0, 0, 0, 0 },
GL_FALSE
},
};
int qt_pix = sizeof(pix) / sizeof(pix[0]);
typedef struct {
WMesaContext ctx;
HDC hdc;
} MesaWglCtx;
#define MESAWGL_CTX_MAX_COUNT 20
static MesaWglCtx wgl_ctx[MESAWGL_CTX_MAX_COUNT];
static unsigned ctx_count = 0;
static int ctx_current = -1;
static unsigned curPFD = 0;
WGLAPI BOOL GLAPIENTRY DrvCopyContext(HGLRC hglrcSrc,HGLRC hglrcDst,UINT mask)
{
(void) hglrcSrc; (void) hglrcDst; (void) mask;
return(FALSE);
}
WGLAPI HGLRC GLAPIENTRY DrvCreateContext(HDC hdc)
{
HWND hWnd;
int i = 0;
if(!(hWnd = WindowFromDC(hdc)))
{
SetLastError(0);
return(NULL);
}
if (!ctx_count)
{
for(i=0;i<MESAWGL_CTX_MAX_COUNT;i++)
{
wgl_ctx[i].ctx = NULL;
wgl_ctx[i].hdc = NULL;
}
}
for( i = 0; i < MESAWGL_CTX_MAX_COUNT; i++ )
{
if ( wgl_ctx[i].ctx == NULL )
{
wgl_ctx[i].ctx = WMesaCreateContext( hWnd, NULL, GL_TRUE,
pix[curPFD-1].doubleBuffered,
pix[curPFD-1].pfd.cAlphaBits ? GL_TRUE : GL_FALSE);
if (wgl_ctx[i].ctx == NULL)
break;
wgl_ctx[i].hdc = hdc;
ctx_count++;
return ((HGLRC)wgl_ctx[i].ctx);
}
}
SetLastError(0);
return(NULL);
}
WGLAPI BOOL GLAPIENTRY DrvDeleteContext(HGLRC hglrc)
{
int i;
for ( i = 0; i < MESAWGL_CTX_MAX_COUNT; i++ )
{
if ( wgl_ctx[i].ctx == (PWMC) hglrc )
{
WMesaMakeCurrent((PWMC) hglrc);
WMesaDestroyContext();
wgl_ctx[i].ctx = NULL;
wgl_ctx[i].hdc = NULL;
ctx_count--;
return(TRUE);
}
}
SetLastError(0);
return(FALSE);
}
WGLAPI HGLRC GLAPIENTRY DrvCreateLayerContext(HDC hdc,int iLayerPlane)
{
if (iLayerPlane == 0)
return DrvCreateContext(hdc);
SetLastError(0);
return(NULL);
}
WGLAPI PICDTABLE GLAPIENTRY DrvSetContext(HDC hdc,HGLRC hglrc,void *callback)
{
int i;
(void) callback;
/* new code suggested by Andy Sy */
if (!hdc || !hglrc) {
WMesaMakeCurrent(NULL);
ctx_current = -1;
return NULL;
}
for ( i = 0; i < MESAWGL_CTX_MAX_COUNT; i++ )
{
if ( wgl_ctx[i].ctx == (PWMC) hglrc )
{
wgl_ctx[i].hdc = hdc;
WMesaMakeCurrent( (PWMC) hglrc );
ctx_current = i;
return &icdTable;
}
}
return NULL;
}
WGLAPI void GLAPIENTRY DrvReleaseContext(HGLRC hglrc)
{
(void) hglrc;
WMesaMakeCurrent(NULL);
ctx_current = -1;
}
WGLAPI BOOL GLAPIENTRY DrvShareLists(HGLRC hglrc1,HGLRC hglrc2)
{
(void) hglrc1; (void) hglrc2;
return(TRUE);
}
WGLAPI BOOL GLAPIENTRY DrvDescribeLayerPlane(HDC hdc,int iPixelFormat,
int iLayerPlane,UINT nBytes,
LPLAYERPLANEDESCRIPTOR plpd)
{
(void) hdc; (void) iPixelFormat; (void) iLayerPlane; (void) nBytes; (void) plpd;
SetLastError(0);
return(FALSE);
}
WGLAPI int GLAPIENTRY DrvSetLayerPaletteEntries(HDC hdc,int iLayerPlane,
int iStart,int cEntries,
CONST COLORREF *pcr)
{
(void) hdc; (void) iLayerPlane; (void) iStart; (void) cEntries; (void) pcr;
SetLastError(0);
return(0);
}
WGLAPI int GLAPIENTRY DrvGetLayerPaletteEntries(HDC hdc,int iLayerPlane,
int iStart,int cEntries,
COLORREF *pcr)
{
(void) hdc; (void) iLayerPlane; (void) iStart; (void) cEntries; (void) pcr;
SetLastError(0);
return(0);
}
WGLAPI BOOL GLAPIENTRY DrvRealizeLayerPalette(HDC hdc,int iLayerPlane,BOOL bRealize)
{
(void) hdc; (void) iLayerPlane; (void) bRealize;
SetLastError(0);
return(FALSE);
}
WGLAPI BOOL GLAPIENTRY DrvSwapLayerBuffers(HDC hdc,UINT fuPlanes)
{
(void) fuPlanes;
if( !hdc )
{
WMesaSwapBuffers();
return(TRUE);
}
SetLastError(0);
return(FALSE);
}
WGLAPI int GLAPIENTRY DrvDescribePixelFormat(HDC hdc,int iPixelFormat,UINT nBytes,
LPPIXELFORMATDESCRIPTOR ppfd)
{
int qt_valid_pix;
(void) hdc;
qt_valid_pix = qt_pix;
if(ppfd == NULL)
return(qt_valid_pix);
if(iPixelFormat < 1 || iPixelFormat > qt_valid_pix || nBytes != sizeof(PIXELFORMATDESCRIPTOR))
{
SetLastError(0);
return(0);
}
*ppfd = pix[iPixelFormat - 1].pfd;
return(qt_valid_pix);
}
/*
* GetProcAddress - return the address of an appropriate extension
*/
WGLAPI PROC GLAPIENTRY DrvGetProcAddress(LPCSTR lpszProc)
{
PROC p = (PROC) (int) _glapi_get_proc_address((const char *) lpszProc);
if (p)
return p;
SetLastError(0);
return(NULL);
}
WGLAPI BOOL GLAPIENTRY DrvSetPixelFormat(HDC hdc,int iPixelFormat)
{
int qt_valid_pix;
(void) hdc;
qt_valid_pix = qt_pix;
if(iPixelFormat < 1 || iPixelFormat > qt_valid_pix)
{
SetLastError(0);
return(FALSE);
}
curPFD = iPixelFormat;
return(TRUE);
}
WGLAPI BOOL GLAPIENTRY DrvSwapBuffers(HDC hdc)
{
(void) hdc;
if (ctx_current < 0)
return FALSE;
if(wgl_ctx[ctx_current].ctx == NULL) {
SetLastError(0);
return(FALSE);
}
WMesaSwapBuffers();
return(TRUE);
}
WGLAPI BOOL GLAPIENTRY DrvValidateVersion(DWORD version)
{
(void) version;
return TRUE;
}

View file

@ -1,336 +0,0 @@
ICD_ENTRY(NewList) /* 0 */
ICD_ENTRY(EndList) /* 1 */
ICD_ENTRY(CallList) /* 2 */
ICD_ENTRY(CallLists) /* 3 */
ICD_ENTRY(DeleteLists) /* 4 */
ICD_ENTRY(GenLists) /* 5 */
ICD_ENTRY(ListBase) /* 6 */
ICD_ENTRY(Begin) /* 7 */
ICD_ENTRY(Bitmap) /* 8 */
ICD_ENTRY(Color3b) /* 9 */
ICD_ENTRY(Color3bv) /* 10 */
ICD_ENTRY(Color3d) /* 11 */
ICD_ENTRY(Color3dv) /* 12 */
ICD_ENTRY(Color3f) /* 13 */
ICD_ENTRY(Color3fv) /* 14 */
ICD_ENTRY(Color3i) /* 15 */
ICD_ENTRY(Color3iv) /* 16 */
ICD_ENTRY(Color3s) /* 17 */
ICD_ENTRY(Color3sv) /* 18 */
ICD_ENTRY(Color3ub) /* 19 */
ICD_ENTRY(Color3ubv) /* 20 */
ICD_ENTRY(Color3ui) /* 21 */
ICD_ENTRY(Color3uiv) /* 22 */
ICD_ENTRY(Color3us) /* 23 */
ICD_ENTRY(Color3usv) /* 24 */
ICD_ENTRY(Color4b) /* 25 */
ICD_ENTRY(Color4bv) /* 26 */
ICD_ENTRY(Color4d) /* 27 */
ICD_ENTRY(Color4dv) /* 28 */
ICD_ENTRY(Color4f) /* 29 */
ICD_ENTRY(Color4fv) /* 30 */
ICD_ENTRY(Color4i) /* 31 */
ICD_ENTRY(Color4iv) /* 32 */
ICD_ENTRY(Color4s) /* 33 */
ICD_ENTRY(Color4sv) /* 34 */
ICD_ENTRY(Color4ub) /* 35 */
ICD_ENTRY(Color4ubv) /* 36 */
ICD_ENTRY(Color4ui) /* 37 */
ICD_ENTRY(Color4uiv) /* 38 */
ICD_ENTRY(Color4us) /* 39 */
ICD_ENTRY(Color4usv) /* 40 */
ICD_ENTRY(EdgeFlag) /* 41 */
ICD_ENTRY(EdgeFlagv) /* 42 */
ICD_ENTRY(End) /* 43 */
ICD_ENTRY(Indexd) /* 44 */
ICD_ENTRY(Indexdv) /* 45 */
ICD_ENTRY(Indexf) /* 46 */
ICD_ENTRY(Indexfv) /* 47 */
ICD_ENTRY(Indexi) /* 48 */
ICD_ENTRY(Indexiv) /* 49 */
ICD_ENTRY(Indexs) /* 50 */
ICD_ENTRY(Indexsv) /* 51 */
ICD_ENTRY(Normal3b) /* 52 */
ICD_ENTRY(Normal3bv) /* 53 */
ICD_ENTRY(Normal3d) /* 54 */
ICD_ENTRY(Normal3dv) /* 55 */
ICD_ENTRY(Normal3f) /* 56 */
ICD_ENTRY(Normal3fv) /* 57 */
ICD_ENTRY(Normal3i) /* 58 */
ICD_ENTRY(Normal3iv) /* 59 */
ICD_ENTRY(Normal3s) /* 60 */
ICD_ENTRY(Normal3sv) /* 61 */
ICD_ENTRY(RasterPos2d) /* 62 */
ICD_ENTRY(RasterPos2dv) /* 63 */
ICD_ENTRY(RasterPos2f) /* 64 */
ICD_ENTRY(RasterPos2fv) /* 65 */
ICD_ENTRY(RasterPos2i) /* 66 */
ICD_ENTRY(RasterPos2iv) /* 67 */
ICD_ENTRY(RasterPos2s) /* 68 */
ICD_ENTRY(RasterPos2sv) /* 69 */
ICD_ENTRY(RasterPos3d) /* 70 */
ICD_ENTRY(RasterPos3dv) /* 71 */
ICD_ENTRY(RasterPos3f) /* 72 */
ICD_ENTRY(RasterPos3fv) /* 73 */
ICD_ENTRY(RasterPos3i) /* 74 */
ICD_ENTRY(RasterPos3iv) /* 75 */
ICD_ENTRY(RasterPos3s) /* 76 */
ICD_ENTRY(RasterPos3sv) /* 77 */
ICD_ENTRY(RasterPos4d) /* 78 */
ICD_ENTRY(RasterPos4dv) /* 79 */
ICD_ENTRY(RasterPos4f) /* 80 */
ICD_ENTRY(RasterPos4fv) /* 81 */
ICD_ENTRY(RasterPos4i) /* 82 */
ICD_ENTRY(RasterPos4iv) /* 83 */
ICD_ENTRY(RasterPos4s) /* 84 */
ICD_ENTRY(RasterPos4sv) /* 85 */
ICD_ENTRY(Rectd) /* 86 */
ICD_ENTRY(Rectdv) /* 87 */
ICD_ENTRY(Rectf) /* 88 */
ICD_ENTRY(Rectfv) /* 89 */
ICD_ENTRY(Recti) /* 90 */
ICD_ENTRY(Rectiv) /* 91 */
ICD_ENTRY(Rects) /* 92 */
ICD_ENTRY(Rectsv) /* 93 */
ICD_ENTRY(TexCoord1d) /* 94 */
ICD_ENTRY(TexCoord1dv) /* 95 */
ICD_ENTRY(TexCoord1f) /* 96 */
ICD_ENTRY(TexCoord1fv) /* 97 */
ICD_ENTRY(TexCoord1i) /* 98 */
ICD_ENTRY(TexCoord1iv) /* 99 */
ICD_ENTRY(TexCoord1s) /* 100 */
ICD_ENTRY(TexCoord1sv) /* 101 */
ICD_ENTRY(TexCoord2d) /* 102 */
ICD_ENTRY(TexCoord2dv) /* 103 */
ICD_ENTRY(TexCoord2f) /* 104 */
ICD_ENTRY(TexCoord2fv) /* 105 */
ICD_ENTRY(TexCoord2i) /* 106 */
ICD_ENTRY(TexCoord2iv) /* 107 */
ICD_ENTRY(TexCoord2s) /* 108 */
ICD_ENTRY(TexCoord2sv) /* 109 */
ICD_ENTRY(TexCoord3d) /* 110 */
ICD_ENTRY(TexCoord3dv) /* 111 */
ICD_ENTRY(TexCoord3f) /* 112 */
ICD_ENTRY(TexCoord3fv) /* 113 */
ICD_ENTRY(TexCoord3i) /* 114 */
ICD_ENTRY(TexCoord3iv) /* 115 */
ICD_ENTRY(TexCoord3s) /* 116 */
ICD_ENTRY(TexCoord3sv) /* 117 */
ICD_ENTRY(TexCoord4d) /* 118 */
ICD_ENTRY(TexCoord4dv) /* 119 */
ICD_ENTRY(TexCoord4f) /* 120 */
ICD_ENTRY(TexCoord4fv) /* 121 */
ICD_ENTRY(TexCoord4i) /* 122 */
ICD_ENTRY(TexCoord4iv) /* 123 */
ICD_ENTRY(TexCoord4s) /* 124 */
ICD_ENTRY(TexCoord4sv) /* 125 */
ICD_ENTRY(Vertex2d) /* 126 */
ICD_ENTRY(Vertex2dv) /* 127 */
ICD_ENTRY(Vertex2f) /* 128 */
ICD_ENTRY(Vertex2fv) /* 129 */
ICD_ENTRY(Vertex2i) /* 130 */
ICD_ENTRY(Vertex2iv) /* 131 */
ICD_ENTRY(Vertex2s) /* 132 */
ICD_ENTRY(Vertex2sv) /* 133 */
ICD_ENTRY(Vertex3d) /* 134 */
ICD_ENTRY(Vertex3dv) /* 135 */
ICD_ENTRY(Vertex3f) /* 136 */
ICD_ENTRY(Vertex3fv) /* 137 */
ICD_ENTRY(Vertex3i) /* 138 */
ICD_ENTRY(Vertex3iv) /* 139 */
ICD_ENTRY(Vertex3s) /* 140 */
ICD_ENTRY(Vertex3sv) /* 141 */
ICD_ENTRY(Vertex4d) /* 142 */
ICD_ENTRY(Vertex4dv) /* 143 */
ICD_ENTRY(Vertex4f) /* 144 */
ICD_ENTRY(Vertex4fv) /* 145 */
ICD_ENTRY(Vertex4i) /* 146 */
ICD_ENTRY(Vertex4iv) /* 147 */
ICD_ENTRY(Vertex4s) /* 148 */
ICD_ENTRY(Vertex4sv) /* 149 */
ICD_ENTRY(ClipPlane) /* 150 */
ICD_ENTRY(ColorMaterial) /* 151 */
ICD_ENTRY(CullFace) /* 152 */
ICD_ENTRY(Fogf) /* 153 */
ICD_ENTRY(Fogfv) /* 154 */
ICD_ENTRY(Fogi) /* 155 */
ICD_ENTRY(Fogiv) /* 156 */
ICD_ENTRY(FrontFace) /* 157 */
ICD_ENTRY(Hint) /* 158 */
ICD_ENTRY(Lightf) /* 159 */
ICD_ENTRY(Lightfv) /* 160 */
ICD_ENTRY(Lighti) /* 161 */
ICD_ENTRY(Lightiv) /* 162 */
ICD_ENTRY(LightModelf) /* 163 */
ICD_ENTRY(LightModelfv) /* 164 */
ICD_ENTRY(LightModeli) /* 165 */
ICD_ENTRY(LightModeliv) /* 166 */
ICD_ENTRY(LineStipple) /* 167 */
ICD_ENTRY(LineWidth) /* 168 */
ICD_ENTRY(Materialf) /* 169 */
ICD_ENTRY(Materialfv) /* 170 */
ICD_ENTRY(Materiali) /* 171 */
ICD_ENTRY(Materialiv) /* 172 */
ICD_ENTRY(PointSize) /* 173 */
ICD_ENTRY(PolygonMode) /* 174 */
ICD_ENTRY(PolygonStipple) /* 175 */
ICD_ENTRY(Scissor) /* 176 */
ICD_ENTRY(ShadeModel) /* 177 */
ICD_ENTRY(TexParameterf) /* 178 */
ICD_ENTRY(TexParameterfv) /* 179 */
ICD_ENTRY(TexParameteri) /* 180 */
ICD_ENTRY(TexParameteriv) /* 181 */
ICD_ENTRY(TexImage1D) /* 182 */
ICD_ENTRY(TexImage2D) /* 183 */
ICD_ENTRY(TexEnvf) /* 184 */
ICD_ENTRY(TexEnvfv) /* 185 */
ICD_ENTRY(TexEnvi) /* 186 */
ICD_ENTRY(TexEnviv) /* 187 */
ICD_ENTRY(TexGend) /* 188 */
ICD_ENTRY(TexGendv) /* 189 */
ICD_ENTRY(TexGenf) /* 190 */
ICD_ENTRY(TexGenfv) /* 191 */
ICD_ENTRY(TexGeni) /* 192 */
ICD_ENTRY(TexGeniv) /* 193 */
ICD_ENTRY(FeedbackBuffer) /* 194 */
ICD_ENTRY(SelectBuffer) /* 195 */
ICD_ENTRY(RenderMode) /* 196 */
ICD_ENTRY(InitNames) /* 197 */
ICD_ENTRY(LoadName) /* 198 */
ICD_ENTRY(PassThrough) /* 199 */
ICD_ENTRY(PopName) /* 200 */
ICD_ENTRY(PushName) /* 201 */
ICD_ENTRY(DrawBuffer) /* 202 */
ICD_ENTRY(Clear) /* 203 */
ICD_ENTRY(ClearAccum) /* 204 */
ICD_ENTRY(ClearIndex) /* 205 */
ICD_ENTRY(ClearColor) /* 206 */
ICD_ENTRY(ClearStencil) /* 207 */
ICD_ENTRY(ClearDepth) /* 208 */
ICD_ENTRY(StencilMask) /* 209 */
ICD_ENTRY(ColorMask) /* 210 */
ICD_ENTRY(DepthMask) /* 211 */
ICD_ENTRY(IndexMask) /* 212 */
ICD_ENTRY(Accum) /* 213 */
ICD_ENTRY(Disable) /* 214 */
ICD_ENTRY(Enable) /* 215 */
ICD_ENTRY(Finish) /* 216 */
ICD_ENTRY(Flush) /* 217 */
ICD_ENTRY(PopAttrib) /* 218 */
ICD_ENTRY(PushAttrib) /* 219 */
ICD_ENTRY(Map1d) /* 220 */
ICD_ENTRY(Map1f) /* 221 */
ICD_ENTRY(Map2d) /* 222 */
ICD_ENTRY(Map2f) /* 223 */
ICD_ENTRY(MapGrid1d) /* 224 */
ICD_ENTRY(MapGrid1f) /* 225 */
ICD_ENTRY(MapGrid2d) /* 226 */
ICD_ENTRY(MapGrid2f) /* 227 */
ICD_ENTRY(EvalCoord1d) /* 228 */
ICD_ENTRY(EvalCoord1dv) /* 229 */
ICD_ENTRY(EvalCoord1f) /* 230 */
ICD_ENTRY(EvalCoord1fv) /* 231 */
ICD_ENTRY(EvalCoord2d) /* 232 */
ICD_ENTRY(EvalCoord2dv) /* 233 */
ICD_ENTRY(EvalCoord2f) /* 234 */
ICD_ENTRY(EvalCoord2fv) /* 235 */
ICD_ENTRY(EvalMesh1) /* 236 */
ICD_ENTRY(EvalPoint1) /* 237 */
ICD_ENTRY(EvalMesh2) /* 238 */
ICD_ENTRY(EvalPoint2) /* 239 */
ICD_ENTRY(AlphaFunc) /* 240 */
ICD_ENTRY(BlendFunc) /* 241 */
ICD_ENTRY(LogicOp) /* 242 */
ICD_ENTRY(StencilFunc) /* 243 */
ICD_ENTRY(StencilOp) /* 244 */
ICD_ENTRY(DepthFunc) /* 245 */
ICD_ENTRY(PixelZoom) /* 246 */
ICD_ENTRY(PixelTransferf) /* 247 */
ICD_ENTRY(PixelTransferi) /* 248 */
ICD_ENTRY(PixelStoref) /* 249 */
ICD_ENTRY(PixelStorei) /* 250 */
ICD_ENTRY(PixelMapfv) /* 251 */
ICD_ENTRY(PixelMapuiv) /* 252 */
ICD_ENTRY(PixelMapusv) /* 253 */
ICD_ENTRY(ReadBuffer) /* 254 */
ICD_ENTRY(CopyPixels) /* 255 */
ICD_ENTRY(ReadPixels) /* 256 */
ICD_ENTRY(DrawPixels) /* 257 */
ICD_ENTRY(GetBooleanv) /* 258 */
ICD_ENTRY(GetClipPlane) /* 259 */
ICD_ENTRY(GetDoublev) /* 260 */
ICD_ENTRY(GetError) /* 261 */
ICD_ENTRY(GetFloatv) /* 262 */
ICD_ENTRY(GetIntegerv) /* 263 */
ICD_ENTRY(GetLightfv) /* 264 */
ICD_ENTRY(GetLightiv) /* 265 */
ICD_ENTRY(GetMapdv) /* 266 */
ICD_ENTRY(GetMapfv) /* 267 */
ICD_ENTRY(GetMapiv) /* 268 */
ICD_ENTRY(GetMaterialfv) /* 269 */
ICD_ENTRY(GetMaterialiv) /* 270 */
ICD_ENTRY(GetPixelMapfv) /* 271 */
ICD_ENTRY(GetPixelMapuiv) /* 272 */
ICD_ENTRY(GetPixelMapusv) /* 273 */
ICD_ENTRY(GetPolygonStipple) /* 274 */
ICD_ENTRY(GetString) /* 275 */
ICD_ENTRY(GetTexEnvfv) /* 276 */
ICD_ENTRY(GetTexEnviv) /* 277 */
ICD_ENTRY(GetTexGendv) /* 278 */
ICD_ENTRY(GetTexGenfv) /* 279 */
ICD_ENTRY(GetTexGeniv) /* 280 */
ICD_ENTRY(GetTexImage) /* 281 */
ICD_ENTRY(GetTexParameterfv) /* 282 */
ICD_ENTRY(GetTexParameteriv) /* 283 */
ICD_ENTRY(GetTexLevelParameterfv) /* 284 */
ICD_ENTRY(GetTexLevelParameteriv) /* 285 */
ICD_ENTRY(IsEnabled) /* 286 */
ICD_ENTRY(IsList) /* 287 */
ICD_ENTRY(DepthRange) /* 288 */
ICD_ENTRY(Frustum) /* 289 */
ICD_ENTRY(LoadIdentity) /* 290 */
ICD_ENTRY(LoadMatrixf) /* 291 */
ICD_ENTRY(LoadMatrixd) /* 292 */
ICD_ENTRY(MatrixMode) /* 293 */
ICD_ENTRY(MultMatrixf) /* 294 */
ICD_ENTRY(MultMatrixd) /* 295 */
ICD_ENTRY(Ortho) /* 296 */
ICD_ENTRY(PopMatrix) /* 297 */
ICD_ENTRY(PushMatrix) /* 298 */
ICD_ENTRY(Rotated) /* 299 */
ICD_ENTRY(Rotatef) /* 300 */
ICD_ENTRY(Scaled) /* 301 */
ICD_ENTRY(Scalef) /* 302 */
ICD_ENTRY(Translated) /* 303 */
ICD_ENTRY(Translatef) /* 304 */
ICD_ENTRY(Viewport) /* 305 */
ICD_ENTRY(ArrayElement) /* 306 */
ICD_ENTRY(BindTexture) /* 307 */
ICD_ENTRY(ColorPointer) /* 308 */
ICD_ENTRY(DisableClientState) /* 309 */
ICD_ENTRY(DrawArrays) /* 310 */
ICD_ENTRY(DrawElements) /* 311 */
ICD_ENTRY(EdgeFlagPointer) /* 312 */
ICD_ENTRY(EnableClientState) /* 313 */
ICD_ENTRY(IndexPointer) /* 314 */
ICD_ENTRY(Indexub) /* 315 */
ICD_ENTRY(Indexubv) /* 316 */
ICD_ENTRY(InterleavedArrays) /* 317 */
ICD_ENTRY(NormalPointer) /* 318 */
ICD_ENTRY(PolygonOffset) /* 319 */
ICD_ENTRY(TexCoordPointer) /* 320 */
ICD_ENTRY(VertexPointer) /* 321 */
ICD_ENTRY(AreTexturesResident) /* 322 */
ICD_ENTRY(CopyTexImage1D) /* 323 */
ICD_ENTRY(CopyTexImage2D) /* 324 */
ICD_ENTRY(CopyTexSubImage1D) /* 325 */
ICD_ENTRY(CopyTexSubImage2D) /* 326 */
ICD_ENTRY(DeleteTextures) /* 327 */
ICD_ENTRY(GenTextures) /* 328 */
ICD_ENTRY(GetPointerv) /* 329 */
ICD_ENTRY(IsTexture) /* 330 */
ICD_ENTRY(PrioritizeTextures) /* 331 */
ICD_ENTRY(TexSubImage1D) /* 332 */
ICD_ENTRY(TexSubImage2D) /* 333 */
ICD_ENTRY(PopClientAttrib) /* 334 */
ICD_ENTRY(PushClientAttrib) /* 335 */

View file

@ -1,102 +0,0 @@
DESCRIPTION 'Mesa (OpenGL driver) for Win32'
VERSION 6.1
EXPORTS
;
; ICD API
DrvCopyContext
DrvCreateContext
DrvCreateLayerContext
DrvDeleteContext
DrvDescribeLayerPlane
DrvDescribePixelFormat
DrvGetLayerPaletteEntries
DrvGetProcAddress
DrvReleaseContext
DrvRealizeLayerPalette
DrvSetContext
DrvSetLayerPaletteEntries
DrvSetPixelFormat
DrvShareLists
DrvSwapBuffers
DrvSwapLayerBuffers
DrvValidateVersion
;
; Mesa internals - mostly for OSMESA
_vbo_CreateContext
_vbo_DestroyContext
_vbo_InvalidateState
_glapi_get_context
_glapi_get_proc_address
_mesa_buffer_data
_mesa_buffer_map
_mesa_buffer_subdata
_mesa_choose_tex_format
_mesa_compressed_texture_size
_mesa_create_framebuffer
_mesa_create_visual
_mesa_delete_buffer_object
_mesa_delete_texture_object
_mesa_destroy_framebuffer
_mesa_destroy_visual
_mesa_enable_1_3_extensions
_mesa_enable_1_4_extensions
_mesa_enable_1_5_extensions
_mesa_enable_sw_extensions
_mesa_error
_mesa_free_context_data
_mesa_get_current_context
_mesa_init_default_imports
_mesa_init_driver_functions
_mesa_initialize_context
_mesa_make_current
_mesa_new_buffer_object
_mesa_new_texture_object
_mesa_problem
_mesa_ResizeBuffersMESA
_mesa_store_compressed_teximage1d
_mesa_store_compressed_teximage2d
_mesa_store_compressed_teximage3d
_mesa_store_compressed_texsubimage1d
_mesa_store_compressed_texsubimage2d
_mesa_store_compressed_texsubimage3d
_mesa_store_teximage1d
_mesa_store_teximage2d
_mesa_store_teximage3d
_mesa_store_texsubimage1d
_mesa_store_texsubimage2d
_mesa_store_texsubimage3d
_mesa_test_proxy_teximage
_mesa_Viewport
_mesa_meta_CopyColorSubTable
_mesa_meta_CopyColorTable
_mesa_meta_CopyConvolutionFilter1D
_mesa_meta_CopyConvolutionFilter2D
_mesa_meta_CopyTexImage1D
_mesa_meta_CopyTexImage2D
_mesa_meta_CopyTexSubImage1D
_mesa_meta_CopyTexSubImage2D
_mesa_meta_CopyTexSubImage3D
_swrast_Accum
_swrast_Bitmap
_swrast_CopyPixels
_swrast_DrawBuffer
_swrast_DrawPixels
_swrast_GetDeviceDriverReference
_swrast_Clear
_swrast_choose_line
_swrast_choose_triangle
_swrast_CreateContext
_swrast_DestroyContext
_swrast_InvalidateState
_swrast_ReadPixels
_swsetup_Wakeup
_swsetup_CreateContext
_swsetup_DestroyContext
_swsetup_InvalidateState
_tnl_CreateContext
_tnl_DestroyContext
_tnl_InvalidateState
_tnl_MakeCurrent
_tnl_run_pipeline