1999-03-27 16:53:09 +00:00
|
|
|
#ifndef __GRAPHICS_WINE_DDRAW_PRIVATE_H
|
|
|
|
#define __GRAPHICS_WINE_DDRAW_PRIVATE_H
|
|
|
|
|
1999-12-04 04:22:04 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#ifdef HAVE_LIBXXF86DGA2
|
|
|
|
#include "ts_xf86dga2.h"
|
|
|
|
#endif /* defined(HAVE_LIBXXF86DGA2) */
|
|
|
|
|
1999-03-27 16:53:09 +00:00
|
|
|
#include "ddraw.h"
|
1999-05-08 12:50:36 +00:00
|
|
|
#include "winuser.h"
|
1999-03-27 16:53:09 +00:00
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* 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;
|
|
|
|
|
1999-04-06 07:10:48 +00:00
|
|
|
#include "d3d_private.h"
|
1999-03-27 16:53:09 +00:00
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* IDirectDrawPalette implementation structure
|
|
|
|
*/
|
|
|
|
struct IDirectDrawPaletteImpl
|
|
|
|
{
|
|
|
|
/* IUnknown fields */
|
1999-10-31 01:59:23 +00:00
|
|
|
ICOM_VFIELD(IDirectDrawPalette);
|
1999-03-27 16:53:09 +00:00
|
|
|
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 */
|
1999-10-31 01:59:23 +00:00
|
|
|
ICOM_VFIELD(IDirectDrawClipper);
|
1999-03-27 16:53:09 +00:00
|
|
|
DWORD ref;
|
1999-12-04 03:55:58 +00:00
|
|
|
|
1999-03-27 16:53:09 +00:00
|
|
|
/* IDirectDrawClipper fields */
|
1999-12-04 03:55:58 +00:00
|
|
|
HWND hWnd;
|
1999-03-27 16:53:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* 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
|
|
|
|
{
|
1999-12-04 04:22:04 +00:00
|
|
|
DWORD fb_width,fb_height,fb_memsize;
|
1999-03-27 16:53:09 +00:00
|
|
|
void* fb_addr;
|
|
|
|
unsigned int vpmask;
|
1999-12-04 04:22:04 +00:00
|
|
|
#ifdef HAVE_LIBXXF86DGA2
|
|
|
|
int version;
|
|
|
|
XDGADevice *dev;
|
1999-12-20 03:45:54 +00:00
|
|
|
XDGAMode *modes;
|
|
|
|
int num_modes;
|
1999-12-04 04:22:04 +00:00
|
|
|
#endif /* define(HAVE_LIBXXF86DGA2) */
|
1999-03-27 16:53:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _xlib_directdrawdata
|
|
|
|
{
|
|
|
|
#ifdef HAVE_LIBXXSHM
|
1999-11-07 22:44:06 +00:00
|
|
|
int xshm_active, xshm_compl;
|
1999-03-27 16:53:09 +00:00
|
|
|
#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 */
|
1999-10-31 01:59:23 +00:00
|
|
|
ICOM_VFIELD(IDirectDraw);
|
1999-03-27 16:53:09 +00:00
|
|
|
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 */
|
1999-10-31 01:59:23 +00:00
|
|
|
ICOM_VFIELD(IDirectDraw2);
|
1999-03-27 16:53:09 +00:00
|
|
|
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 */
|
1999-10-31 01:59:23 +00:00
|
|
|
ICOM_VFIELD(IDirectDraw4);
|
1999-03-27 16:53:09 +00:00
|
|
|
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;
|
1999-07-03 11:57:29 +00:00
|
|
|
|
|
|
|
struct _surface_chain *chain;
|
1999-03-27 16:53:09 +00:00
|
|
|
|
|
|
|
DDSURFACEDESC surface_desc;
|
1999-04-06 07:10:48 +00:00
|
|
|
|
1999-05-29 11:00:27 +00:00
|
|
|
/* For Get / Release DC methods */
|
|
|
|
HBITMAP DIBsection;
|
|
|
|
void *bitmap_data;
|
|
|
|
HDC hdc;
|
|
|
|
HGDIOBJ holdbitmap;
|
|
|
|
|
1999-04-06 07:10:48 +00:00
|
|
|
/* Callback for loaded textures */
|
|
|
|
IDirect3DTexture2Impl* texture;
|
|
|
|
HRESULT WINAPI (*SetColorKey_cb)(IDirect3DTexture2Impl *texture, DWORD dwFlags, LPDDCOLORKEY ckey ) ;
|
1999-05-13 18:53:05 +00:00
|
|
|
|
|
|
|
/* Storage for attached device (void * as it can be either a Device or a Device2) */
|
|
|
|
void *d3d_device;
|
1999-12-05 02:19:56 +00:00
|
|
|
|
|
|
|
LPDIRECTDRAWCLIPPER lpClipper;
|
1999-03-27 16:53:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _dga_directdrawsurface
|
|
|
|
{
|
|
|
|
DWORD fb_height;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _xlib_directdrawsurface
|
|
|
|
{
|
|
|
|
XImage *image;
|
|
|
|
#ifdef HAVE_LIBXXSHM
|
|
|
|
XShmSegmentInfo shminfo;
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
struct IDirectDrawSurfaceImpl
|
|
|
|
{
|
|
|
|
/* IUnknown fields */
|
1999-10-31 01:59:23 +00:00
|
|
|
ICOM_VFIELD(IDirectDrawSurface);
|
1999-03-27 16:53:09 +00:00
|
|
|
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 */
|
1999-10-31 01:59:23 +00:00
|
|
|
ICOM_VFIELD(IDirectDrawSurface2);
|
1999-03-27 16:53:09 +00:00
|
|
|
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 */
|
1999-10-31 01:59:23 +00:00
|
|
|
ICOM_VFIELD(IDirectDrawSurface3);
|
1999-03-27 16:53:09 +00:00
|
|
|
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 */
|
1999-10-31 01:59:23 +00:00
|
|
|
ICOM_VFIELD(IDirectDrawSurface4);
|
1999-03-27 16:53:09 +00:00
|
|
|
DWORD ref;
|
1999-12-04 03:55:58 +00:00
|
|
|
|
1999-03-27 16:53:09 +00:00
|
|
|
/* IDirectDrawSurface4 fields */
|
|
|
|
struct _common_directdrawsurface s;
|
|
|
|
union {
|
|
|
|
struct _dga_directdrawsurface dga;
|
|
|
|
struct _xlib_directdrawsurface xlib;
|
|
|
|
} t;
|
|
|
|
} ;
|
|
|
|
|
1999-07-03 11:57:29 +00:00
|
|
|
struct _surface_chain {
|
|
|
|
IDirectDrawSurface4Impl **surfaces;
|
|
|
|
int nrofsurfaces;
|
|
|
|
};
|
|
|
|
|
1999-03-27 16:53:09 +00:00
|
|
|
/*****************************************************************************
|
|
|
|
* IDirectDrawColorControl implementation structure
|
|
|
|
*/
|
|
|
|
struct IDirectDrawColorControlImpl
|
|
|
|
{
|
|
|
|
/* IUnknown fields */
|
1999-10-31 01:59:23 +00:00
|
|
|
ICOM_VFIELD(IDirectDrawColorControl);
|
1999-03-27 16:53:09 +00:00
|
|
|
DWORD ref;
|
|
|
|
/* IDirectDrawColorControl fields */
|
|
|
|
/* none */
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* __GRAPHICS_WINE_DDRAW_PRIVATE_H */
|