/*
* Copyright (C) the Wine project
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/*
* Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
* other than GPL or LGPL is available it will apply instead, Oracle elects to use only
* the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
* a choice of LGPL license versions is made available with the language indicating
* that LGPLv2 or any later version may be used, or where a choice of which version
* of the LGPL is applied is otherwise unspecified.
*/
#ifndef __DDRAW_INCLUDED__
#define __DDRAW_INCLUDED__
#define COM_NO_WINDOWS_H
#include <objbase.h>
#ifdef __cplusplus
extern "C" {
#endif /* defined(__cplusplus) */
#ifndef DIRECTDRAW_VERSION
#endif /* DIRECTDRAW_VERSION */
/*****************************************************************************
* Predeclare the interfaces
*/
#ifndef __DDRAW_GUID_DEFINED__
DEFINE_GUID( CLSID_DirectDrawClipper, 0x593817A0,0x7DB3,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xb9,0x33,0x56 );
DEFINE_GUID( IID_IDirectDrawSurface, 0x6C14DB81,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
DEFINE_GUID( IID_IDirectDrawSurface2, 0x57805885,0x6eec,0x11cf,0x94,0x41,0xa8,0x23,0x03,0xc1,0x0e,0x27 );
DEFINE_GUID( IID_IDirectDrawSurface3, 0xDA044E00,0x69B2,0x11D0,0xA1,0xD5,0x00,0xAA,0x00,0xB8,0xDF,0xBB );
DEFINE_GUID( IID_IDirectDrawSurface4, 0x0B2B8630,0xAD35,0x11D0,0x8E,0xA6,0x00,0x60,0x97,0x97,0xEA,0x5B );
DEFINE_GUID( IID_IDirectDrawSurface7, 0x06675a80,0x3b9b,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b );
DEFINE_GUID( IID_IDirectDrawPalette, 0x6C14DB84,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
DEFINE_GUID( IID_IDirectDrawClipper, 0x6C14DB85,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
DEFINE_GUID( IID_IDirectDrawColorControl,0x4B9F0EE0,0x0D7E,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8 );
DEFINE_GUID( IID_IDirectDrawGammaControl,0x69C11C3E,0xB46B,0x11D1,0xAD,0x7A,0x00,0xC0,0x4F,0xC2,0x9B,0x4E );
#endif
#define DDENUMRET_CANCEL 0
/* dwFlags for Blt* */
/* dwTrans for BltFast */
/* dwFlags for Flip */
/* dwFlags for GetBltStatus */
/* dwFlags for IDirectDrawSurface7::GetFlipStatus */
/* dwFlags for IDirectDrawSurface7::SetPrivateData */
/* DDSCAPS.dwCaps */
/* reserved1, was 3d capable */
/* surface contains alpha information */
/* this surface is a backbuffer */
/* complex surface structure */
/* part of surface flipping structure */
/* this surface is the frontbuffer surface */
/* this is a plain offscreen surface */
/* overlay */
/* palette objects can be created and attached to us */
/* primary surface (the one the user looks at currently)(right eye)*/
/* primary surface for left eye */
/* surface exists in systemmemory */
/* surface can be used as a texture */
/* surface may be destination for 3d rendering */
/* surface exists in videomemory */
/* surface changes immediately visible */
/* write only surface */
/* zbuffer surface */
/* has its own DC */
/* surface should be able to receive live video */
/* should be able to have a hw codec decompress stuff into it */
/* mode X (320x200 or 320x240) surface */
/* one mipmap surface (1 level) */
/* memory allocation delayed until Load() */
/* Indicates that the surface will receive data from a video port */
/* surface is in local videomemory */
/* surface is in nonlocal videomemory */
/* surface is a standard VGA mode surface (NOT ModeX) */
/* optimized? surface */
typedef struct _DDSCAPS {
/* DDSCAPS2.dwCaps2 */
/* indicates the surface will receive data from a video port using
deinterlacing hardware. */
/* indicates the surface will be locked very frequently. */
/* indicates surface can be re-ordered or retiled on load() */
/* indicates surface to be managed by directdraw/direct3D */
/* reserved bits */
/* indicates surface will never be locked again */
/* set at CreateSurface() time to indicate antialiasing will be used */
/* set at CreateSurface() time to indicate cubic environment map */
/* face flags for cube maps */
/* specifies all faces of a cube for CreateSurface() */
/* set for mipmap sublevels on DirectX7 and later. ignored by CreateSurface() */
/* indicates texture surface to be managed by Direct3D *only* */
/* indicates managed surface that can safely be lost */
/* indicates surface is part of a stereo flipping chain */
typedef struct _DDSCAPS2 {
{
DWORD dwMinOverlayStretch; /* minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
DWORD dwMaxOverlayStretch; /* maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
DWORD dwMinLiveVideoStretch; /* minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
DWORD dwMaxLiveVideoStretch; /* maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
DWORD dwMinHwCodecStretch; /* minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
DWORD dwMaxHwCodecStretch; /* maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
{
DWORD dwMinOverlayStretch; /* minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
DWORD dwMaxOverlayStretch; /* maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
DWORD dwMinLiveVideoStretch; /* minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
DWORD dwMaxLiveVideoStretch; /* maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
DWORD dwMinHwCodecStretch; /* minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
DWORD dwMaxHwCodecStretch; /* maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
/* and one new member for DirectX 6 */
{
DWORD dwMinOverlayStretch; /* minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
DWORD dwMaxOverlayStretch; /* maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
DWORD dwMinLiveVideoStretch; /* minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
DWORD dwMaxLiveVideoStretch; /* maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
DWORD dwMinHwCodecStretch; /* minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
DWORD dwMaxHwCodecStretch; /* maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
/* the following are the new DirectX 5 members */
{
DWORD dwMinOverlayStretch; /* minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
DWORD dwMaxOverlayStretch; /* maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
DWORD dwMinLiveVideoStretch; /* minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
DWORD dwMaxLiveVideoStretch; /* maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
DWORD dwMinHwCodecStretch; /* minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
DWORD dwMaxHwCodecStretch; /* maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
/* set caps struct according to DIRECTDRAW_VERSION */
#if DIRECTDRAW_VERSION <= 0x300
#else
#endif
/* DDCAPS.dwCaps */
/* DDCAPS.dwCaps2 */
typedef struct _DDCOLORKEY
{
* be treated as Color Key, inclusive
*/
* to be treated as Color Key, inclusive
*/
/* ddCKEYCAPS bits */
typedef struct _DDPIXELFORMAT {
union {
union {
union {
union {
union {
/* 20: next structure */
/* DDCAPS.dwFXCaps */
/* DDCAPS.dwFXAlphaCaps */
/* DDCAPS.dwPalCaps */
/* DDCAPS.dwSVCaps */
/* the first 4 of these are now obsolete */
#else
#endif
/* BitDepths */
/* DDOVERLAYFX.dwDDFX */
/* UpdateOverlay flags */
/* DDPIXELFORMAT.dwFlags */
/* SetCooperativeLevel dwFlags */
/* DDSURFACEDESC.dwFlags */
/* EnumSurfaces flags */
/* SetDisplayMode flags */
/* EnumDisplayModes flags */
/* WaitForVerticalDisplay flags */
typedef struct _DDSURFACEDESC
{
union {
union {
typedef struct _DDSURFACEDESC2
{
union {
union {
union {
union {
/* DDCOLORCONTROL.dwFlags */
typedef struct {
typedef struct {
typedef BOOL (CALLBACK *LPDDENUMCALLBACKA)(GUID *guid, char *driver_description, char *driver_name, void *ctx);
typedef BOOL (CALLBACK *LPDDENUMCALLBACKW)(GUID *guid, WCHAR *driver_description, WCHAR *driver_name, void *ctx);
typedef HRESULT (WINAPI * LPDIRECTDRAWENUMERATEEXA)(LPDDENUMCALLBACKEXA cb, void *ctx, DWORD flags);
typedef HRESULT (WINAPI * LPDIRECTDRAWENUMERATEEXW)(LPDDENUMCALLBACKEXW cb, void *ctx, DWORD flags);
/* flags for DirectDrawEnumerateEx */
/* flags for DirectDrawCreate or IDirectDraw::Initialize */
typedef struct _DDBLTFX
{
union
{
union
{
union
{
union
{
union
{
/* dwDDFX */
/* arithmetic stretching along y axis */
/* mirror on y axis */
/* mirror on x axis */
/* do not tear */
/* 180 degrees clockwise rotation */
/* 270 degrees clockwise rotation */
/* 90 degrees clockwise rotation */
/* dwZBufferLow and dwZBufferHigh specify limits to the copied Z values */
/* add dwZBufferBaseDest to every source z value before compare */
typedef struct _DDOVERLAYFX
{
union
{
union
{
typedef struct _DDBLTBATCH
{
typedef struct tagDDDEVICEIDENTIFIER {
typedef struct tagDDDEVICEIDENTIFIER2 {
/*****************************************************************************
* IDirectDrawPalette interface
*/
{
/*** IUnknown methods ***/
/*** IDirectDrawPalette methods ***/
STDMETHOD(GetEntries)(THIS_ DWORD dwFlags, DWORD dwBase, DWORD dwNumEntries, LPPALETTEENTRY lpEntries) PURE;
STDMETHOD(Initialize)(THIS_ struct IDirectDraw *ddraw, DWORD flags, PALETTEENTRY *color_table) PURE;
STDMETHOD(SetEntries)(THIS_ DWORD dwFlags, DWORD dwStartingEntry, DWORD dwCount, LPPALETTEENTRY lpEntries) PURE;
};
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
/*** IDirectDrawPalette methods ***/
#else
/*** IUnknown methods ***/
/*** IDirectDrawPalette methods ***/
#endif
/*****************************************************************************
* IDirectDrawClipper interface
*/
{
/*** IUnknown methods ***/
/*** IDirectDrawClipper methods ***/
};
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
/*** IDirectDrawClipper methods ***/
#else
/*** IUnknown methods ***/
/*** IDirectDrawClipper methods ***/
#endif
/*****************************************************************************
* IDirectDraw interface
*/
{
/*** IUnknown methods ***/
/*** IDirectDraw methods ***/
};
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
/*** IDirectDraw methods ***/
#else
/*** IUnknown methods ***/
/*** IDirectDraw methods ***/
#endif
/* flags for Lock() */
/*****************************************************************************
* IDirectDraw2 interface
*/
/* Note: IDirectDraw2 cannot derive from IDirectDraw because the number of
* arguments of SetDisplayMode has changed !
*/
{
/*** IUnknown methods ***/
/*** IDirectDraw2 methods ***/
/*10*/ STDMETHOD(CreateClipper)(THIS_ DWORD flags, IDirectDrawClipper **clipper, IUnknown *outer) PURE;
/*54*/ STDMETHOD(SetDisplayMode)(THIS_ DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags) PURE;
/* added in v2 */
};
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
/*** IDirectDraw methods ***/
/*** IDirectDraw2 methods ***/
#else
/*** IUnknown methods ***/
/*** IDirectDraw methods ***/
/*** IDirectDraw2 methods ***/
#endif
/*****************************************************************************
* IDirectDraw3 interface
*/
{
/*** IUnknown methods ***/
/*** IDirectDraw2 methods ***/
/*10*/ STDMETHOD(CreateClipper)(THIS_ DWORD flags, IDirectDrawClipper **clipper, IUnknown *outer) PURE;
/*54*/ STDMETHOD(SetDisplayMode)(THIS_ DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags) PURE;
/* added in v2 */
/* added in v3 */
};
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
/*** IDirectDraw methods ***/
/*** IDirectDraw2 methods ***/
/*** IDirectDraw3 methods ***/
#else
/*** IUnknown methods ***/
/*** IDirectDraw methods ***/
/*** IDirectDraw2 methods ***/
/*** IDirectDraw3 methods ***/
#endif
/*****************************************************************************
* IDirectDraw4 interface
*/
{
/*** IUnknown methods ***/
/*** IDirectDraw4 methods ***/
/*10*/ STDMETHOD(CreateClipper)(THIS_ DWORD flags, IDirectDrawClipper **clipper, IUnknown *outer) PURE;
/*54*/ STDMETHOD(SetDisplayMode)(THIS_ DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags) PURE;
/* added in v2 */
/* added in v4 */
};
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
/*** IDirectDraw methods ***/
/*** IDirectDraw2 methods ***/
/*** IDirectDraw4 methods ***/
#else
/*** IUnknown methods ***/
/*** IDirectDraw methods ***/
/*** IDirectDraw2 methods ***/
/*** IDirectDraw4 methods ***/
#endif
/*****************************************************************************
* IDirectDraw7 interface
*/
/* Note: IDirectDraw7 cannot derive from IDirectDraw4; it is even documented
* as not interchangeable with earlier DirectDraw interfaces.
*/
{
/*** IUnknown methods ***/
/*** IDirectDraw7 methods ***/
/*10*/ STDMETHOD(CreateClipper)(THIS_ DWORD flags, IDirectDrawClipper **clipper, IUnknown *outer) PURE;
/*54*/ STDMETHOD(SetDisplayMode)(THIS_ DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags) PURE;
/* added in v2 */
/* added in v4 */
/* added in v7 */
};
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
/*** IDirectDraw methods ***/
/*** added in IDirectDraw2 ***/
/*** added in IDirectDraw4 ***/
/*** added in IDirectDraw 7 ***/
#else
/*** IUnknown methods ***/
/*** IDirectDraw methods ***/
/*** added in IDirectDraw2 ***/
/*** added in IDirectDraw4 ***/
/*** added in IDirectDraw 7 ***/
#endif
/*****************************************************************************
* IDirectDrawSurface interface
*/
{
/*** IUnknown methods ***/
/*** IDirectDrawSurface methods ***/
/*28*/ STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD flags, void *ctx, LPDDENUMSURFACESCALLBACK cb) PURE;
/*64*/ STDMETHOD(Lock)(THIS_ RECT *rect, DDSURFACEDESC *surface_desc, DWORD flags, HANDLE event) PURE;
/*8c*/ STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD flags, IDirectDrawSurface *reference_surface) PURE;
};
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
/*** IDirectDrawSurface methods ***/
#else
/*** IUnknown methods ***/
/*** IDirectDrawSurface methods ***/
#endif
/*****************************************************************************
* IDirectDrawSurface2 interface
*/
/* Cannot inherit from IDirectDrawSurface because the LPDIRECTDRAWSURFACE parameters
* have been converted to LPDIRECTDRAWSURFACE2.
*/
{
/*** IUnknown methods ***/
/*** IDirectDrawSurface2 methods ***/
/* added in v2 */
};
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
/*** IDirectDrawSurface methods (almost) ***/
/*** IDirectDrawSurface2 methods ***/
#else
/*** IUnknown methods ***/
/*** IDirectDrawSurface methods (almost) ***/
/*** IDirectDrawSurface2 methods ***/
#endif
/*****************************************************************************
* IDirectDrawSurface3 interface
*/
/* Cannot inherit from IDirectDrawSurface2 because the LPDIRECTDRAWSURFACE2 parameters
* have been converted to LPDIRECTDRAWSURFACE3.
*/
{
/*** IUnknown methods ***/
/*** IDirectDrawSurface3 methods ***/
/* added in v2 */
/* added in v3 */
};
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
/*** IDirectDrawSurface methods (almost) ***/
/*** IDirectDrawSurface2 methods ***/
/*** IDirectDrawSurface3 methods ***/
#else
/*** IUnknown methods ***/
/*** IDirectDrawSurface methods (almost) ***/
/*** IDirectDrawSurface2 methods ***/
/*** IDirectDrawSurface3 methods ***/
#endif
/*****************************************************************************
* IDirectDrawSurface4 interface
*/
/* Cannot inherit from IDirectDrawSurface2 because DDSCAPS changed to DDSCAPS2.
*/
{
/*** IUnknown methods ***/
/*** IDirectDrawSurface4 methods ***/
/* added in v2 */
/* added in v3 */
/* added in v4 */
};
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
/*** IDirectDrawSurface (almost) methods ***/
/*** IDirectDrawSurface2 methods ***/
/*** IDirectDrawSurface3 methods ***/
/*** IDirectDrawSurface4 methods ***/
#else
/*** IUnknown methods ***/
/*** IDirectDrawSurface (almost) methods ***/
/*** IDirectDrawSurface2 methods ***/
/*** IDirectDrawSurface3 methods ***/
/*** IDirectDrawSurface4 methods ***/
#endif
/*****************************************************************************
* IDirectDrawSurface7 interface
*/
{
/*** IUnknown methods ***/
/*** IDirectDrawSurface7 methods ***/
/* added in v2 */
/* added in v3 */
/* added in v4 */
/* added in v7 */
};
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
/*** IDirectDrawSurface (almost) methods ***/
/*** IDirectDrawSurface2 methods ***/
/*** IDirectDrawSurface3 methods ***/
/*** IDirectDrawSurface4 methods ***/
/*** IDirectDrawSurface7 methods ***/
#else
/*** IUnknown methods ***/
/*** IDirectDrawSurface (almost) methods ***/
/*** IDirectDrawSurface2 methods ***/
/*** IDirectDrawSurface3 methods ***/
/*** IDirectDrawSurface4 methods ***/
/*** IDirectDrawSurface7 methods ***/
#endif
/*****************************************************************************
* IDirectDrawColorControl interface
*/
{
/*** IUnknown methods ***/
/*** IDirectDrawColorControl methods ***/
};
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
/*** IDirectDrawColorControl methods ***/
#else
/*** IUnknown methods ***/
/*** IDirectDrawColorControl methods ***/
#endif
/*****************************************************************************
* IDirectDrawGammaControl interface
*/
{
/*** IUnknown methods ***/
/*** IDirectDrawGammaControl methods ***/
};
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
/*** IDirectDrawGammaControl methods ***/
#else
/*** IUnknown methods ***/
/*** IDirectDrawGammaControl methods ***/
#endif
HRESULT WINAPI DirectDrawCreateEx(GUID *driver_guid, void **ddraw, REFIID interface_iid, IUnknown *outer);
#ifdef __cplusplus
} /* extern "C" */
#endif /* defined(__cplusplus) */
#endif /* __DDRAW_INCLUDED__ */