Updated to include all the implementation aspects that were previously
in the public includes.
This commit is contained in:
parent
f44e3e90d4
commit
9e2f4af9b0
|
@ -4,14 +4,233 @@
|
|||
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
|
||||
#ifndef __GRAPHICS_WINE_D3D_PRIVATE_H
|
||||
#define __GRAPHICS_WINE_D3D_PRIVATE_H
|
||||
|
||||
#include "wine_gl.h"
|
||||
|
||||
#include "d3d.h"
|
||||
|
||||
#include "ddraw_private.h"
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Predeclare the interface implementation structures
|
||||
*/
|
||||
typedef struct IDirect3DImpl IDirect3DImpl;
|
||||
typedef struct IDirect3D2Impl IDirect3D2Impl;
|
||||
typedef struct IDirect3DLightImpl IDirect3DLightImpl;
|
||||
typedef struct IDirect3DMaterial2Impl IDirect3DMaterial2Impl;
|
||||
typedef struct IDirect3DTexture2Impl IDirect3DTexture2Impl;
|
||||
typedef struct IDirect3DViewport2Impl IDirect3DViewport2Impl;
|
||||
typedef struct IDirect3DExecuteBufferImpl IDirect3DExecuteBufferImpl;
|
||||
typedef struct IDirect3DDeviceImpl IDirect3DDeviceImpl;
|
||||
typedef struct IDirect3DDevice2Impl IDirect3DDevice2Impl;
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3D implementation structure
|
||||
*/
|
||||
struct IDirect3DImpl
|
||||
{
|
||||
/* IUnknown fields */
|
||||
ICOM_VTABLE(IDirect3D)* lpvtbl;
|
||||
DWORD ref;
|
||||
/* IDirect3D fields */
|
||||
IDirectDrawImpl* ddraw;
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3D2 implementation structure
|
||||
*/
|
||||
struct IDirect3D2Impl
|
||||
{
|
||||
/* IUnknown fields */
|
||||
ICOM_VTABLE(IDirect3D2)* lpvtbl;
|
||||
DWORD ref;
|
||||
/* IDirect3D2 fields */
|
||||
IDirectDrawImpl* ddraw;
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3DLight implementation structure
|
||||
*/
|
||||
struct IDirect3DLightImpl
|
||||
{
|
||||
/* IUnknown fields */
|
||||
ICOM_VTABLE(IDirect3DLight)* lpvtbl;
|
||||
DWORD ref;
|
||||
/* IDirect3DLight fields */
|
||||
union {
|
||||
IDirect3DImpl* d3d1;
|
||||
IDirect3D2Impl* d3d2;
|
||||
} d3d;
|
||||
int type;
|
||||
|
||||
D3DLIGHT2 light;
|
||||
|
||||
/* Chained list used for adding / removing from viewports */
|
||||
IDirect3DLightImpl *next, *prev;
|
||||
|
||||
/* Activation function */
|
||||
void (*activate)(IDirect3DLightImpl*);
|
||||
int is_active;
|
||||
|
||||
/* Awful OpenGL code !!! */
|
||||
#ifdef HAVE_MESAGL
|
||||
GLenum light_num;
|
||||
#endif
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3DMaterial2 implementation structure
|
||||
*/
|
||||
struct IDirect3DMaterial2Impl
|
||||
{
|
||||
/* IUnknown fields */
|
||||
ICOM_VTABLE(IDirect3DMaterial2)* lpvtbl;
|
||||
DWORD ref;
|
||||
/* IDirect3DMaterial2 fields */
|
||||
union {
|
||||
IDirect3DImpl* d3d1;
|
||||
IDirect3D2Impl* d3d2;
|
||||
} d3d;
|
||||
union {
|
||||
IDirect3DDeviceImpl* active_device1;
|
||||
IDirect3DDevice2Impl* active_device2;
|
||||
} device;
|
||||
int use_d3d2;
|
||||
|
||||
D3DMATERIAL mat;
|
||||
|
||||
void (*activate)(IDirect3DMaterial2Impl* this);
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3DTexture2 implementation structure
|
||||
*/
|
||||
struct IDirect3DTexture2Impl
|
||||
{
|
||||
/* IUnknown fields */
|
||||
ICOM_VTABLE(IDirect3DTexture2)* lpvtbl;
|
||||
DWORD ref;
|
||||
/* IDirect3DTexture2 fields */
|
||||
void* D3Ddevice; /* I put (void *) to use the same pointer for both
|
||||
Direct3D and Direct3D2 */
|
||||
#ifdef HAVE_MESAGL
|
||||
GLuint tex_name;
|
||||
#endif
|
||||
IDirectDrawSurface4Impl* surface;
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3DViewport2 implementation structure
|
||||
*/
|
||||
struct IDirect3DViewport2Impl
|
||||
{
|
||||
/* IUnknown fields */
|
||||
ICOM_VTABLE(IDirect3DViewport2)* lpvtbl;
|
||||
DWORD ref;
|
||||
/* IDirect3DViewport2 fields */
|
||||
union {
|
||||
IDirect3DImpl* d3d1;
|
||||
IDirect3D2Impl* d3d2;
|
||||
} d3d;
|
||||
/* If this viewport is active for one device, put the device here */
|
||||
union {
|
||||
IDirect3DDeviceImpl* active_device1;
|
||||
IDirect3DDevice2Impl* active_device2;
|
||||
} device;
|
||||
int use_d3d2;
|
||||
|
||||
union {
|
||||
D3DVIEWPORT vp1;
|
||||
D3DVIEWPORT2 vp2;
|
||||
} viewport;
|
||||
int use_vp2;
|
||||
|
||||
/* Activation function */
|
||||
void (*activate)(IDirect3DViewport2Impl*);
|
||||
|
||||
/* Field used to chain viewports together */
|
||||
IDirect3DViewport2Impl* next;
|
||||
|
||||
/* Lights list */
|
||||
IDirect3DLightImpl* lights;
|
||||
|
||||
/* OpenGL code */
|
||||
#ifdef HAVE_MESAGL
|
||||
GLenum nextlight;
|
||||
#endif
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3DExecuteBuffer implementation structure
|
||||
*/
|
||||
struct IDirect3DExecuteBufferImpl
|
||||
{
|
||||
/* IUnknown fields */
|
||||
ICOM_VTABLE(IDirect3DExecuteBuffer)* lpvtbl;
|
||||
DWORD ref;
|
||||
/* IDirect3DExecuteBuffer fields */
|
||||
IDirect3DDeviceImpl* d3ddev;
|
||||
|
||||
D3DEXECUTEBUFFERDESC desc;
|
||||
D3DEXECUTEDATA data;
|
||||
|
||||
/* This buffer will store the transformed vertices */
|
||||
void* vertex_data;
|
||||
D3DVERTEXTYPE vertex_type;
|
||||
|
||||
/* This flags is set to TRUE if we allocated ourselves the
|
||||
data buffer */
|
||||
BOOL need_free;
|
||||
|
||||
void (*execute)(IDirect3DExecuteBuffer* this,
|
||||
IDirect3DDevice* dev,
|
||||
IDirect3DViewport2* vp);
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3DDevice implementation structure
|
||||
*/
|
||||
struct IDirect3DDeviceImpl
|
||||
{
|
||||
/* IUnknown fields */
|
||||
ICOM_VTABLE(IDirect3DDevice)* lpvtbl;
|
||||
DWORD ref;
|
||||
/* IDirect3DDevice fields */
|
||||
IDirect3DImpl* d3d;
|
||||
IDirectDrawSurfaceImpl* surface;
|
||||
|
||||
IDirect3DViewport2Impl* viewport_list;
|
||||
IDirect3DViewport2Impl* current_viewport;
|
||||
|
||||
void (*set_context)(IDirect3DDeviceImpl*);
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3DDevice2 implementation structure
|
||||
*/
|
||||
struct IDirect3DDevice2Impl
|
||||
{
|
||||
/* IUnknown fields */
|
||||
ICOM_VTABLE(IDirect3DDevice2)* lpvtbl;
|
||||
DWORD ref;
|
||||
/* IDirect3DDevice fields */
|
||||
IDirect3D2Impl* d3d;
|
||||
IDirectDrawSurfaceImpl* surface;
|
||||
|
||||
IDirect3DViewport2Impl* viewport_list;
|
||||
IDirect3DViewport2Impl* current_viewport;
|
||||
|
||||
void (*set_context)(IDirect3DDevice2Impl*);
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifdef HAVE_MESAGL
|
||||
|
||||
#include "d3d.h"
|
||||
|
||||
/* Matrix copy WITH transposition */
|
||||
#define conv_mat2(mat,gl_mat) \
|
||||
|
@ -105,23 +324,24 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
|
|||
#endif /* HAVE_MESAGL */
|
||||
|
||||
/* All non-static functions 'exported' by various sub-objects */
|
||||
extern LPDIRECT3DTEXTURE2 d3dtexture2_create(LPDIRECTDRAWSURFACE4 surf) ;
|
||||
extern LPDIRECT3DTEXTURE d3dtexture_create(LPDIRECTDRAWSURFACE4 surf) ;
|
||||
extern LPDIRECT3DTEXTURE2 d3dtexture2_create(IDirectDrawSurface4Impl* surf);
|
||||
extern LPDIRECT3DTEXTURE d3dtexture_create(IDirectDrawSurface4Impl* surf);
|
||||
|
||||
extern LPDIRECT3DLIGHT d3dlight_create_dx3(LPDIRECT3D d3d) ;
|
||||
extern LPDIRECT3DLIGHT d3dlight_create(LPDIRECT3D2 d3d) ;
|
||||
extern LPDIRECT3DLIGHT d3dlight_create_dx3(IDirect3DImpl* d3d1);
|
||||
extern LPDIRECT3DLIGHT d3dlight_create(IDirect3D2Impl* d3d2);
|
||||
|
||||
extern LPDIRECT3DEXECUTEBUFFER d3dexecutebuffer_create(LPDIRECT3DDEVICE d3ddev, LPD3DEXECUTEBUFFERDESC lpDesc) ;
|
||||
extern LPDIRECT3DEXECUTEBUFFER d3dexecutebuffer_create(IDirect3DDeviceImpl* d3ddev, LPD3DEXECUTEBUFFERDESC lpDesc);
|
||||
|
||||
extern LPDIRECT3DMATERIAL d3dmaterial_create(LPDIRECT3D d3d) ;
|
||||
extern LPDIRECT3DMATERIAL2 d3dmaterial2_create(LPDIRECT3D2 d3d) ;
|
||||
extern LPDIRECT3DMATERIAL d3dmaterial_create(IDirect3DImpl* d3d1);
|
||||
extern LPDIRECT3DMATERIAL2 d3dmaterial2_create(IDirect3D2Impl* d3d2);
|
||||
|
||||
extern LPDIRECT3DVIEWPORT d3dviewport_create(LPDIRECT3D d3d) ;
|
||||
extern LPDIRECT3DVIEWPORT2 d3dviewport2_create(LPDIRECT3D2 d3d) ;
|
||||
extern LPDIRECT3DVIEWPORT d3dviewport_create(IDirect3DImpl* d3d1);
|
||||
extern LPDIRECT3DVIEWPORT2 d3dviewport2_create(IDirect3D2Impl* d3d2);
|
||||
|
||||
extern int is_OpenGL_dx3(REFCLSID rguid, LPDIRECTDRAWSURFACE surface, LPDIRECT3DDEVICE *device) ;
|
||||
extern int is_OpenGL_dx3(REFCLSID rguid, IDirectDrawSurfaceImpl* surface, IDirect3DDeviceImpl** 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) ;
|
||||
extern int is_OpenGL(REFCLSID rguid, IDirectDrawSurfaceImpl* surface, IDirect3DDevice2Impl** device, IDirect3D2Impl* d3d);
|
||||
|
||||
#endif /* _WINE_D3D_PRIVATE_H */
|
||||
|
||||
#endif /* __GRAPHICS_WINE_D3D_PRIVATE_H */
|
||||
|
|
|
@ -0,0 +1,235 @@
|
|||
#ifndef __GRAPHICS_WINE_DDRAW_PRIVATE_H
|
||||
#define __GRAPHICS_WINE_DDRAW_PRIVATE_H
|
||||
|
||||
#include "ddraw.h"
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Predeclare the interface implementation structures
|
||||
*/
|
||||
typedef struct IDirectDrawPaletteImpl IDirectDrawPaletteImpl;
|
||||
typedef struct IDirectDrawClipperImpl IDirectDrawClipperImpl;
|
||||
typedef struct IDirectDrawImpl IDirectDrawImpl;
|
||||
typedef struct IDirectDraw2Impl IDirectDraw2Impl;
|
||||
typedef struct IDirectDraw4Impl IDirectDraw4Impl;
|
||||
typedef struct IDirectDrawSurfaceImpl IDirectDrawSurfaceImpl;
|
||||
typedef struct IDirectDrawSurface3Impl IDirectDrawSurface2Impl;
|
||||
typedef struct IDirectDrawSurface4Impl IDirectDrawSurface3Impl;
|
||||
typedef struct IDirectDrawSurface4Impl IDirectDrawSurface4Impl;
|
||||
typedef struct IDirectDrawColorControlImpl IDirectDrawColorControlImpl;
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirectDrawPalette implementation structure
|
||||
*/
|
||||
struct IDirectDrawPaletteImpl
|
||||
{
|
||||
/* IUnknown fields */
|
||||
ICOM_VTABLE(IDirectDrawPalette)* lpvtbl;
|
||||
DWORD ref;
|
||||
/* IDirectDrawPalette fields */
|
||||
IDirectDrawImpl* ddraw;
|
||||
Colormap cm;
|
||||
PALETTEENTRY palents[256];
|
||||
int installed;
|
||||
/* This is to store the palette in 'screen format' */
|
||||
int screen_palents[256];
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirectDrawClipper implementation structure
|
||||
*/
|
||||
struct IDirectDrawClipperImpl
|
||||
{
|
||||
/* IUnknown fields */
|
||||
ICOM_VTABLE(IDirectDrawClipper)* lpvtbl;
|
||||
DWORD ref;
|
||||
/* IDirectDrawClipper fields */
|
||||
/* none */
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirectDraw implementation structure
|
||||
*/
|
||||
struct _common_directdrawdata
|
||||
{
|
||||
DDPIXELFORMAT directdraw_pixelformat;
|
||||
DDPIXELFORMAT screen_pixelformat;
|
||||
int pixmap_depth;
|
||||
void (*pixel_convert)(void *src, void *dst, DWORD width, DWORD height, LONG pitch, IDirectDrawPaletteImpl* palette);
|
||||
void (*palette_convert)(LPPALETTEENTRY palent, void *screen_palette, DWORD start, DWORD count);
|
||||
DWORD height,width; /* SetDisplayMode */
|
||||
HWND mainWindow; /* SetCooperativeLevel */
|
||||
|
||||
/* This is for Wine's fake mainWindow.
|
||||
We need it also in DGA mode to make some games (for example Monkey Island III work) */
|
||||
ATOM winclass;
|
||||
HWND window;
|
||||
Window drawable;
|
||||
PAINTSTRUCT ps;
|
||||
int paintable;
|
||||
};
|
||||
|
||||
struct _dga_directdrawdata
|
||||
{
|
||||
DWORD fb_width,fb_height,fb_banksize,fb_memsize;
|
||||
void* fb_addr;
|
||||
unsigned int vpmask;
|
||||
};
|
||||
|
||||
struct _xlib_directdrawdata
|
||||
{
|
||||
#ifdef HAVE_LIBXXSHM
|
||||
int xshm_active;
|
||||
#endif /* defined(HAVE_LIBXXSHM) */
|
||||
|
||||
/* are these needed for anything? (draw_surf is the active surface)
|
||||
IDirectDrawSurfaceImpl* surfs;
|
||||
DWORD num_surfs, alloc_surfs, draw_surf; */
|
||||
};
|
||||
|
||||
struct IDirectDrawImpl
|
||||
{
|
||||
/* IUnknown fields */
|
||||
ICOM_VTABLE(IDirectDraw)* lpvtbl;
|
||||
DWORD ref;
|
||||
/* IDirectDraw fields */
|
||||
struct _common_directdrawdata d;
|
||||
union {
|
||||
struct _xlib_directdrawdata xlib;
|
||||
struct _dga_directdrawdata dga;
|
||||
} e;
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirectDraw2 implementation structure
|
||||
*/
|
||||
struct IDirectDraw2Impl
|
||||
{
|
||||
/* IUnknown fields */
|
||||
ICOM_VTABLE(IDirectDraw2)* lpvtbl;
|
||||
DWORD ref;
|
||||
/* IDirectDraw2 fields */
|
||||
struct _common_directdrawdata d;
|
||||
union {
|
||||
struct _xlib_directdrawdata xlib;
|
||||
struct _dga_directdrawdata dga;
|
||||
} e;
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirectDraw4 implementation structure
|
||||
*/
|
||||
struct IDirectDraw4Impl
|
||||
{
|
||||
/* IUnknown fields */
|
||||
ICOM_VTABLE(IDirectDraw4)* lpvtbl;
|
||||
DWORD ref;
|
||||
/* IDirectDraw4 fields */
|
||||
struct _common_directdrawdata d;
|
||||
union {
|
||||
struct _xlib_directdrawdata xlib;
|
||||
struct _dga_directdrawdata dga;
|
||||
} e;
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirectDrawSurface implementation structure
|
||||
*/
|
||||
struct _common_directdrawsurface
|
||||
{
|
||||
IDirectDrawPaletteImpl* palette;
|
||||
IDirectDraw2Impl* ddraw;
|
||||
IDirectDrawSurface4Impl* backbuffer;
|
||||
|
||||
DDSURFACEDESC surface_desc;
|
||||
};
|
||||
|
||||
struct _dga_directdrawsurface
|
||||
{
|
||||
DWORD fb_height;
|
||||
};
|
||||
|
||||
struct _xlib_directdrawsurface
|
||||
{
|
||||
XImage *image;
|
||||
#ifdef HAVE_LIBXXSHM
|
||||
XShmSegmentInfo shminfo;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct IDirectDrawSurfaceImpl
|
||||
{
|
||||
/* IUnknown fields */
|
||||
ICOM_VTABLE(IDirectDrawSurface)* lpvtbl;
|
||||
DWORD ref;
|
||||
/* IDirectDrawSurface fields */
|
||||
struct _common_directdrawsurface s;
|
||||
union {
|
||||
struct _dga_directdrawsurface dga;
|
||||
struct _xlib_directdrawsurface xlib;
|
||||
} t;
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirectDrawSurface2 implementation structure
|
||||
*/
|
||||
struct IDirectDrawSurface2Impl
|
||||
{
|
||||
/* IUnknown fields */
|
||||
ICOM_VTABLE(IDirectDrawSurface2)* lpvtbl;
|
||||
DWORD ref;
|
||||
/* IDirectDrawSurface2 fields */
|
||||
struct _common_directdrawsurface s;
|
||||
union {
|
||||
struct _dga_directdrawsurface dga;
|
||||
struct _xlib_directdrawsurface xlib;
|
||||
} t;
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirectDrawSurface3 implementation structure
|
||||
*/
|
||||
struct IDirectDrawSurface3Impl
|
||||
{
|
||||
/* IUnknown fields */
|
||||
ICOM_VTABLE(IDirectDrawSurface3)* lpvtbl;
|
||||
DWORD ref;
|
||||
/* IDirectDrawSurface3 fields */
|
||||
struct _common_directdrawsurface s;
|
||||
union {
|
||||
struct _dga_directdrawsurface dga;
|
||||
struct _xlib_directdrawsurface xlib;
|
||||
} t;
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirectDrawSurface4 implementation structure
|
||||
*/
|
||||
struct IDirectDrawSurface4Impl
|
||||
{
|
||||
/* IUnknown fields */
|
||||
ICOM_VTABLE(IDirectDrawSurface4)* lpvtbl;
|
||||
DWORD ref;
|
||||
/* IDirectDrawSurface4 fields */
|
||||
struct _common_directdrawsurface s;
|
||||
union {
|
||||
struct _dga_directdrawsurface dga;
|
||||
struct _xlib_directdrawsurface xlib;
|
||||
} t;
|
||||
} ;
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirectDrawColorControl implementation structure
|
||||
*/
|
||||
struct IDirectDrawColorControlImpl
|
||||
{
|
||||
/* IUnknown fields */
|
||||
ICOM_VTABLE(IDirectDrawColorControl)* lpvtbl;
|
||||
DWORD ref;
|
||||
/* IDirectDrawColorControl fields */
|
||||
/* none */
|
||||
};
|
||||
|
||||
|
||||
#endif /* __GRAPHICS_WINE_DDRAW_PRIVATE_H */
|
Loading…
Reference in New Issue