Commit 5ff00774 authored by Lionel Ulmer's avatar Lionel Ulmer Committed by Alexandre Julliard

- beginning of implementation of Direct3D2 (DX 5.0) and associated classes

- some basic code for Direct3D and Direct3DExecuteBuffer (DX 3.0) - added stretching to Blt function
parent 2cc30a6f
......@@ -106,6 +106,8 @@ then
AC_CHECK_LIB(Xxf86dga,XF86DGAQueryExtension,AC_DEFINE(HAVE_LIBXXF86DGA) X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga",,$X_LIBS -lXext -lX11)
dnl Check for XFree86 VMODE extension
AC_CHECK_LIB(Xxf86vm,XF86VidModeQueryExtension,AC_DEFINE(HAVE_LIBXXF86VM) X_PRE_LIBS="$X_PRE_LIBS -lXxf86vm",,$X_LIBS -lXext -lX11)
dnl Check for the presence of Mesa
AC_CHECK_LIB(MesaGL,OSMesaCreateContext,AC_DEFINE(HAVE_MESAGL) X_PRE_LIBS="$X_PRE_LIBS -lMesaGL",,$X_LIBS -lXext -lX11 -lm)
else
XLIB=""
X_CFLAGS=""
......
Introduction
------------
This file contains information about Wine's implementation of
Direct3D.
The current version requires :
* Mesa (tested with version 3.1 beta)
* a display in 16bpp
To minimize the impact on DirectDraw (i.e. to reuse most of the code
already done for DirectDraw), I decided not to start with an
implementation based on GLX, but on OSMesa. This way, all the OpenGL
rendering are done in a 'private' memory buffer, buffer that will
copied back to the DirectDraw Surface each time a 3D scene
finishes. It is not optimal for execution speed (on each frame, the
OpenGL buffer is converted from 32 to 16 bpp and copied onto the
screen) but is for development (I had almost nothing to change in
DirectDraw). Moreover, 99 % of the code in the Direct3D implementation
is 'device independant' (i.e. GLX / OSMesa / whatever), so that
changing to GLX will have only a minor impact on Direct3D's code.
Code structure
--------------
TODO (well, once the code will be put in the dll/ddraw directory)
Status
------
I tested this code with two programs (all using Direct3D 5.0) :
* BOIDS.EXE that comes with the 5.2 DirectX SDK : works great. Only
thing missing is the texturing and transparency on the spinning
gobes. Lighting seems to be a bit different than the Real One.
* Tomb Raider II : works quite well (without texturing).
TODO
----
* finish working on Execute Buffers (i.e. Direct3D 3.0)
* texture mapping / blending effects
* real GLX implementation (will need a complete rewrite of DirectDraw
also) to have 3DFx support
* restructuration of all the DDRAW.DLL (put that in the dll
directory, better separation of 'drivers, ...)
* start looking into DirectX 6.0
* inquire on Mesa / XFree86 mailing lists about direct access to
display hardware (for games such as Tomb Raider II that displays
vertices that are already in screen coordinates)
* look into thread safeness...
--
Lionel Ulmer - ulmer@directprovider.net
Last updated : Sun Jan 03 1999
This file contains information on the current implementation of the DirectDraw
API.
API. Information specific to Direct3D is in the direct3D file.
The DirectDraw API is being used in a lot of current computergames. Its API
layer is represented by the functions in the Win32 DLL ddraw.dll and the
......
......@@ -8,6 +8,13 @@ MODULE = graphics
C_SRCS = \
bitblt.c \
cache.c \
d3dcommon.c \
d3ddevices.c \
d3dexecutebuffer.c \
d3dlight.c \
d3dmaterial.c \
d3dtexture.c \
d3dviewport.c \
ddraw.c \
dispdib.c \
driver.c \
......
/* Direct3D private include file
(c) 1998 Lionel ULMER
This files contains all the structure that are not exported
through d3d.h and all common macros. */
#ifndef _WINE_D3D_PRIVATE_H
#define _WINE_D3D_PRIVATE_H
#ifdef HAVE_MESAGL
#include "d3d.h"
#include "wine_gl.h"
/* Matrix copy WITH transposition */
#define conv_mat2(mat,gl_mat) \
{ \
TRACE(ddraw, "%f %f %f %f\n", (mat)->_11, (mat)->_12, (mat)->_13, (mat)->_14); \
TRACE(ddraw, "%f %f %f %f\n", (mat)->_21, (mat)->_22, (mat)->_23, (mat)->_24); \
TRACE(ddraw, "%f %f %f %f\n", (mat)->_31, (mat)->_32, (mat)->_33, (mat)->_34); \
TRACE(ddraw, "%f %f %f %f\n", (mat)->_41, (mat)->_42, (mat)->_43, (mat)->_44); \
(gl_mat)[ 0] = (mat)->_11; \
(gl_mat)[ 1] = (mat)->_21; \
(gl_mat)[ 2] = (mat)->_31; \
(gl_mat)[ 3] = (mat)->_41; \
(gl_mat)[ 4] = (mat)->_12; \
(gl_mat)[ 5] = (mat)->_22; \
(gl_mat)[ 6] = (mat)->_32; \
(gl_mat)[ 7] = (mat)->_42; \
(gl_mat)[ 8] = (mat)->_13; \
(gl_mat)[ 9] = (mat)->_23; \
(gl_mat)[10] = (mat)->_33; \
(gl_mat)[11] = (mat)->_43; \
(gl_mat)[12] = (mat)->_14; \
(gl_mat)[13] = (mat)->_24; \
(gl_mat)[14] = (mat)->_34; \
(gl_mat)[15] = (mat)->_44; \
};
/* Matrix copy WITHOUT transposition */
#define conv_mat(mat,gl_mat) \
{ \
TRACE(ddraw, "%f %f %f %f\n", (mat)->_11, (mat)->_12, (mat)->_13, (mat)->_14); \
TRACE(ddraw, "%f %f %f %f\n", (mat)->_21, (mat)->_22, (mat)->_23, (mat)->_24); \
TRACE(ddraw, "%f %f %f %f\n", (mat)->_31, (mat)->_32, (mat)->_33, (mat)->_34); \
TRACE(ddraw, "%f %f %f %f\n", (mat)->_41, (mat)->_42, (mat)->_43, (mat)->_44); \
memcpy(gl_mat, (mat), 16 * sizeof(float)); \
};
#define dump_mat(mat) \
TRACE(ddraw, "%f %f %f %f\n", (mat)->_11, (mat)->_12, (mat)->_13, (mat)->_14); \
TRACE(ddraw, "%f %f %f %f\n", (mat)->_21, (mat)->_22, (mat)->_23, (mat)->_24); \
TRACE(ddraw, "%f %f %f %f\n", (mat)->_31, (mat)->_32, (mat)->_33, (mat)->_34); \
TRACE(ddraw, "%f %f %f %f\n", (mat)->_41, (mat)->_42, (mat)->_43, (mat)->_44);
typedef struct OpenGL_IDirect3DDevice2 {
IDirect3DDevice2 common;
/* These are the OpenGL-specific variables */
OSMesaContext ctx;
unsigned char *buffer;
float world_mat[16];
float view_mat[16];
float proj_mat[16];
} OpenGL_IDirect3DDevice2;
typedef struct OpenGL_IDirect3DDevice {
IDirect3DDevice common;
/* These are the OpenGL-specific variables */
OSMesaContext ctx;
unsigned char *buffer;
D3DMATRIX *world_mat;
D3DMATRIX *view_mat;
D3DMATRIX *proj_mat;
} OpenGL_IDirect3DDevice;
#define _dump_colorvalue(s,v) \
TRACE(ddraw, " " s " : %f %f %f %f\n", \
(v).r.r, (v).g.g, (v).b.b, (v).a.a);
#endif /* HAVE_MESAGL */
/* Common functions defined in d3dcommon.c */
void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
DWORD dwRenderState) ;
/* All non-static functions 'exported' by various sub-objects */
extern LPDIRECT3DTEXTURE2 d3dtexture2_create(LPDIRECTDRAWSURFACE3 surf) ;
extern LPDIRECT3DTEXTURE d3dtexture_create(LPDIRECTDRAWSURFACE3 surf) ;
extern LPDIRECT3DLIGHT d3dlight_create_dx3(LPDIRECT3D d3d) ;
extern LPDIRECT3DLIGHT d3dlight_create(LPDIRECT3D2 d3d) ;
extern LPDIRECT3DEXECUTEBUFFER d3dexecutebuffer_create(LPDIRECT3DDEVICE d3ddev, LPD3DEXECUTEBUFFERDESC lpDesc) ;
extern LPDIRECT3DMATERIAL d3dmaterial_create(LPDIRECT3D d3d) ;
extern LPDIRECT3DMATERIAL2 d3dmaterial2_create(LPDIRECT3D2 d3d) ;
extern LPDIRECT3DVIEWPORT d3dviewport_create(LPDIRECT3D d3d) ;
extern LPDIRECT3DVIEWPORT2 d3dviewport2_create(LPDIRECT3D2 d3d) ;
extern int is_OpenGL_dx3(REFCLSID rguid, LPDIRECTDRAWSURFACE surface, LPDIRECT3DDEVICE *device) ;
extern int d3d_OpenGL_dx3(LPD3DENUMDEVICESCALLBACK cb, LPVOID context) ;
extern int d3d_OpenGL(LPD3DENUMDEVICESCALLBACK cb, LPVOID context) ;
extern int is_OpenGL(REFCLSID rguid, LPDIRECTDRAWSURFACE surface, LPDIRECT3DDEVICE2 *device, LPDIRECT3D2 d3d) ;
#endif /* _WINE_D3D_PRIVATE_H */
/* Direct3D Common functions
(c) 1998 Lionel ULMER
This file contains all common miscellaneous code that spans
different 'objects' */
#include "config.h"
#include "windows.h"
#include "wintypes.h"
#include "interfaces.h"
#include "ddraw.h"
#include "d3d.h"
#include "debug.h"
#include "d3d_private.h"
#ifdef HAVE_MESAGL
static void _dump_renderstate(D3DRENDERSTATETYPE type,
DWORD value) {
char *states[] = {
NULL,
"D3DRENDERSTATE_TEXTUREHANDLE",
"D3DRENDERSTATE_ANTIALIAS",
"D3DRENDERSTATE_TEXTUREADDRESS",
"D3DRENDERSTATE_TEXTUREPERSPECTIVE",
"D3DRENDERSTATE_WRAPU",
"D3DRENDERSTATE_WRAPV",
"D3DRENDERSTATE_ZENABLE",
"D3DRENDERSTATE_FILLMODE",
"D3DRENDERSTATE_SHADEMODE",
"D3DRENDERSTATE_LINEPATTERN",
"D3DRENDERSTATE_MONOENABLE",
"D3DRENDERSTATE_ROP2",
"D3DRENDERSTATE_PLANEMASK",
"D3DRENDERSTATE_ZWRITEENABLE",
"D3DRENDERSTATE_ALPHATESTENABLE",
"D3DRENDERSTATE_LASTPIXEL",
"D3DRENDERSTATE_TEXTUREMAG",
"D3DRENDERSTATE_TEXTUREMIN",
"D3DRENDERSTATE_SRCBLEND",
"D3DRENDERSTATE_DESTBLEND",
"D3DRENDERSTATE_TEXTUREMAPBLEND",
"D3DRENDERSTATE_CULLMODE",
"D3DRENDERSTATE_ZFUNC",
"D3DRENDERSTATE_ALPHAREF",
"D3DRENDERSTATE_ALPHAFUNC",
"D3DRENDERSTATE_DITHERENABLE",
"D3DRENDERSTATE_ALPHABLENDENABLE",
"D3DRENDERSTATE_FOGENABLE",
"D3DRENDERSTATE_SPECULARENABLE",
"D3DRENDERSTATE_ZVISIBLE",
"D3DRENDERSTATE_SUBPIXEL",
"D3DRENDERSTATE_SUBPIXELX",
"D3DRENDERSTATE_STIPPLEDALPHA",
"D3DRENDERSTATE_FOGCOLOR",
"D3DRENDERSTATE_FOGTABLEMODE",
"D3DRENDERSTATE_FOGTABLESTART",
"D3DRENDERSTATE_FOGTABLEEND",
"D3DRENDERSTATE_FOGTABLEDENSITY",
"D3DRENDERSTATE_STIPPLEENABLE",
"D3DRENDERSTATE_EDGEANTIALIAS",
"D3DRENDERSTATE_COLORKEYENABLE",
"D3DRENDERSTATE_BORDERCOLOR",
"D3DRENDERSTATE_TEXTUREADDRESSU",
"D3DRENDERSTATE_TEXTUREADDRESSV",
"D3DRENDERSTATE_MIPMAPLODBIAS",
"D3DRENDERSTATE_ZBIAS",
"D3DRENDERSTATE_RANGEFOGENABLE",
"D3DRENDERSTATE_ANISOTROPY",
"D3DRENDERSTATE_FLUSHBATCH",
"D3DRENDERSTATE_STIPPLEPATTERN00",
"D3DRENDERSTATE_STIPPLEPATTERN01",
"D3DRENDERSTATE_STIPPLEPATTERN02",
"D3DRENDERSTATE_STIPPLEPATTERN03",
"D3DRENDERSTATE_STIPPLEPATTERN04",
"D3DRENDERSTATE_STIPPLEPATTERN05",
"D3DRENDERSTATE_STIPPLEPATTERN06",
"D3DRENDERSTATE_STIPPLEPATTERN07",
"D3DRENDERSTATE_STIPPLEPATTERN08",
"D3DRENDERSTATE_STIPPLEPATTERN09",
"D3DRENDERSTATE_STIPPLEPATTERN10",
"D3DRENDERSTATE_STIPPLEPATTERN11",
"D3DRENDERSTATE_STIPPLEPATTERN12",
"D3DRENDERSTATE_STIPPLEPATTERN13",
"D3DRENDERSTATE_STIPPLEPATTERN14",
"D3DRENDERSTATE_STIPPLEPATTERN15",
"D3DRENDERSTATE_STIPPLEPATTERN16",
"D3DRENDERSTATE_STIPPLEPATTERN17",
"D3DRENDERSTATE_STIPPLEPATTERN18",
"D3DRENDERSTATE_STIPPLEPATTERN19",
"D3DRENDERSTATE_STIPPLEPATTERN20",
"D3DRENDERSTATE_STIPPLEPATTERN21",
"D3DRENDERSTATE_STIPPLEPATTERN22",
"D3DRENDERSTATE_STIPPLEPATTERN23",
"D3DRENDERSTATE_STIPPLEPATTERN24",
"D3DRENDERSTATE_STIPPLEPATTERN25",
"D3DRENDERSTATE_STIPPLEPATTERN26",
"D3DRENDERSTATE_STIPPLEPATTERN27",
"D3DRENDERSTATE_STIPPLEPATTERN28",
"D3DRENDERSTATE_STIPPLEPATTERN29",
"D3DRENDERSTATE_STIPPLEPATTERN30",
"D3DRENDERSTATE_STIPPLEPATTERN31"
};
DUMP(" %s = 0x%08lx\n", states[type], value);
}
void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
DWORD dwRenderState)
{
if (TRACE_ON(ddraw))
_dump_renderstate(dwRenderStateType, dwRenderState);
/* First, all the stipple patterns */
if ((dwRenderStateType >= D3DRENDERSTATE_STIPPLEPATTERN00) &&
(dwRenderStateType >= D3DRENDERSTATE_STIPPLEPATTERN31)) {
} else {
/* All others state variables */
switch (dwRenderStateType) {
case D3DRENDERSTATE_ZENABLE: /* 7 */
if (dwRenderState)
glEnable(GL_DEPTH_TEST);
else
glDisable(GL_DEPTH_TEST);
break;
case D3DRENDERSTATE_ZWRITEENABLE: /* 14 */
if (dwRenderState)
glDepthMask(GL_TRUE);
else
glDepthMask(GL_FALSE);
break;
case D3DRENDERSTATE_ZFUNC: /* 23 */
switch ((D3DCMPFUNC) dwRenderState) {
case D3DCMP_NEVER:
glDepthFunc(GL_NEVER);
break;
case D3DCMP_LESS:
glDepthFunc(GL_LESS);
break;
case D3DCMP_EQUAL:
glDepthFunc(GL_EQUAL);
break;
case D3DCMP_LESSEQUAL:
glDepthFunc(GL_LEQUAL);
break;
case D3DCMP_GREATER:
glDepthFunc(GL_GREATER);
break;
case D3DCMP_NOTEQUAL:
glDepthFunc(GL_NOTEQUAL);
break;
case D3DCMP_GREATEREQUAL:
glDepthFunc(GL_GEQUAL);
break;
case D3DCMP_ALWAYS:
glDepthFunc(GL_ALWAYS);
break;
default:
ERR(ddraw, "Unexpected value\n");
}
break;
case D3DRENDERSTATE_DITHERENABLE: /* 26 */
if (dwRenderState)
glEnable(GL_DITHER);
else
glDisable(GL_DITHER);
break;
default:
FIXME(ddraw, "Unhandled Render State\n");
break;
}
}
}
#endif /* HAVE_MESAGL */
/* Direct3D Light
(c) 1998 Lionel ULMER
This files contains the implementation of Direct3DLight. */
#include "config.h"
#include "windows.h"
#include "wintypes.h"
#include "winerror.h"
#include "interfaces.h"
#include "heap.h"
#include "ddraw.h"
#include "d3d.h"
#include "debug.h"
#include "d3d_private.h"
#ifdef HAVE_MESAGL
static IDirect3DLight_VTable light_vtable;
enum {
D3D_1,
D3D_2
};
/*******************************************************************************
* Light static functions
*/
static const float zero_value[] = {
0.0, 0.0, 0.0, 0.0
};
static void update(LPDIRECT3DLIGHT this) {
switch (this->light.dltType) {
case D3DLIGHT_POINT: /* 1 */
TRACE(ddraw, "Activating POINT\n");
break;
case D3DLIGHT_SPOT: /* 2 */
TRACE(ddraw, "Activating SPOT\n");
break;
case D3DLIGHT_DIRECTIONAL: { /* 3 */
float direction[4];
TRACE(ddraw, "Activating DIRECTIONAL\n");
TRACE(ddraw, " direction : %f %f %f\n",
this->light.dvDirection.x.x,
this->light.dvDirection.y.y,
this->light.dvDirection.z.z);
_dump_colorvalue(" color ", this->light.dcvColor);
glLightfv(this->light_num,
GL_AMBIENT,
(float *) zero_value);
glLightfv(this->light_num,
GL_DIFFUSE,
(float *) &(this->light.dcvColor));
direction[0] = -this->light.dvDirection.x.x;
direction[1] = -this->light.dvDirection.y.y;
direction[2] = -this->light.dvDirection.z.z;
direction[3] = 0.0; /* This is a directional light */
glLightfv(this->light_num,
GL_POSITION,
(float *) direction);
} break;
case D3DLIGHT_PARALLELPOINT: /* 4 */
TRACE(ddraw, "Activating PARRALLEL-POINT\n");
break;
default:
TRACE(ddraw, "Not a know Light Type\n");
break;
}
}
static void activate(LPDIRECT3DLIGHT this) {
update(this);
/* If was not active, activate it */
if (this->is_active == 0) {
glEnable(this->light_num);
this->is_active = 1;
}
return ;
}
/*******************************************************************************
* Light Creation functions
*/
LPDIRECT3DLIGHT d3dlight_create(LPDIRECT3D2 d3d)
{
LPDIRECT3DLIGHT mat;
mat = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DLight));
mat->ref = 1;
mat->lpvtbl = &light_vtable;
mat->d3d.d3d2 = d3d;
mat->type = D3D_2;
mat->next = NULL;
mat->prev = NULL;
mat->activate = activate;
mat->is_active = 0;
return mat;
}
LPDIRECT3DLIGHT d3dlight_create_dx3(LPDIRECT3D d3d)
{
LPDIRECT3DLIGHT mat;
mat = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DLight));
mat->ref = 1;
mat->lpvtbl = &light_vtable;
mat->d3d.d3d = d3d;
mat->type = D3D_1;
mat->next = NULL;
mat->prev = NULL;
mat->activate = activate;
mat->is_active = 0;
return mat;
}
/*******************************************************************************
* IDirect3DLight methods
*/
static HRESULT WINAPI IDirect3DLight_QueryInterface(LPDIRECT3DLIGHT this,
REFIID riid,
LPVOID* ppvObj)
{
char xrefiid[50];
WINE_StringFromCLSID((LPCLSID)riid,xrefiid);
FIXME(ddraw, "(%p)->(%s,%p): stub\n", this, xrefiid,ppvObj);
return S_OK;
}
static ULONG WINAPI IDirect3DLight_AddRef(LPDIRECT3DLIGHT this)
{
TRACE(ddraw, "(%p)->()incrementing from %lu.\n", this, this->ref );
return ++(this->ref);
}
static ULONG WINAPI IDirect3DLight_Release(LPDIRECT3DLIGHT this)
{
FIXME( ddraw, "(%p)->() decrementing from %lu.\n", this, this->ref );
if (!--(this->ref)) {
HeapFree(GetProcessHeap(),0,this);
return 0;
}
return this->ref;
}
/*** IDirect3DLight methods ***/
static void dump_light(LPD3DLIGHT light)
{
fprintf(stderr, " dwSize : %ld\n", light->dwSize);
}
static HRESULT WINAPI IDirect3DLight_GetLight(LPDIRECT3DLIGHT this,
LPD3DLIGHT lpLight)
{
TRACE(ddraw, "(%p)->(%p)\n", this, lpLight);
if (TRACE_ON(ddraw))
dump_light(lpLight);
/* Copies the light structure */
switch (this->type) {
case D3D_1:
*((LPD3DLIGHT)lpLight) = *((LPD3DLIGHT) &(this->light));
break;
case D3D_2:
*((LPD3DLIGHT2)lpLight) = *((LPD3DLIGHT2) &(this->light));
break;
}
return DD_OK;
}
static HRESULT WINAPI IDirect3DLight_SetLight(LPDIRECT3DLIGHT this,
LPD3DLIGHT lpLight)
{
TRACE(ddraw, "(%p)->(%p)\n", this, lpLight);
if (TRACE_ON(ddraw))
dump_light(lpLight);
/* Stores the light */
switch (this->type) {
case D3D_1:
*((LPD3DLIGHT) &(this->light)) = *((LPD3DLIGHT)lpLight);
break;
case D3D_2:
*((LPD3DLIGHT2) &(this->light)) = *((LPD3DLIGHT2)lpLight);
break;
}
if (this->is_active)
update(this);
return DD_OK;
}
static HRESULT WINAPI IDirect3DLight_Initialize(LPDIRECT3DLIGHT this,
LPDIRECT3D lpDirect3D)
{
TRACE(ddraw, "(%p)->(%p)\n", this, lpDirect3D);
return DDERR_ALREADYINITIALIZED;
}
/*******************************************************************************
* IDirect3DLight VTable
*/
static IDirect3DLight_VTable light_vtable = {
/*** IUnknown methods ***/
IDirect3DLight_QueryInterface,
IDirect3DLight_AddRef,
IDirect3DLight_Release,
/*** IDirect3DLight methods ***/
IDirect3DLight_Initialize,
IDirect3DLight_SetLight,
IDirect3DLight_GetLight
};
#else /* HAVE_MESAGL */
/* These function should never be called if MesaGL is not present */
LPDIRECT3DLIGHT d3dlight_create_dx3(LPDIRECT3D d3d) {
ERR(ddraw, "Should not be called...\n");
return NULL;
}
LPDIRECT3DLIGHT d3dlight_create(LPDIRECT3D2 d3d) {
ERR(ddraw, "Should not be called...\n");
return NULL;
}
#endif /* HAVE_MESAGL */
/* Direct3D Material
(c) 1998 Lionel ULMER
This files contains the implementation of Direct3DMaterial2. */
#include "config.h"
#include "windows.h"
#include "wintypes.h"
#include "winerror.h"
#include "interfaces.h"
#include "heap.h"
#include "ddraw.h"
#include "d3d.h"
#include "debug.h"
#include "d3d_private.h"
#ifdef HAVE_MESAGL
static IDirect3DMaterial2_VTable material2_vtable;
static IDirect3DMaterial_VTable material_vtable;
/*******************************************************************************
* Matrial2 static functions
*/
static void activate(LPDIRECT3DMATERIAL2 this) {
TRACE(ddraw, "Activating material %p\n", this);
/* First, set the rendering context */
if (this->use_d3d2)
this->device.active_device2->set_context(this->device.active_device2);
else
this->device.active_device1->set_context(this->device.active_device1);
/* Set the current Material */
_dump_colorvalue("Diffuse", this->mat.a.diffuse);
glMaterialfv(GL_FRONT,
GL_DIFFUSE,
(float *) &(this->mat.a.diffuse));
_dump_colorvalue("Ambient", this->mat.b.ambient);
glMaterialfv(GL_FRONT,
GL_AMBIENT,
(float *) &(this->mat.b.ambient));
_dump_colorvalue("Specular", this->mat.c.specular);
glMaterialfv(GL_FRONT,
GL_SPECULAR,
(float *) &(this->mat.c.specular));
_dump_colorvalue("Emissive", this->mat.d.emissive);
glMaterialfv(GL_FRONT,
GL_EMISSION,
(float *) &(this->mat.d.emissive));
TRACE(ddraw, "Size : %ld\n", this->mat.dwSize);
TRACE(ddraw, "Power : %f\n", this->mat.e.power);
return ;
}
/*******************************************************************************
* Matrial2 Creation functions
*/
LPDIRECT3DMATERIAL2 d3dmaterial2_create(LPDIRECT3D2 d3d)
{
LPDIRECT3DMATERIAL2 mat;
mat = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DMaterial2));
mat->ref = 1;
mat->lpvtbl = &material2_vtable;
mat->use_d3d2 = 1;
mat->d3d.d3d2 = d3d;
mat->activate = activate;
return mat;
}
LPDIRECT3DMATERIAL d3dmaterial_create(LPDIRECT3D d3d)
{
LPDIRECT3DMATERIAL2 mat;
mat = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DMaterial2));
mat->ref = 1;
mat->lpvtbl = (LPDIRECT3DMATERIAL2_VTABLE) &material_vtable;
mat->use_d3d2 = 0;
mat->d3d.d3d1 = d3d;
mat->activate = activate;
return (LPDIRECT3DMATERIAL) mat;
}
/*******************************************************************************
* IDirect3DMaterial2 methods
*/
static HRESULT WINAPI IDirect3DMaterial2_QueryInterface(LPDIRECT3DMATERIAL2 this,
REFIID riid,
LPVOID* ppvObj)
{
char xrefiid[50];
WINE_StringFromCLSID((LPCLSID)riid,xrefiid);
FIXME(ddraw, "(%p)->(%s,%p): stub\n", this, xrefiid,ppvObj);
return S_OK;
}
static ULONG WINAPI IDirect3DMaterial2_AddRef(LPDIRECT3DMATERIAL2 this)
{
TRACE(ddraw, "(%p)->()incrementing from %lu.\n", this, this->ref );
return ++(this->ref);
}
static ULONG WINAPI IDirect3DMaterial2_Release(LPDIRECT3DMATERIAL2 this)
{
FIXME( ddraw, "(%p)->() decrementing from %lu.\n", this, this->ref );
if (!--(this->ref)) {
HeapFree(GetProcessHeap(),0,this);
return 0;
}
return this->ref;
}
/*** IDirect3DMaterial2 methods ***/
static void dump_material(LPD3DMATERIAL mat)
{
fprintf(stderr, " dwSize : %ld\n", mat->dwSize);
}
static HRESULT WINAPI IDirect3DMaterial2_GetMaterial(LPDIRECT3DMATERIAL2 this,
LPD3DMATERIAL lpMat)
{
TRACE(ddraw, "(%p)->(%p)\n", this, lpMat);
if (TRACE_ON(ddraw))
dump_material(lpMat);
/* Copies the material structure */
*lpMat = this->mat;
return DD_OK;
}
static HRESULT WINAPI IDirect3DMaterial2_SetMaterial(LPDIRECT3DMATERIAL2 this,
LPD3DMATERIAL lpMat)
{
TRACE(ddraw, "(%p)->(%p)\n", this, lpMat);
if (TRACE_ON(ddraw))
dump_material(lpMat);
/* Stores the material */
this->mat = *lpMat;
return DD_OK;
}
static HRESULT WINAPI IDirect3DMaterial2_GetHandle(LPDIRECT3DMATERIAL2 this,
LPDIRECT3DDEVICE2 lpD3DDevice2,
LPD3DMATERIALHANDLE lpMatHandle)
{
FIXME(ddraw, "(%p)->(%p,%p): stub\n", this, lpD3DDevice2, lpMatHandle);
if (this->use_d3d2)
this->device.active_device2 = lpD3DDevice2;
else
this->device.active_device1 = (LPDIRECT3DDEVICE) lpD3DDevice2;
*lpMatHandle = (DWORD) this; /* lpD3DDevice2->store_material(this); */
return DD_OK;
}
static HRESULT WINAPI IDirect3DMaterial_Reserve(LPDIRECT3DMATERIAL this)
{
FIXME(ddraw, "(%p)->(): stub\n", this);
return DDERR_INVALIDPARAMS;
}
static HRESULT WINAPI IDirect3DMaterial_Unreserve(LPDIRECT3DMATERIAL this)
{
FIXME(ddraw, "(%p)->(): stub\n", this);
return DDERR_INVALIDPARAMS;
}
static HRESULT WINAPI IDirect3DMaterial_Initialize(LPDIRECT3DMATERIAL this,
LPDIRECT3D lpDirect3D)
{
TRACE(ddraw, "(%p)->(%p)\n", this, lpDirect3D);
return DDERR_ALREADYINITIALIZED;
}
/*******************************************************************************
* IDirect3DMaterial VTable
*/
static IDirect3DMaterial_VTable material_vtable = {
/*** IUnknown methods ***/
IDirect3DMaterial2_QueryInterface,
IDirect3DMaterial2_AddRef,
IDirect3DMaterial2_Release,
/*** IDirect3DMaterial methods ***/
IDirect3DMaterial_Initialize,
IDirect3DMaterial2_SetMaterial,
IDirect3DMaterial2_GetMaterial,
IDirect3DMaterial2_GetHandle,
IDirect3DMaterial_Reserve,
IDirect3DMaterial_Unreserve
};
/*******************************************************************************
* IDirect3DMaterial2 VTable
*/
static IDirect3DMaterial2_VTable material2_vtable = {
/*** IUnknown methods ***/
IDirect3DMaterial2_QueryInterface,
IDirect3DMaterial2_AddRef,
IDirect3DMaterial2_Release,
/*** IDirect3DMaterial methods ***/
IDirect3DMaterial2_SetMaterial,
IDirect3DMaterial2_GetMaterial,
IDirect3DMaterial2_GetHandle
};
#else /* HAVE_MESAGL */
LPDIRECT3DMATERIAL d3dmaterial_create(LPDIRECT3D d3d) {
ERR(ddraw, "Should not be called...\n");
return NULL;
}
LPDIRECT3DMATERIAL2 d3dmaterial2_create(LPDIRECT3D2 d3d) {
ERR(ddraw, "Should not be called...\n");
return NULL;
}
#endif /* HAVE_MESAGL */
/* Direct3D Texture
(c) 1998 Lionel ULMER
This files contains the implementation of interface Direct3DTexture2. */
#include "config.h"
#include "windows.h"
#include "wintypes.h"
#include "winerror.h"
#include "interfaces.h"
#include "heap.h"
#include "ddraw.h"
#include "d3d.h"
#include "debug.h"
#include "d3d_private.h"
#ifdef HAVE_MESAGL
static IDirect3DTexture2_VTable texture2_vtable;
static IDirect3DTexture_VTable texture_vtable;
/*******************************************************************************
* Texture2 Creation functions
*/
LPDIRECT3DTEXTURE2 d3dtexture2_create(LPDIRECTDRAWSURFACE3 surf)
{
LPDIRECT3DTEXTURE2 mat;
mat = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DTexture2));
mat->ref = 1;
mat->lpvtbl = &texture2_vtable;
mat->surface = surf;
return mat;
}
/*******************************************************************************
* Texture Creation functions
*/
LPDIRECT3DTEXTURE d3dtexture_create(LPDIRECTDRAWSURFACE3 surf)
{
LPDIRECT3DTEXTURE mat;
mat = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DTexture));
mat->ref = 1;
mat->lpvtbl = (IDirect3DTexture2_VTable*) &texture_vtable;
mat->surface = surf;
return mat;
}
/*******************************************************************************
* IDirect3DTexture2 methods
*/
static HRESULT WINAPI IDirect3DTexture2_QueryInterface(LPDIRECT3DTEXTURE2 this,
REFIID riid,
LPVOID* ppvObj)
{
char xrefiid[50];
WINE_StringFromCLSID((LPCLSID)riid,xrefiid);
FIXME(ddraw, "(%p)->(%s,%p): stub\n", this, xrefiid,ppvObj);
return S_OK;
}
static ULONG WINAPI IDirect3DTexture2_AddRef(LPDIRECT3DTEXTURE2 this)
{
TRACE(ddraw, "(%p)->()incrementing from %lu.\n", this, this->ref );
return ++(this->ref);
}
static ULONG WINAPI IDirect3DTexture2_Release(LPDIRECT3DTEXTURE2 this)
{
FIXME( ddraw, "(%p)->() decrementing from %lu.\n", this, this->ref );
if (!--(this->ref)) {
HeapFree(GetProcessHeap(),0,this);
return 0;
}
return this->ref;
}
/*** IDirect3DTexture methods ***/
static HRESULT WINAPI IDirect3DTexture_GetHandle(LPDIRECT3DTEXTURE this,
LPDIRECT3DDEVICE lpD3DDevice,
LPD3DTEXTUREHANDLE lpHandle)
{
FIXME(ddraw, "(%p)->(%p,%p): stub\n", this, lpD3DDevice, lpHandle);
*lpHandle = (DWORD) this->surface;
return DD_OK;
}
static HRESULT WINAPI IDirect3DTexture_Initialize(LPDIRECT3DTEXTURE this,
LPDIRECT3DDEVICE lpD3DDevice,
LPDIRECTDRAWSURFACE lpSurface)
{
TRACE(ddraw, "(%p)->(%p,%p)\n", this, lpD3DDevice, lpSurface);
return DDERR_ALREADYINITIALIZED;
}
static HRESULT WINAPI IDirect3DTexture_Unload(LPDIRECT3DTEXTURE this)
{
FIXME(ddraw, "(%p)->(): stub\n", this);
return DD_OK;
}
/*** IDirect3DTexture2 methods ***/
static HRESULT WINAPI IDirect3DTexture2_GetHandle(LPDIRECT3DTEXTURE2 this,
LPDIRECT3DDEVICE2 lpD3DDevice2,
LPD3DTEXTUREHANDLE lpHandle)
{
FIXME(ddraw, "(%p)->(%p,%p): stub\n", this, lpD3DDevice2, lpHandle);
*lpHandle = (DWORD) this->surface; /* lpD3DDevice2->store_texture(this); */
return DD_OK;
}
/* Common methods */
static HRESULT WINAPI IDirect3DTexture2_PaletteChanged(LPDIRECT3DTEXTURE2 this,
DWORD dwStart,
DWORD dwCount)
{
FIXME(ddraw, "(%p)->(%8ld,%8ld): stub\n", this, dwStart, dwCount);
return DD_OK;
}
static HRESULT WINAPI IDirect3DTexture2_Load(LPDIRECT3DTEXTURE2 this,
LPDIRECT3DTEXTURE2 lpD3DTexture2)
{
FIXME(ddraw, "(%p)->(%p): stub\n", this, lpD3DTexture2);
/* Hack ? */
FIXME(ddraw, "Sthis %p / Sload %p\n", this->surface, lpD3DTexture2->surface);
this->surface->s.surface_desc.ddsCaps.dwCaps &= ~DDSCAPS_ALLOCONLOAD;
return DD_OK;
}
/*******************************************************************************
* IDirect3DTexture2 VTable
*/
static IDirect3DTexture2_VTable texture2_vtable = {
/*** IUnknown methods ***/
IDirect3DTexture2_QueryInterface,
IDirect3DTexture2_AddRef,
IDirect3DTexture2_Release,
/*** IDirect3DTexture methods ***/
IDirect3DTexture2_GetHandle,
IDirect3DTexture2_PaletteChanged,
IDirect3DTexture2_Load
};
/*******************************************************************************
* IDirect3DTexture VTable
*/
static IDirect3DTexture_VTable texture_vtable = {
/*** IUnknown methods ***/
IDirect3DTexture2_QueryInterface,
IDirect3DTexture2_AddRef,
IDirect3DTexture2_Release,
/*** IDirect3DTexture methods ***/
IDirect3DTexture_Initialize,
IDirect3DTexture_GetHandle,
IDirect3DTexture2_PaletteChanged,
IDirect3DTexture2_Load,
IDirect3DTexture_Unload
};
#else /* HAVE_MESAGL */
/* These function should never be called if MesaGL is not present */
LPDIRECT3DTEXTURE2 d3dtexture2_create(LPDIRECTDRAWSURFACE3 surf) {
ERR(ddraw, "Should not be called...\n");
return NULL;
}
LPDIRECT3DTEXTURE d3dtexture_create(LPDIRECTDRAWSURFACE3 surf) {
ERR(ddraw, "Should not be called...\n");
return NULL;
}
#endif /* HAVE_MESAGL */
/* Direct3D Viewport
(c) 1998 Lionel ULMER
This files contains the implementation of Direct3DViewport2. */
#include "config.h"
#include "windows.h"
#include "wintypes.h"
#include "winerror.h"
#include "interfaces.h"
#include "heap.h"
#include "ddraw.h"
#include "d3d.h"
#include "debug.h"
#include "d3d_private.h"
#ifdef HAVE_MESAGL
static IDirect3DViewport2_VTable viewport2_vtable;
/*******************************************************************************
* Viewport1/2 static functions
*/
static void activate(LPDIRECT3DVIEWPORT2 this) {
LPDIRECT3DLIGHT l;
/* Activate all the lights associated with this context */
l = this->lights;
while (l != NULL) {
l->activate(l);
l = l->next;
}
}
/*******************************************************************************
* Viewport1/2 Creation functions
*/
LPDIRECT3DVIEWPORT2 d3dviewport2_create(LPDIRECT3D2 d3d)
{
LPDIRECT3DVIEWPORT2 vp;
vp = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DViewport2));
vp->ref = 1;
vp->lpvtbl = &viewport2_vtable;
vp->d3d.d3d2 = d3d;
vp->use_d3d2 = 1;
vp->device.active_device2 = NULL;
vp->activate = activate;
vp->lights = NULL;
vp->nextlight = GL_LIGHT0;
return vp;
}
LPDIRECT3DVIEWPORT d3dviewport_create(LPDIRECT3D d3d)
{
LPDIRECT3DVIEWPORT2 vp;
vp = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DViewport2));
vp->ref = 1;
vp->lpvtbl = &viewport2_vtable;
vp->d3d.d3d1 = d3d;
vp->use_d3d2 = 0;
vp->device.active_device1 = NULL;
vp->activate = activate;
vp->lights = NULL;
vp->nextlight = GL_LIGHT0;
return (LPDIRECT3DVIEWPORT) vp;
}
/*******************************************************************************
* IDirect3DViewport2 methods
*/
static HRESULT WINAPI IDirect3DViewport2_QueryInterface(LPDIRECT3DVIEWPORT2 this,
REFIID riid,
LPVOID* ppvObj)
{
char xrefiid[50];
WINE_StringFromCLSID((LPCLSID)riid,xrefiid);
FIXME(ddraw, "(%p)->(%s,%p): stub\n", this, xrefiid,ppvObj);
return S_OK;
}
static ULONG WINAPI IDirect3DViewport2_AddRef(LPDIRECT3DVIEWPORT2 this)
{
TRACE(ddraw, "(%p)->()incrementing from %lu.\n", this, this->ref );
return ++(this->ref);
}
static ULONG WINAPI IDirect3DViewport2_Release(LPDIRECT3DVIEWPORT2 this)
{
FIXME( ddraw, "(%p)->() decrementing from %lu.\n", this, this->ref );
if (!--(this->ref)) {
HeapFree(GetProcessHeap(),0,this);
return 0;
}
return this->ref;
}
/*** IDirect3DViewport methods ***/
static HRESULT WINAPI IDirect3DViewport2_Initialize(LPDIRECT3DVIEWPORT2 this,
LPDIRECT3D d3d)
{
FIXME(ddraw, "(%p)->(%p): stub\n", this, d3d);
return DD_OK;
}
static HRESULT WINAPI IDirect3DViewport2_GetViewport(LPDIRECT3DVIEWPORT2 this,
LPD3DVIEWPORT lpvp)
{
FIXME(ddraw, "(%p)->(%p): stub\n", this, lpvp);
if (this->use_vp2 != 0)
return DDERR_INVALIDPARAMS;
*lpvp = this->viewport.vp1;
return DD_OK;
}
static HRESULT WINAPI IDirect3DViewport2_SetViewport(LPDIRECT3DVIEWPORT2 this,
LPD3DVIEWPORT lpvp)
{
FIXME(ddraw, "(%p)->(%p): stub\n", this, lpvp);
this->use_vp2 = 0;
this->viewport.vp1 = *lpvp;
return DD_OK;
}
static HRESULT WINAPI IDirect3DViewport2_TransformVertices(LPDIRECT3DVIEWPORT2 this,
DWORD dwVertexCount,
LPD3DTRANSFORMDATA lpData,
DWORD dwFlags,
LPDWORD lpOffScreen)
{
FIXME(ddraw, "(%p)->(%8ld,%p,%08lx,%p): stub\n",
this, dwVertexCount, lpData, dwFlags, lpOffScreen);
return DD_OK;
}
static HRESULT WINAPI IDirect3DViewport2_LightElements(LPDIRECT3DVIEWPORT2 this,
DWORD dwElementCount,
LPD3DLIGHTDATA lpData)
{
FIXME(ddraw, "(%p)->(%8ld,%p): stub\n", this, dwElementCount, lpData);
return DD_OK;
}
static HRESULT WINAPI IDirect3DViewport2_SetBackground(LPDIRECT3DVIEWPORT2 this,
D3DMATERIALHANDLE hMat)
{
FIXME(ddraw, "(%p)->(%08x): stub\n", this, hMat);
return DD_OK;
}
static HRESULT WINAPI IDirect3DViewport2_GetBackground(LPDIRECT3DVIEWPORT2 this,
LPD3DMATERIALHANDLE lphMat,
LPBOOL lpValid)
{
FIXME(ddraw, "(%p)->(%p,%p): stub\n", this, lphMat, lpValid);
return DD_OK;
}
static HRESULT WINAPI IDirect3DViewport2_SetBackgroundDepth(LPDIRECT3DVIEWPORT2 this,
LPDIRECTDRAWSURFACE lpDDSurface)
{
FIXME(ddraw, "(%p)->(%p): stub\n", this, lpDDSurface);
return DD_OK;
}
static HRESULT WINAPI IDirect3DViewport2_GetBackgroundDepth(LPDIRECT3DVIEWPORT2 this,
LPDIRECTDRAWSURFACE* lplpDDSurface,
LPBOOL lpValid)
{
FIXME(ddraw, "(%p)->(%p,%p): stub\n", this, lplpDDSurface, lpValid);
return DD_OK;
}
static HRESULT WINAPI IDirect3DViewport2_Clear(LPDIRECT3DVIEWPORT2 this,
DWORD dwCount,
LPD3DRECT lpRects,
DWORD dwFlags)
{
FIXME(ddraw, "(%p)->(%8ld,%p,%08lx): stub\n", this, dwCount, lpRects, dwFlags);
/* For the moment, ignore the rectangles */
if (this->device.active_device1 != NULL) {
/* Get the rendering context */
if (this->use_d3d2)
this->device.active_device2->set_context(this->device.active_device2);
else
this->device.active_device1->set_context(this->device.active_device1);
/* Clears the screen */
glDepthMask(GL_TRUE); /* Enables Z writing to be sure to delete also the Z buffer */
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
return DD_OK;
}
static HRESULT WINAPI IDirect3DViewport2_AddLight(LPDIRECT3DVIEWPORT2 this,
LPDIRECT3DLIGHT lpLight)
{
FIXME(ddraw, "(%p)->(%p): stub\n", this, lpLight);
/* Add the light in the 'linked' chain */
lpLight->next = this->lights;
this->lights = lpLight;
/* If active, activate the light */
if (this->device.active_device1 != NULL) {
/* Get the rendering context */
if (this->use_d3d2)
this->device.active_device2->set_context(this->device.active_device2);
else
this->device.active_device1->set_context(this->device.active_device1);
/* Activate the light */
lpLight->light_num = this->nextlight++;
lpLight->activate(lpLight);
}
return DD_OK;
}
static HRESULT WINAPI IDirect3DViewport2_DeleteLight(LPDIRECT3DVIEWPORT2 this,
LPDIRECT3DLIGHT lpLight)
{
FIXME(ddraw, "(%p)->(%p): stub\n", this, lpLight);
return DD_OK;
}
static HRESULT WINAPI IDirect3DViewport2_NextLight(LPDIRECT3DVIEWPORT2 this,
LPDIRECT3DLIGHT lpLight,
LPDIRECT3DLIGHT* lplpLight,
DWORD dwFlags)
{
FIXME(ddraw, "(%p)->(%p,%p,%08lx): stub\n", this, lpLight, lplpLight, dwFlags);
return DD_OK;
}
/*** IDirect3DViewport2 methods ***/
static HRESULT WINAPI IDirect3DViewport2_GetViewport2(LPDIRECT3DVIEWPORT2 this,
LPD3DVIEWPORT2 lpViewport2)
{
TRACE(ddraw, "(%p)->(%p)\n", this, lpViewport2);
if (this->use_vp2 != 1)
return DDERR_INVALIDPARAMS;
*lpViewport2 = this->viewport.vp2;
return DD_OK;
}
static HRESULT WINAPI IDirect3DViewport2_SetViewport2(LPDIRECT3DVIEWPORT2 this,
LPD3DVIEWPORT2 lpViewport2)
{
TRACE(ddraw, "(%p)->(%p)\n", this, lpViewport2);
TRACE(ddraw, "dwSize = %ld dwX = %ld dwY = %ld\n",
lpViewport2->dwSize, lpViewport2->dwX, lpViewport2->dwY);
TRACE(ddraw, "dwWidth = %ld dwHeight = %ld\n",
lpViewport2->dwWidth, lpViewport2->dwHeight);
TRACE(ddraw, "dvClipX = %f dvClipY = %f\n",
lpViewport2->dvClipX, lpViewport2->dvClipY);
TRACE(ddraw, "dvClipWidth = %f dvClipHeight = %f\n",
lpViewport2->dvClipWidth, lpViewport2->dvClipHeight);
TRACE(ddraw, "dvMinZ = %f dvMaxZ = %f\n",
lpViewport2->dvMinZ, lpViewport2->dvMaxZ);
this->viewport.vp2 = *lpViewport2;
this->use_vp2 = 1;
return DD_OK;
}
/*******************************************************************************
* IDirect3DViewport1/2 VTable
*/
static IDirect3DViewport2_VTable viewport2_vtable = {
/*** IUnknown methods ***/
IDirect3DViewport2_QueryInterface,
IDirect3DViewport2_AddRef,
IDirect3DViewport2_Release,
/*** IDirect3DViewport methods ***/
IDirect3DViewport2_Initialize,
IDirect3DViewport2_GetViewport,
IDirect3DViewport2_SetViewport,
IDirect3DViewport2_TransformVertices,
IDirect3DViewport2_LightElements,
IDirect3DViewport2_SetBackground,
IDirect3DViewport2_GetBackground,
IDirect3DViewport2_SetBackgroundDepth,
IDirect3DViewport2_GetBackgroundDepth,
IDirect3DViewport2_Clear,
IDirect3DViewport2_AddLight,
IDirect3DViewport2_DeleteLight,
IDirect3DViewport2_NextLight,
/*** IDirect3DViewport2 methods ***/
IDirect3DViewport2_GetViewport2,
IDirect3DViewport2_SetViewport2
};
#else /* HAVE_MESAGL */
LPDIRECT3DVIEWPORT d3dviewport_create(LPDIRECT3D d3d) {
ERR(ddraw, "Should not be called...\n");
return NULL;
}
LPDIRECT3DVIEWPORT2 d3dviewport2_create(LPDIRECT3D2 d3d) {
ERR(ddraw, "Should not be called...\n");
return NULL;
}
#endif /* HAVE_MESAGL */
......@@ -72,3 +72,5 @@
/* Define if IPX includes are taken from Linux kernel */
#undef HAVE_IPX_LINUX
/* Define if Mesa is present on the system or not */
#undef HAVE_MESAGL
......@@ -75,6 +75,9 @@
/* Define if IPX includes are taken from Linux kernel */
#undef HAVE_IPX_LINUX
/* Define if Mesa is present on the system or not */
#undef HAVE_MESAGL
/* The number of bytes in a long long. */
#undef SIZEOF_LONG_LONG
......
/* Wrapper for OpenGL includes...
Copyright 1998 - Lionel Ulmer
This wrapper is needed because Mesa uses also the CALLBACK / WINAPI
constants. */
#ifndef __WINE_GL_H
#define __WINE_GL_H
#ifdef HAVE_MESAGL
#undef APIENTRY
#undef CALLBACK
#undef WINAPI
#include <GL/gl.h>
/* These will need to have some #ifdef / #endif added to support
more than the X11 using OSMesa target */
#include <GL/osmesa.h>
#undef APIENTRY
#undef CALLBACK
#undef WINAPI
/* Redefines the constants */
#define CALLBACK __stdcall
#define WINAPI __stdcall
#define APIENTRY WINAPI
#endif /* HAVE_MESAGL */
#endif /* __WINE_GL_H */
......@@ -1211,17 +1211,17 @@ static HRESULT WINAPI IDirectSound_CreateSoundBuffer(
ds3db->lpvtbl = &ds3dbvt;
(*ppdsb)->ds3db = ds3db;
ds3db->ds3db.dwSize = sizeof(DS3DBUFFER);
ds3db->ds3db.vPosition.x = 0.0;
ds3db->ds3db.vPosition.y = 0.0;
ds3db->ds3db.vPosition.z = 0.0;
ds3db->ds3db.vVelocity.x = 0.0;
ds3db->ds3db.vVelocity.y = 0.0;
ds3db->ds3db.vVelocity.z = 0.0;
ds3db->ds3db.vPosition.x.x = 0.0;
ds3db->ds3db.vPosition.y.y = 0.0;
ds3db->ds3db.vPosition.z.z = 0.0;
ds3db->ds3db.vVelocity.x.x = 0.0;
ds3db->ds3db.vVelocity.y.y = 0.0;
ds3db->ds3db.vVelocity.z.z = 0.0;
ds3db->ds3db.dwInsideConeAngle = DS3D_DEFAULTCONEANGLE;
ds3db->ds3db.dwOutsideConeAngle = DS3D_DEFAULTCONEANGLE;
ds3db->ds3db.vConeOrientation.x = 0.0;
ds3db->ds3db.vConeOrientation.y = 0.0;
ds3db->ds3db.vConeOrientation.z = 0.0;
ds3db->ds3db.vConeOrientation.x.x = 0.0;
ds3db->ds3db.vConeOrientation.y.y = 0.0;
ds3db->ds3db.vConeOrientation.z.z = 0.0;
ds3db->ds3db.lConeOutsideVolume = DS3D_DEFAULTCONEOUTSIDEVOLUME;
ds3db->ds3db.flMinDistance = DS3D_DEFAULTMINDISTANCE;
ds3db->ds3db.flMaxDistance = DS3D_DEFAULTMAXDISTANCE;
......@@ -1355,18 +1355,18 @@ static HRESULT WINAPI IDirectSound_QueryInterface(
this->listener->lpvtbl = &ds3dlvt;
this->lpvtbl->fnAddRef(this);
this->listener->ds3dl.dwSize = sizeof(DS3DLISTENER);
this->listener->ds3dl.vPosition.x = 0.0;
this->listener->ds3dl.vPosition.y = 0.0;
this->listener->ds3dl.vPosition.z = 0.0;
this->listener->ds3dl.vVelocity.x = 0.0;
this->listener->ds3dl.vVelocity.y = 0.0;
this->listener->ds3dl.vVelocity.z = 0.0;
this->listener->ds3dl.vOrientFront.x = 0.0;
this->listener->ds3dl.vOrientFront.y = 0.0;
this->listener->ds3dl.vOrientFront.z = 1.0;
this->listener->ds3dl.vOrientTop.x = 0.0;
this->listener->ds3dl.vOrientTop.y = 1.0;
this->listener->ds3dl.vOrientTop.z = 0.0;
this->listener->ds3dl.vPosition.x.x = 0.0;
this->listener->ds3dl.vPosition.y.y = 0.0;
this->listener->ds3dl.vPosition.z.z = 0.0;
this->listener->ds3dl.vVelocity.x.x = 0.0;
this->listener->ds3dl.vVelocity.y.y = 0.0;
this->listener->ds3dl.vVelocity.z.z = 0.0;
this->listener->ds3dl.vOrientFront.x.x = 0.0;
this->listener->ds3dl.vOrientFront.y.y = 0.0;
this->listener->ds3dl.vOrientFront.z.z = 1.0;
this->listener->ds3dl.vOrientTop.x.x = 0.0;
this->listener->ds3dl.vOrientTop.y.y = 1.0;
this->listener->ds3dl.vOrientTop.z.z = 0.0;
this->listener->ds3dl.flDistanceFactor = DS3D_DEFAULTDISTANCEFACTOR;
this->listener->ds3dl.flRolloffFactor = DS3D_DEFAULTROLLOFFFACTOR;
this->listener->ds3dl.flDopplerFactor = DS3D_DEFAULTDOPPLERFACTOR;
......
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