19#ifndef __WINE_DLLS_DDRAW_DDRAW_PRIVATE_H
20#define __WINE_DLLS_DDRAW_DDRAW_PRIVATE_H
25#define NONAMELESSSTRUCT
26#define NONAMELESSUNION
54#define DDRAW_INITIALIZED 0x00000001
55#define DDRAW_D3D_INITIALIZED 0x00000002
56#define DDRAW_RESTORE_MODE 0x00000004
57#define DDRAW_NO3D 0x00000008
58#define DDRAW_SCL_DDRAW1 0x00000010
59#define DDRAW_SCL_RECURSIVE 0x00000020
60#define DDRAW_GDI_FLIP 0x00000040
62#define DDRAW_STRIDE_ALIGNMENT 8
64#define DDRAW_WINED3D_FLAGS (WINED3D_LEGACY_DEPTH_BIAS | WINED3D_VIDMEM_ACCOUNTING \
65 | WINED3D_RESTORE_MODE_ON_ACTIVATE | WINED3D_FOCUS_MESSAGES | WINED3D_PIXEL_CENTER_INTEGER \
66 | WINED3D_LEGACY_UNBOUND_RESOURCE_COLOR | WINED3D_NO_PRIMITIVE_RESTART \
67 | WINED3D_LEGACY_CUBEMAP_FILTERING | WINED3D_LIMIT_VIEWPORT)
128#define DDRAW_WINDOW_CLASS_NAME "DirectDrawDeviceWnd"
183#define MAX_COMPLEX_ATTACHED 6
265#define DDRAW_INVALID_HANDLE ~0U
579#define GET_TEXCOUNT_FROM_FVF(d3dvtVertexType) \
580 (((d3dvtVertexType) & D3DFVF_TEXCOUNT_MASK) >> D3DFVF_TEXCOUNT_SHIFT)
582#define GET_TEXCOORD_SIZE_FROM_FVF(d3dvtVertexType, tex_num) \
583 (((((d3dvtVertexType) >> (16 + (2 * (tex_num)))) + 1) & 0x03) + 1)
623#define FE(x) { x, #x }
634#define ME(x,f,e) { x, #x, (void (*)(const void *))(f), offsetof(STRUCT, e) }
636#define DD_STRUCT_COPY_BYSIZE_(to,from,to_size,from_size) \
638 DWORD __size = (to)->dwSize; \
639 DWORD __resetsize = min(to_size, sizeof(*to)); \
640 DWORD __copysize = min(__resetsize, from_size); \
641 assert(to != from); \
642 memcpy(to, from, __copysize); \
643 memset((char*)(to) + __copysize, 0, __resetsize - __copysize); \
644 (to)->dwSize = __size; \
647#define DD_STRUCT_COPY_BYSIZE(to,from) DD_STRUCT_COPY_BYSIZE_(to,from,(to)->dwSize,(from)->dwSize)
#define D3DMAXUSERCLIPPLANES
void DDSD_to_DDSD2(const DDSURFACEDESC *in, DDSURFACEDESC2 *out) DECLSPEC_HIDDEN
HRESULT ddraw_clipper_init(struct ddraw_clipper *clipper) DECLSPEC_HIDDEN
void DDRAW_dump_surface_desc(const DDSURFACEDESC2 *lpddsd) DECLSPEC_HIDDEN
struct ddraw_clipper * unsafe_impl_from_IDirectDrawClipper(IDirectDrawClipper *iface) DECLSPEC_HIDDEN
void DDRAW_dump_DDCAPS(const DDCAPS *lpcaps) DECLSPEC_HIDDEN
void DDRAW_Convert_DDSCAPS_1_To_2(const DDSCAPS *pIn, DDSCAPS2 *pOut) DECLSPEC_HIDDEN
struct ddraw_surface * unsafe_impl_from_IDirectDrawSurface7(IDirectDrawSurface7 *iface) DECLSPEC_HIDDEN
BOOL wined3d_colour_from_ddraw_colour(const DDPIXELFORMAT *pf, const struct ddraw_palette *palette, DWORD colour, struct wined3d_color *wined3d_colour) DECLSPEC_HIDDEN
static struct ddraw_surface * impl_from_IDirectDrawSurface3(IDirectDrawSurface3 *iface)
struct d3d_viewport * unsafe_impl_from_IDirect3DViewport3(IDirect3DViewport3 *iface) DECLSPEC_HIDDEN
static struct ddraw_surface * impl_from_IDirectDrawSurface4(IDirectDrawSurface4 *iface)
HRESULT ddraw_surface_update_frontbuffer(struct ddraw_surface *surface, const RECT *rect, BOOL read) DECLSPEC_HIDDEN
@ DDRAW_DEVICE_STATE_LOST
@ DDRAW_DEVICE_STATE_NOT_RESTORED
struct d3d_device * unsafe_impl_from_IDirect3DDevice7(IDirect3DDevice7 *iface) DECLSPEC_HIDDEN
struct ddraw_surface * unsafe_impl_from_IDirectDrawSurface4(IDirectDrawSurface4 *iface) DECLSPEC_HIDDEN
HRESULT d3d_execute_buffer_init(struct d3d_execute_buffer *execute_buffer, struct d3d_device *device, D3DEXECUTEBUFFERDESC *desc) DECLSPEC_HIDDEN
struct d3d_device * unsafe_impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface) DECLSPEC_HIDDEN
static struct ddraw_palette * impl_from_IDirectDrawPalette(IDirectDrawPalette *iface)
static struct ddraw_surface * impl_from_IDirectDrawSurface(IDirectDrawSurface *iface)
void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, const struct wined3d_parent_ops **parent_ops) DECLSPEC_HIDDEN
void * ddraw_free_handle(struct ddraw_handle_table *t, DWORD handle, enum ddraw_handle_type type) DECLSPEC_HIDDEN
static BOOL format_is_compressed(const DDPIXELFORMAT *format)
DWORD ddraw_allocate_handle(struct ddraw_handle_table *t, void *object, enum ddraw_handle_type type) DECLSPEC_HIDDEN
DWORD get_flexible_vertex_size(DWORD d3dvtVertexType) DECLSPEC_HIDDEN
#define MAX_COMPLEX_ATTACHED
void multiply_matrix(D3DMATRIX *dst, const D3DMATRIX *src1, const D3DMATRIX *src2) DECLSPEC_HIDDEN
void DDRAW_Convert_DDDEVICEIDENTIFIER_2_To_1(const DDDEVICEIDENTIFIER2 *pIn, DDDEVICEIDENTIFIER *pOut) DECLSPEC_HIDDEN
struct wined3d_rendertarget_view * ddraw_surface_get_rendertarget_view(struct ddraw_surface *surface) DECLSPEC_HIDDEN
static struct ddraw_surface * impl_from_IDirectDrawSurface2(IDirectDrawSurface2 *iface)
void d3d_light_init(struct d3d_light *light, struct ddraw *ddraw) DECLSPEC_HIDDEN
void ddrawformat_from_wined3dformat(DDPIXELFORMAT *ddraw_format, enum wined3d_format_id wined3d_format) DECLSPEC_HIDDEN
HRESULT d3d_device_create(struct ddraw *ddraw, const GUID *guid, struct ddraw_surface *target, IUnknown *rt_iface, UINT version, struct d3d_device **device, IUnknown *outer_unknown) DECLSPEC_HIDDEN
static BOOL format_is_paletteindexed(const DDPIXELFORMAT *fmt)
void d3d_viewport_init(struct d3d_viewport *viewport, struct ddraw *ddraw) DECLSPEC_HIDDEN
struct d3d_device * unsafe_impl_from_IDirect3DDevice(IDirect3DDevice *iface) DECLSPEC_HIDDEN
struct wined3d_vertex_declaration * ddraw_find_decl(struct ddraw *ddraw, DWORD fvf) DECLSPEC_HIDDEN
void ddraw_handle_table_destroy(struct ddraw_handle_table *t) DECLSPEC_HIDDEN
enum wined3d_depth_buffer_type d3d_device_update_depth_stencil(struct d3d_device *device) DECLSPEC_HIDDEN
struct d3d_device * unsafe_impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface) DECLSPEC_HIDDEN
struct ddraw_palette * unsafe_impl_from_IDirectDrawPalette(IDirectDrawPalette *iface) DECLSPEC_HIDDEN
static struct d3d_device * impl_from_IDirect3DDevice7(IDirect3DDevice7 *iface)
void DDSD2_to_DDSD(const DDSURFACEDESC2 *in, DDSURFACEDESC *out) DECLSPEC_HIDDEN
struct d3d_viewport * unsafe_impl_from_IDirect3DViewport2(IDirect3DViewport2 *iface) DECLSPEC_HIDDEN
HRESULT hr_ddraw_from_wined3d(HRESULT hr) DECLSPEC_HIDDEN
void ddraw_update_lost_surfaces(struct ddraw *ddraw) DECLSPEC_HIDDEN
unsigned int wined3dmapflags_from_ddrawmapflags(unsigned int flags) DECLSPEC_HIDDEN
struct d3d_material * d3d_material_create(struct ddraw *ddraw) DECLSPEC_HIDDEN
static void ddraw_set_swapchain_window(struct ddraw *ddraw, HWND window)
static struct ddraw_surface * impl_from_IDirect3DTexture2(IDirect3DTexture2 *iface)
HRESULT ddraw_palette_init(struct ddraw_palette *palette, struct ddraw *ddraw, DWORD flags, PALETTEENTRY *entries) DECLSPEC_HIDDEN
struct ddraw_surface * unsafe_impl_from_IDirect3DTexture(IDirect3DTexture *iface) DECLSPEC_HIDDEN
struct d3d_vertex_buffer * unsafe_impl_from_IDirect3DVertexBuffer(IDirect3DVertexBuffer *iface) DECLSPEC_HIDDEN
struct ddraw_surface * unsafe_impl_from_IDirectDrawSurface(IDirectDrawSurface *iface) DECLSPEC_HIDDEN
BOOL ddraw_handle_table_init(struct ddraw_handle_table *t, UINT initial_size) DECLSPEC_HIDDEN
struct d3d_execute_buffer * unsafe_impl_from_IDirect3DExecuteBuffer(IDirect3DExecuteBuffer *iface) DECLSPEC_HIDDEN
struct d3d_vertex_buffer * unsafe_impl_from_IDirect3DVertexBuffer7(IDirect3DVertexBuffer7 *iface) DECLSPEC_HIDDEN
void material_activate(struct d3d_material *material) DECLSPEC_HIDDEN
struct d3d_light * unsafe_impl_from_IDirect3DLight(IDirect3DLight *iface) DECLSPEC_HIDDEN
static struct d3d_device * impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface)
@ DDRAW_HANDLE_STATEBLOCK
HRESULT ddraw_init(struct ddraw *ddraw, DWORD flags, enum wined3d_device_type device_type) DECLSPEC_HIDDEN
HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_desc, struct ddraw_surface **surface, IUnknown *outer_unknown, unsigned int version) DECLSPEC_HIDDEN
const struct wined3d_parent_ops ddraw_null_wined3d_parent_ops DECLSPEC_HIDDEN
void light_activate(struct d3d_light *light) DECLSPEC_HIDDEN
void DDRAW_dump_DDSCAPS2(const DDSCAPS2 *in) DECLSPEC_HIDDEN
void dump_D3DMATRIX(const D3DMATRIX *mat) DECLSPEC_HIDDEN
HRESULT ddraw_get_d3dcaps(const struct ddraw *ddraw, D3DDEVICEDESC7 *caps) DECLSPEC_HIDDEN
struct ddraw_surface * unsafe_impl_from_IDirect3DTexture2(IDirect3DTexture2 *iface) DECLSPEC_HIDDEN
void DDRAW_dump_cooperativelevel(DWORD cooplevel) DECLSPEC_HIDDEN
enum wined3d_format_id wined3dformat_from_ddrawformat(const DDPIXELFORMAT *format) DECLSPEC_HIDDEN
void viewport_activate(struct d3d_viewport *viewport, BOOL ignore_lights) DECLSPEC_HIDDEN
HRESULT d3d_vertex_buffer_create(struct d3d_vertex_buffer **buffer, struct ddraw *ddraw, D3DVERTEXBUFFERDESC *desc) DECLSPEC_HIDDEN
static struct d3d_device * impl_from_IDirect3DDevice(IDirect3DDevice *iface)
void * ddraw_get_object(struct ddraw_handle_table *t, DWORD handle, enum ddraw_handle_type type) DECLSPEC_HIDDEN
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)
HRESULT d3d_execute_buffer_execute(struct d3d_execute_buffer *execute_buffer, struct d3d_device *device, struct d3d_viewport *viewport) DECLSPEC_HIDDEN
struct d3d_viewport * unsafe_impl_from_IDirect3DViewport(IDirect3DViewport *iface) DECLSPEC_HIDDEN
static struct ddraw_surface * impl_from_IDirectDrawSurface7(IDirectDrawSurface7 *iface)
void ddraw_d3dcaps1_from_7(D3DDEVICEDESC *caps1, D3DDEVICEDESC7 *caps7) DECLSPEC_HIDDEN
static struct ddraw_surface * impl_from_IDirect3DTexture(IDirect3DTexture *iface)
void light_deactivate(struct d3d_light *light) DECLSPEC_HIDDEN
const struct wined3d_parent_ops ddraw_null_wined3d_parent_ops
const GUID IID_D3DDEVICE_WineD3D
static const WCHAR version[]
__kernel_ptrdiff_t ptrdiff_t
GLuint GLuint GLsizei GLenum type
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum light
static const WCHAR desc[]
static IHTMLWindow2 * window
DWORD IDirectDrawSurface7
#define DDPF_PALETTEINDEXEDTO8
#define DDPF_PALETTEINDEXED4
#define DDPF_PALETTEINDEXED2
#define DDPF_PALETTEINDEXED1
#define DDPF_PALETTEINDEXED8
struct wined3d_vertex_declaration * decl
struct wined3d_device * wined3d_device
struct list viewport_list
struct wined3d_buffer * vertex_buffer
D3DMATRIX legacy_projection
D3DPRIMITIVETYPE primitive_type
BYTE * sysmem_vertex_buffer
IDirect3DDevice3 IDirect3DDevice3_iface
struct d3d_viewport * current_viewport
IDirect3DDevice2 IDirect3DDevice2_iface
BOOL legacyTextureBlending
D3DVIEWPORT7 active_viewport
IDirect3DDevice IDirect3DDevice_iface
struct wined3d_vec4 user_clip_planes[D3DMAXUSERCLIPPLANES]
IDirect3DDevice7 IDirect3DDevice7_iface
struct wined3d_buffer * index_buffer
D3DMATRIX legacy_clipspace
IDirect3DExecuteBuffer IDirect3DExecuteBuffer_iface
struct wined3d_buffer * index_buffer
D3DEXECUTEBUFFERDESC desc
struct wined3d_buffer * dst_vertex_buffer
unsigned int src_vertex_pos
struct d3d_device * d3ddev
struct wined3d_buffer * src_vertex_buffer
struct d3d_viewport * active_viewport
IDirect3DLight IDirect3DLight_iface
struct d3d_device * active_device
IDirect3DMaterial IDirect3DMaterial_iface
IDirect3DMaterial2 IDirect3DMaterial2_iface
IDirect3DMaterial3 IDirect3DMaterial3_iface
struct wined3d_vertex_declaration * wined3d_declaration
struct wined3d_buffer * wined3d_buffer
IDirect3DVertexBuffer7 IDirect3DVertexBuffer7_iface
struct d3d_device * active_device
struct d3d_material * background
IDirect3DViewport3 IDirect3DViewport3_iface
union d3d_viewport::@249 viewports
IDirectDrawClipper IDirectDrawClipper_iface
enum ddraw_handle_type type
struct ddraw_handle_entry * free_entries
struct ddraw_handle_entry * entries
IUnknown * ifaceToRelease
struct wined3d_palette * wined3d_palette
IDirectDrawPalette IDirectDrawPalette_iface
IDirectDrawSurface IDirectDrawSurface_iface
IDirectDrawSurface2 IDirectDrawSurface2_iface
struct ddraw_clipper * clipper
IDirectDrawGammaControl IDirectDrawGammaControl_iface
DDSURFACEDESC2 surface_desc
IUnknown * attached_iface
struct wined3d_private_store private_store
IDirectDrawSurface3 IDirectDrawSurface3_iface
struct ddraw_surface * first_attached
struct wined3d_rendertarget_view * wined3d_rtv
unsigned int sub_resource_idx
IDirect3DTexture IDirect3DTexture_iface
struct d3d_device * device1
struct ddraw_palette * palette
IDirectDrawSurface7 IDirectDrawSurface7_iface
struct ddraw_surface * next_attached
struct list surface_list_entry
IUnknown * ifaceToRelease
IDirectDrawSurface4 IDirectDrawSurface4_iface
struct ddraw_surface * complex_array[MAX_COMPLEX_ATTACHED]
struct wined3d_texture * wined3d_texture
IDirect3DTexture2 IDirect3DTexture2_iface
struct ddraw_surface * root
struct wined3d_device * wined3d_device
DDSURFACEDESC2 surface_desc
struct d3d_device * d3ddevice
IDirectDraw2 IDirectDraw2_iface
IDirect3D3 IDirect3D3_iface
struct ddraw_surface * primary
struct wined3d_device * wined3d_device
IDirectDraw7 IDirectDraw7_iface
IDirect3D IDirect3D_iface
struct wined3d_texture * wined3d_frontbuffer
struct wined3d_swapchain * wined3d_swapchain
IDirectDraw4 IDirectDraw4_iface
struct list ddraw_list_entry
IDirect3D7 IDirect3D7_iface
struct wined3d_device_parent device_parent
IDirect3D2 IDirect3D2_iface
IDirectDraw IDirectDraw_iface
HRESULT(* pfnCreateInstance)(IUnknown *pUnkOuter, LPVOID *ppObj)
const struct wined3d_parent_ops * parent_ops
unsigned int sub_resource_idx
#define CONTAINING_RECORD(address, type, field)
wined3d_depth_buffer_type
HWND WINAPI GetDesktopWindow(void)