Commit 01968613 authored by Raphael Junqueira's avatar Raphael Junqueira Committed by Alexandre Julliard

Add the wined3d dll for beginning a cleaner d3d architecture that will

contain the shared openGL code needed for all wine direct3d implementations.
parent b0c2e54a
...@@ -1459,6 +1459,7 @@ dlls/commdlg/Makefile ...@@ -1459,6 +1459,7 @@ dlls/commdlg/Makefile
dlls/crtdll/Makefile dlls/crtdll/Makefile
dlls/crypt32/Makefile dlls/crypt32/Makefile
dlls/ctl3d/Makefile dlls/ctl3d/Makefile
dlls/wined3d/Makefile
dlls/d3d8/Makefile dlls/d3d8/Makefile
dlls/d3d9/Makefile dlls/d3d9/Makefile
dlls/d3dim/Makefile dlls/d3dim/Makefile
......
...@@ -8,7 +8,7 @@ VPATH = @srcdir@ ...@@ -8,7 +8,7 @@ VPATH = @srcdir@
# special configure-dependent targets # special configure-dependent targets
GLU32FILES = glu32 GLU32FILES = glu32
OPENGLFILES = d3d8 d3d9 d3dx8 opengl32 OPENGLFILES = d3d8 d3d9 d3dx8 opengl32 wined3d
XFILES = ddraw x11drv XFILES = ddraw x11drv
EXTRADIRS = @GLU32FILES@ @OPENGLFILES@ @XFILES@ EXTRADIRS = @GLU32FILES@ @OPENGLFILES@ @XFILES@
...@@ -139,6 +139,7 @@ SUBDIRS = \ ...@@ -139,6 +139,7 @@ SUBDIRS = \
ddraw \ ddraw \
glu32 \ glu32 \
opengl32 \ opengl32 \
wined3d \
x11drv x11drv
BUILDSUBDIRS = $(BASEDIRS) $(EXTRADIRS) BUILDSUBDIRS = $(BASEDIRS) $(EXTRADIRS)
...@@ -645,6 +646,9 @@ winearts.drv$(DLLEXT): winmm/winearts/winearts.drv$(DLLEXT) ...@@ -645,6 +646,9 @@ winearts.drv$(DLLEXT): winmm/winearts/winearts.drv$(DLLEXT)
wineaudioio.drv$(DLLEXT): winmm/wineaudioio/wineaudioio.drv$(DLLEXT) wineaudioio.drv$(DLLEXT): winmm/wineaudioio/wineaudioio.drv$(DLLEXT)
$(RM) $@ && $(LN_S) winmm/wineaudioio/wineaudioio.drv$(DLLEXT) $@ $(RM) $@ && $(LN_S) winmm/wineaudioio/wineaudioio.drv$(DLLEXT) $@
wined3d.dll$(DLLEXT): wined3d/wined3d.dll$(DLLEXT)
$(RM) $@ && $(LN_S) wined3d/wined3d.dll$(DLLEXT) $@
winedos.dll$(DLLEXT) wprocs.dll$(DLLEXT): winedos/winedos.dll$(DLLEXT) winedos.dll$(DLLEXT) wprocs.dll$(DLLEXT): winedos/winedos.dll$(DLLEXT)
$(RM) $@ && $(LN_S) winedos/winedos.dll$(DLLEXT) $@ $(RM) $@ && $(LN_S) winedos/winedos.dll$(DLLEXT) $@
...@@ -790,6 +794,7 @@ IMPORT_LIBS = \ ...@@ -790,6 +794,7 @@ IMPORT_LIBS = \
libuxtheme \ libuxtheme \
libversion \ libversion \
libw32skrnl \ libw32skrnl \
libwined3d \
libwinedos \ libwinedos \
libwineps \ libwineps \
libwininet \ libwininet \
...@@ -1254,6 +1259,11 @@ libw32skrnl.def: win32s/w32skrnl.spec.def ...@@ -1254,6 +1259,11 @@ libw32skrnl.def: win32s/w32skrnl.spec.def
libw32skrnl.a: win32s/w32skrnl.spec.def libw32skrnl.a: win32s/w32skrnl.spec.def
$(DLLTOOL) -k -l $@ -d win32s/w32skrnl.spec.def $(DLLTOOL) -k -l $@ -d win32s/w32skrnl.spec.def
libwined3d.def: wined3d/wined3d.spec.def
$(RM) $@ && $(LN_S) wined3d/wined3d.spec.def $@
libwined3d.a: wined3d/wined3d.spec.def
$(DLLTOOL) -k -l $@ -d wined3d/wined3d.spec.def
libwinedos.def: winedos/winedos.spec.def libwinedos.def: winedos/winedos.spec.def
$(RM) $@ && $(LN_S) winedos/winedos.spec.def $@ $(RM) $@ && $(LN_S) winedos/winedos.spec.def $@
libwinedos.a: winedos/winedos.spec.def libwinedos.a: winedos/winedos.spec.def
...@@ -1409,6 +1419,7 @@ user/user32.spec.def: $(WINEBUILD) ...@@ -1409,6 +1419,7 @@ user/user32.spec.def: $(WINEBUILD)
uxtheme/uxtheme.spec.def: $(WINEBUILD) uxtheme/uxtheme.spec.def: $(WINEBUILD)
version/version.spec.def: $(WINEBUILD) version/version.spec.def: $(WINEBUILD)
win32s/w32skrnl.spec.def: $(WINEBUILD) win32s/w32skrnl.spec.def: $(WINEBUILD)
wined3d/wined3d.spec.def: $(WINEBUILD)
winedos/winedos.spec.def: $(WINEBUILD) winedos/winedos.spec.def: $(WINEBUILD)
wineps/wineps.spec.def: $(WINEBUILD) wineps/wineps.spec.def: $(WINEBUILD)
wininet/wininet.spec.def: $(WINEBUILD) wininet/wininet.spec.def: $(WINEBUILD)
...@@ -1534,6 +1545,7 @@ win32s/w32skrnl.dll$(DLLEXT): win32s ...@@ -1534,6 +1545,7 @@ win32s/w32skrnl.dll$(DLLEXT): win32s
winmm/winealsa/winealsa.drv$(DLLEXT): winmm/winealsa winmm/winealsa/winealsa.drv$(DLLEXT): winmm/winealsa
winmm/winearts/winearts.drv$(DLLEXT): winmm/winearts winmm/winearts/winearts.drv$(DLLEXT): winmm/winearts
winmm/wineaudioio/wineaudioio.drv$(DLLEXT): winmm/wineaudioio winmm/wineaudioio/wineaudioio.drv$(DLLEXT): winmm/wineaudioio
wined3d/wined3d.dll$(DLLEXT): wined3d
winedos/winedos.dll$(DLLEXT): winedos winedos/winedos.dll$(DLLEXT): winedos
winmm/winejack/winejack.drv$(DLLEXT): winmm/winejack winmm/winejack/winejack.drv$(DLLEXT): winmm/winejack
msacm/winemp3/winemp3.acm$(DLLEXT): msacm/winemp3 msacm/winemp3/winemp3.acm$(DLLEXT): msacm/winemp3
......
...@@ -37,6 +37,7 @@ my %special_dlls = ...@@ -37,6 +37,7 @@ my %special_dlls =
"d3d8" => "OPENGLFILES", "d3d8" => "OPENGLFILES",
"d3d9" => "OPENGLFILES", "d3d9" => "OPENGLFILES",
"d3dx8" => "OPENGLFILES", "d3dx8" => "OPENGLFILES",
"wined3d" => "OPENGLFILES",
"x11drv" => "XFILES" "x11drv" => "XFILES"
); );
......
Makefile
wined3d.dll.dbg.c
wined3d.spec.c
wined3d.spec.def
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = wined3d.dll
IMPORTS = user32 gdi32 kernel32
EXTRAINCL = @X_CFLAGS@
EXTRALIBS = $(LIBUUID) @X_LIBS@ @X_PRE_LIBS@ @XLIB@ @X_EXTRA_LIBS@ @OPENGL_LIBS@
C_SRCS = \
vertexshader.c \
wined3d_main.c
@MAKE_DLL_RULES@
### Dependencies:
@ stdcall WineDirect3DCreate(long)
/*
* Direct3D wine internal interface main
*
* Copyright 2002-2003 The wine-d3d team
* Copyright 2002-2003 Raphael Junqueira
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include "wined3d_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(wine_d3d);
IDirect3DImpl* WINAPI WineDirect3DCreate(UINT SDKVersion) {
FIXME("SDKVersion = %x, TODO\n", SDKVersion);
return NULL;
}
/* At process attach */
BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
{
TRACE("wined3d DLLMain Reason=%ld\n", fdwReason);
if (fdwReason == DLL_PROCESS_ATTACH) {
DisableThreadLibraryCalls(hInstDLL);
}
return TRUE;
}
/*
* Direct3D wine internal private include file
*
* Copyright 2002-2003 The wine-d3d team
* Copyright 2002-2003 Raphael Junqueira
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINE_WINED3D_PRIVATE_H
#define __WINE_WINED3D_PRIVATE_H
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "wine/debug.h"
#include "d3d8.h"
#include "d3d8types.h"
#include "wine/wined3d_interface.h"
/*****************************************************************************
* IDirect3DVertexShaderDeclaration implementation structure
*/
struct IDirect3DVertexShaderDeclarationImpl {
/* The device */
/*IDirect3DDeviceImpl* device;*/
/** precomputed fvf if simple declaration */
DWORD fvf[MAX_STREAMS];
DWORD allFVF;
/** dx8 compatible Declaration fields */
DWORD* pDeclaration8;
DWORD declaration8Length;
};
/*****************************************************************************
* IDirect3DVertexShader implementation structure
*/
struct IDirect3DVertexShaderImpl {
/* The device */
/*IDirect3DDeviceImpl* device;*/
DWORD* function;
UINT functionLength;
DWORD usage;
DWORD version;
/* run time datas */
VSHADERDATA* data;
VSHADERINPUTDATA input;
VSHADEROUTPUTDATA output;
};
/*****************************************************************************
* IDirect3DPixelShader implementation structure
*/
struct IDirect3DPixelShaderImpl {
/* The device */
/*IDirect3DDeviceImpl* device;*/
DWORD* function;
UINT functionLength;
DWORD version;
/* run time datas */
PSHADERDATA* data;
PSHADERINPUTDATA input;
PSHADEROUTPUTDATA output;
};
#endif
/*
* Direct3D wine OpenGL include file
*
* Copyright 2002-2003 The wine-d3d team
* Copyright 2002-2003 Jason Edmeades
* Raphael Junqueira
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINE_WINED3D_GL_H
#define __WINE_WINED3D_GL_H
#ifndef __WINE_CONFIG_H
# error You must include config.h to use this header
#endif
#ifdef HAVE_OPENGL
#undef APIENTRY
#undef CALLBACK
#undef WINAPI
#define XMD_H /* This is to prevent the Xmd.h inclusion bug :-/ */
#include <GL/gl.h>
#include <GL/glx.h>
#ifdef HAVE_GL_GLEXT_H
# include <GL/glext.h>
#endif
#undef XMD_H
#undef APIENTRY
#undef CALLBACK
#undef WINAPI
/**
* file where we merge all d3d-opengl specific stuff
*/
/* Redefines the constants */
#define CALLBACK __stdcall
#define WINAPI __stdcall
#define APIENTRY WINAPI
#endif /* HAVE_OPENGL */
#endif /* __WINE_WINED3D_GL */
/*
* Direct3D wine internal public interface file
*
* Copyright 2002-2003 The wine-d3d team
* Copyright 2002-2003 Raphael Junqueira
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINE_WINED3D_INTERFACE_H
#define __WINE_WINED3D_INTERFACE_H
#if !defined( __WINE_CONFIG_H )
# error You must include config.h to use this header
#endif
#if !defined( __WINE_D3D8_H ) && !defined( __WINE_D3D9_H )
# error You must include d3d8.h or d3d9.h header to use this header
#endif
/*****************************************************************
* THIS FILE MUST NOT CONTAIN X11 or MESA DEFINES
* PLEASE USE wine/wined3d_gl.h INSTEAD
*/
/*****************************************************************
* Some defines
*/
/* Device caps */
#define MAX_PALETTES 256
#define MAX_STREAMS 16
#define MAX_CLIPPLANES D3DMAXUSERCLIPPLANES
#define MAX_LEVELS 256
/* Other useful values */
#define HIGHEST_RENDER_STATE 174
#define HIGHEST_TEXTURE_STATE 29
#define HIGHEST_TRANSFORMSTATE 512
#define D3DSBT_RECORDED 0xfffffffe
#define D3D_VSHADER_MAX_CONSTANTS 96
#define D3D_PSHADER_MAX_CONSTANTS 32
/*****************************************************************
* Some includes
*/
#include "wine/wined3d_gl.h"
#include "wine/wined3d_types.h"
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
/*****************************************************************
* Some defines
*/
typedef struct IDirect3DImpl IDirect3DImpl;
typedef struct IDirect3DBaseTextureImpl IDirect3DBaseTextureImpl;
typedef struct IDirect3DVolumeTextureImpl IDirect3DVolumeTextureImpl;
typedef struct IDirect3DDeviceImpl IDirect3DDeviceImpl;
typedef struct IDirect3DTextureImpl IDirect3DTextureImpl;
typedef struct IDirect3DCubeTextureImpl IDirect3DCubeTextureImpl;
typedef struct IDirect3DIndexBufferImpl IDirect3DIndexBufferImpl;
typedef struct IDirect3DSurfaceImpl IDirect3DSurfaceImpl;
typedef struct IDirect3DSwapChainImpl IDirect3DSwapChainImpl;
typedef struct IDirect3DResourceImpl IDirect3DResourceImpl;
typedef struct IDirect3DVolumeImpl IDirect3DVolumeImpl;
typedef struct IDirect3DVertexBufferImpl IDirect3DVertexBufferImpl;
typedef struct IDirect3DStateBlockImpl IDirect3DStateBlockImpl;
typedef struct IDirect3DVertexShaderImpl IDirect3DVertexShaderImpl;
typedef struct IDirect3DPixelShaderImpl IDirect3DPixelShaderImpl;
typedef struct IDirect3DVertexShaderDeclarationImpl IDirect3DVertexShaderDeclarationImpl;
/*************************************************************
* d3dcore interfaces defs
*/
/** Vertex Shader API */
extern HRESULT WINAPI IDirect3DVertexShaderImpl_ParseProgram(IDirect3DVertexShaderImpl* This, CONST DWORD* pFunction);
extern HRESULT WINAPI IDirect3DVertexShaderImpl_GetFunction(IDirect3DVertexShaderImpl* This, VOID* pData, UINT* pSizeOfData);
extern HRESULT WINAPI IDirect3DVertexShaderImpl_SetConstantB(IDirect3DVertexShaderImpl* This, UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount);
extern HRESULT WINAPI IDirect3DVertexShaderImpl_SetConstantI(IDirect3DVertexShaderImpl* This, UINT StartRegister, CONST INT* pConstantData, UINT Vector4iCount);
extern HRESULT WINAPI IDirect3DVertexShaderImpl_SetConstantF(IDirect3DVertexShaderImpl* This, UINT StartRegister, CONST FLOAT* pConstantData, UINT Vector4fCount);
extern HRESULT WINAPI IDirect3DVertexShaderImpl_GetConstantB(IDirect3DVertexShaderImpl* This, UINT StartRegister, BOOL* pConstantData, UINT BoolCount);
extern HRESULT WINAPI IDirect3DVertexShaderImpl_GetConstantI(IDirect3DVertexShaderImpl* This, UINT StartRegister, INT* pConstantData, UINT Vector4iCount);
extern HRESULT WINAPI IDirect3DVertexShaderImpl_GetConstantF(IDirect3DVertexShaderImpl* This, UINT StartRegister, FLOAT* pConstantData, UINT Vector4fCount);
/* internal Interfaces */
extern DWORD WINAPI IDirect3DVertexShaderImpl_GetVersion(IDirect3DVertexShaderImpl* This);
extern HRESULT WINAPI IDirect3DVertexShaderImpl_ExecuteSW(IDirect3DVertexShaderImpl* This, VSHADERINPUTDATA* input, VSHADEROUTPUTDATA* output);
#ifdef __cplusplus
extern "C" {
#endif /* defined(__cplusplus) */
/* Define the main entrypoint as well */
IDirect3DImpl* WINAPI WineDirect3DCreate(UINT SDKVersion);
#ifdef __cplusplus
} /* extern "C" */
#endif /* defined(__cplusplus) */
#endif
/*
* Direct3D wine types include file
*
* Copyright 2002-2003 The wine-d3d team
* Copyright 2002-2003 Jason Edmeades
* Raphael Junqueira
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINE_WINED3D_TYPES_H
#define __WINE_WINED3D_TYPES_H
typedef struct _D3DVECTOR_3 {
float x;
float y;
float z;
} D3DVECTOR_3;
typedef struct _D3DVECTOR_4 {
float x;
float y;
float z;
float w;
} D3DVECTOR_4;
typedef struct D3DSHADERVECTOR {
float x;
float y;
float z;
float w;
} D3DSHADERVECTOR;
typedef struct D3DSHADERSCALAR {
float x;
} D3DSHADERSCALAR;
typedef D3DSHADERVECTOR VSHADERCONSTANTS8[D3D_VSHADER_MAX_CONSTANTS];
typedef struct VSHADERDATA {
/** Run Time Shader Function Constants */
/*D3DXBUFFER* constants;*/
VSHADERCONSTANTS8 C;
/** Shader Code as char ... */
CONST DWORD* code;
UINT codeLength;
} VSHADERDATA;
/** temporary here waiting for buffer code */
typedef struct VSHADERINPUTDATA {
D3DSHADERVECTOR V[17];
} VSHADERINPUTDATA;
/** temporary here waiting for buffer code */
typedef struct VSHADEROUTPUTDATA {
D3DSHADERVECTOR oPos;
D3DSHADERVECTOR oD[2];
D3DSHADERVECTOR oT[8];
D3DSHADERVECTOR oFog;
D3DSHADERVECTOR oPts;
} VSHADEROUTPUTDATA;
typedef D3DSHADERVECTOR PSHADERCONSTANTS8[D3D_PSHADER_MAX_CONSTANTS];
typedef struct PSHADERDATA {
/** Run Time Shader Function Constants */
/*D3DXBUFFER* constants;*/
PSHADERCONSTANTS8 C;
/** Shader Code as char ... */
CONST DWORD* code;
UINT codeLength;
} PSHADERDATA;
/** temporary here waiting for buffer code */
typedef struct PSHADERINPUTDATA {
D3DSHADERVECTOR V[2];
D3DSHADERVECTOR T[8];
D3DSHADERVECTOR S[16];
/*D3DSHADERVECTOR R[12];*/
} PSHADERINPUTDATA;
/** temporary here waiting for buffer code */
typedef struct PSHADEROUTPUTDATA {
D3DSHADERVECTOR oC[4];
D3DSHADERVECTOR oDepth;
} PSHADEROUTPUTDATA;
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment