19#ifndef __WINE_DLLS_DDRAW_DDRAW_PRIVATE_H
20#define __WINE_DLLS_DDRAW_DDRAW_PRIVATE_H
53#define DDRAW_INITIALIZED 0x00000001
54#define DDRAW_D3D_INITIALIZED 0x00000002
55#define DDRAW_RESTORE_MODE 0x00000004
56#define DDRAW_NO3D 0x00000008
57#define DDRAW_SCL_DDRAW1 0x00000010
58#define DDRAW_SCL_RECURSIVE 0x00000020
59#define DDRAW_SWAPPED 0x00000040
61#define DDRAW_STRIDE_ALIGNMENT 8
63#define DDRAW_WINED3D_FLAGS (WINED3D_LEGACY_DEPTH_BIAS | WINED3D_RESTORE_MODE_ON_ACTIVATE \
64 | WINED3D_FOCUS_MESSAGES | WINED3D_PIXEL_CENTER_INTEGER | WINED3D_LEGACY_UNBOUND_RESOURCE_COLOR \
65 | WINED3D_NO_PRIMITIVE_RESTART | WINED3D_LEGACY_CUBEMAP_FILTERING | WINED3D_NO_DRAW_INDIRECT)
67#define DDRAW_WINED3D_SWAPCHAIN_FLAGS (WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH \
68 | WINED3D_SWAPCHAIN_IMPLICIT | WINED3D_SWAPCHAIN_REGISTER_TOPMOST_TIMER)
70#define DDRAW_MAX_ACTIVE_LIGHTS 32
71#define DDRAW_MAX_TEXTURES 8
140#define DDRAW_WINDOW_CLASS_NAME "DirectDrawDeviceWnd"
159#define DDRAW_SURFACE_LOCATION_DEFAULT 0x00000001
160#define DDRAW_SURFACE_LOCATION_DRAW 0x00000002
200#define MAX_COMPLEX_ATTACHED 6
282#define DDRAW_INVALID_HANDLE ~0U
612#define GET_TEXCOUNT_FROM_FVF(d3dvtVertexType) \
613 (((d3dvtVertexType) & D3DFVF_TEXCOUNT_MASK) >> D3DFVF_TEXCOUNT_SHIFT)
615#define GET_TEXCOORD_SIZE_FROM_FVF(d3dvtVertexType, tex_num) \
616 (((((d3dvtVertexType) >> (16 + (2 * (tex_num)))) + 1) & 0x03) + 1)
663#define DDRAW_SURFACE_READ 0x00000001
664#define DDRAW_SURFACE_WRITE 0x00000002
665#define DDRAW_SURFACE_RW (DDRAW_SURFACE_READ | DDRAW_SURFACE_WRITE)
724#define FE(x) { x, #x }
735#define ME(x,f,e) { x, #x, (void (*)(const void *))(f), offsetof(STRUCT, e) }
737#define DD_STRUCT_COPY_BYSIZE_(to,from,to_size,from_size) \
739 DWORD __size = (to)->dwSize; \
740 DWORD __resetsize = min(to_size, sizeof(*to)); \
741 DWORD __copysize = min(__resetsize, from_size); \
742 assert(to != from); \
743 memcpy(to, from, __copysize); \
744 memset((char*)(to) + __copysize, 0, __resetsize - __copysize); \
745 (to)->dwSize = __size; \
748#define DD_STRUCT_COPY_BYSIZE(to,from) DD_STRUCT_COPY_BYSIZE_(to,from,(to)->dwSize,(from)->dwSize)
#define D3DMAXUSERCLIPPLANES
#define DDRAW_SURFACE_WRITE
struct d3d_device * unsafe_impl_from_IDirect3DDevice7(IDirect3DDevice7 *iface)
static struct wined3d_texture * ddraw_surface_get_any_texture(struct ddraw_surface *surface, unsigned int flags)
enum wined3d_format_id wined3dformat_from_ddrawformat(const DDPIXELFORMAT *format)
void d3d_device_apply_state(struct d3d_device *device, BOOL clear_state)
void light_activate(struct d3d_light *light)
void * ddraw_free_handle(struct ddraw_handle_table *t, DWORD handle, enum ddraw_handle_type type)
void viewport_activate(struct d3d_viewport *viewport, BOOL ignore_lights)
unsigned int wined3dmapflags_from_ddrawmapflags(unsigned int flags)
void multiply_matrix(struct wined3d_matrix *dst, const struct wined3d_matrix *src1, const struct wined3d_matrix *src2)
void viewport_alloc_active_light_index(struct d3d_light *light)
HRESULT ddraw_get_d3dcaps(const struct ddraw *ddraw, D3DDEVICEDESC7 *caps)
static struct wined3d_texture * ddraw_surface_get_default_texture(struct ddraw_surface *surface, unsigned int flags)
void dump_D3DMATRIX(const D3DMATRIX *mat)
void viewport_deactivate(struct d3d_viewport *viewport)
BOOL ddraw_clipper_is_valid(const struct ddraw_clipper *clipper)
static struct ddraw_surface * impl_from_IDirectDrawSurface3(IDirectDrawSurface3 *iface)
void light_deactivate(struct d3d_light *light)
struct ddraw_surface * unsafe_impl_from_IDirectDrawSurface4(IDirectDrawSurface4 *iface)
struct d3d_viewport * unsafe_impl_from_IDirect3DViewport(IDirect3DViewport *iface)
static struct ddraw_surface * impl_from_IDirectDrawSurface4(IDirectDrawSurface4 *iface)
HRESULT ddraw_surface_update_frontbuffer(struct ddraw_surface *surface, const RECT *rect, BOOL read, unsigned int swap_interval)
HRESULT d3d_execute_buffer_init(struct d3d_execute_buffer *execute_buffer, struct d3d_device *device, D3DEXECUTEBUFFERDESC *desc)
@ DDRAW_DEVICE_STATE_LOST
@ DDRAW_DEVICE_STATE_NOT_RESTORED
void d3d_viewport_init(struct d3d_viewport *viewport, struct ddraw *ddraw)
void DDSD_to_DDSD2(const DDSURFACEDESC *in, DDSURFACEDESC2 *out)
void DDSD2_to_DDSD(const DDSURFACEDESC2 *in, DDSURFACEDESC *out)
HRESULT ddraw_clipper_init(struct ddraw_clipper *clipper)
static struct ddraw_palette * impl_from_IDirectDrawPalette(IDirectDrawPalette *iface)
static struct ddraw_surface * impl_from_IDirectDrawSurface(IDirectDrawSurface *iface)
struct d3d_viewport * unsafe_impl_from_IDirect3DViewport3(IDirect3DViewport3 *iface)
HRESULT d3d_vertex_buffer_create(struct d3d_vertex_buffer **buffer, struct ddraw *ddraw, D3DVERTEXBUFFERDESC *desc)
void material_activate(struct d3d_material *material)
struct d3d_vertex_buffer * unsafe_impl_from_IDirect3DVertexBuffer7(IDirect3DVertexBuffer7 *iface)
struct d3d_device * unsafe_impl_from_IDirect3DDevice(IDirect3DDevice *iface)
void * ddraw_get_object(struct ddraw_handle_table *t, DWORD handle, enum ddraw_handle_type type)
HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_desc, struct ddraw_surface **surface, IUnknown *outer_unknown, unsigned int version)
static BOOL format_is_compressed(const DDPIXELFORMAT *format)
#define DDRAW_SURFACE_LOCATION_DRAW
struct ddraw_clipper * unsafe_impl_from_IDirectDrawClipper(IDirectDrawClipper *iface)
#define MAX_COMPLEX_ATTACHED
enum wined3d_depth_buffer_type d3d_device_update_depth_stencil(struct d3d_device *device)
void ddraw_handle_table_destroy(struct ddraw_handle_table *t)
void DDRAW_dump_DDSCAPS2(const DDSCAPS2 *in)
struct ddraw_palette * unsafe_impl_from_IDirectDrawPalette(IDirectDrawPalette *iface)
struct wined3d_rendertarget_view * ddraw_surface_get_rendertarget_view(struct ddraw_surface *surface)
struct ddraw_handle_table global_handle_table
static struct ddraw_surface * impl_from_IDirectDrawSurface2(IDirectDrawSurface2 *iface)
HRESULT hr_ddraw_from_wined3d(HRESULT hr)
void d3d_device_sync_surfaces(struct d3d_device *device)
struct d3d_viewport * unsafe_impl_from_IDirect3DViewport2(IDirect3DViewport2 *iface)
void DDRAW_dump_surface_desc(const DDSURFACEDESC2 *lpddsd)
static BOOL format_is_paletteindexed(const DDPIXELFORMAT *fmt)
HRESULT ddraw_init(struct ddraw *ddraw, DWORD flags, enum wined3d_device_type device_type)
#define DDRAW_SURFACE_LOCATION_DEFAULT
HRESULT d3d_execute_buffer_execute(struct d3d_execute_buffer *execute_buffer, struct d3d_device *device)
void DDRAW_dump_cooperativelevel(DWORD cooplevel)
void d3d_light_init(struct d3d_light *light, struct ddraw *ddraw)
struct ddraw_surface * unsafe_impl_from_IDirectDrawSurface7(IDirectDrawSurface7 *iface)
static struct d3d_device * impl_from_IDirect3DDevice7(IDirect3DDevice7 *iface)
struct ddraw_surface * unsafe_impl_from_IDirect3DTexture(IDirect3DTexture *iface)
BOOL ddraw_handle_table_init(struct ddraw_handle_table *t, UINT initial_size)
struct d3d_execute_buffer * unsafe_impl_from_IDirect3DExecuteBuffer(IDirect3DExecuteBuffer *iface)
static void ddraw_set_swapchain_window(struct ddraw *ddraw, HWND window)
static struct ddraw_surface * impl_from_IDirect3DTexture2(IDirect3DTexture2 *iface)
#define DDRAW_SURFACE_READ
struct d3d_vertex_buffer * unsafe_impl_from_IDirect3DVertexBuffer(IDirect3DVertexBuffer *iface)
struct d3d_device * unsafe_impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)
void ddraw_update_lost_surfaces(struct ddraw *ddraw)
struct wined3d_vertex_declaration * ddraw_find_decl(struct ddraw *ddraw, DWORD fvf)
struct ddraw_surface * unsafe_impl_from_IDirectDrawSurface(IDirectDrawSurface *iface)
struct ddraw_surface * unsafe_impl_from_IDirect3DTexture2(IDirect3DTexture2 *iface)
struct d3d_material * d3d_material_create(struct ddraw *ddraw)
static struct d3d_device * impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface)
struct d3d_light * unsafe_impl_from_IDirect3DLight(IDirect3DLight *iface)
DWORD ddraw_allocate_handle(struct ddraw_handle_table *t, void *object, enum ddraw_handle_type type)
@ DDRAW_HANDLE_STATEBLOCK
void DDRAW_Convert_DDDEVICEIDENTIFIER_2_To_1(const DDDEVICEIDENTIFIER2 *pIn, DDDEVICEIDENTIFIER *pOut)
static struct wined3d_texture * ddraw_surface_get_draw_texture(struct ddraw_surface *surface, unsigned int flags)
@ DDRAW_VIEWPORT_VERSION_1
@ DDRAW_VIEWPORT_VERSION_NONE
@ DDRAW_VIEWPORT_VERSION_2
struct d3d_device * unsafe_impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface)
static struct d3d_device * impl_from_IDirect3DDevice(IDirect3DDevice *iface)
void ddraw_d3dcaps1_from_7(D3DDEVICEDESC *caps1, D3DDEVICEDESC7 *caps7)
DWORD get_flexible_vertex_size(DWORD d3dvtVertexType)
void ddrawformat_from_wined3dformat(DDPIXELFORMAT *ddraw_format, enum wined3d_format_id wined3d_format)
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)
static BOOL ddraw_surface_can_be_lost(const struct ddraw_surface *surface)
static struct ddraw_surface * impl_from_IDirectDrawSurface7(IDirectDrawSurface7 *iface)
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)
BOOL wined3d_colour_from_ddraw_colour(const DDPIXELFORMAT *pf, const struct ddraw_palette *palette, DWORD colour, struct wined3d_color *wined3d_colour)
static struct ddraw_surface * impl_from_IDirect3DTexture(IDirect3DTexture *iface)
HRESULT ddraw_palette_init(struct ddraw_palette *palette, struct ddraw *ddraw, DWORD flags, PALETTEENTRY *entries)
void viewport_free_active_light_index(struct d3d_light *light)
const struct wined3d_parent_ops ddraw_null_wined3d_parent_ops
void DDRAW_dump_DDCAPS(const DDCAPS *lpcaps)
const GUID IID_D3DDEVICE_WineD3D
void DDRAW_Convert_DDSCAPS_1_To_2(const DDSCAPS *pIn, DDSCAPS2 *pOut)
HRESULT CDECL wined3d_device_context_copy_sub_resource_region(struct wined3d_device_context *context, struct wined3d_resource *dst_resource, unsigned int dst_sub_resource_idx, unsigned int dst_x, unsigned int dst_y, unsigned int dst_z, struct wined3d_resource *src_resource, unsigned int src_sub_resource_idx, const struct wined3d_box *src_box, unsigned int flags)
struct wined3d_resource *CDECL wined3d_texture_get_resource(struct wined3d_texture *texture)
static const WCHAR version[]
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
D3D11_SHADER_VARIABLE_DESC desc
static IHTMLWindow2 * window
DWORD IDirectDrawSurface7
HWND WINAPI GetDesktopWindow(void)
#define DDPF_PALETTEINDEXEDTO8
#define DDPF_PALETTEINDEXED4
#define DDPF_PALETTEINDEXED2
#define DDSCAPS_PRIMARYSURFACE
#define DDPF_PALETTEINDEXED1
#define DDSCAPS_SYSTEMMEMORY
struct wined3d_vertex_declaration * decl
struct wined3d_device_context * immediate_context
struct list viewport_list
struct d3d_device_context_state * state
D3DPRIMITIVETYPE primitive_type
BYTE * sysmem_vertex_buffer
IDirect3DDevice3 IDirect3DDevice3_iface
struct wined3d_stateblock * recording
struct wined3d_stateblock * update_state
struct ddraw_surface * target_ds
struct d3d_viewport * current_viewport
IDirect3DDevice2 IDirect3DDevice2_iface
BOOL legacyTextureBlending
struct wined3d_matrix legacy_projection legacy_clipspace
D3DVIEWPORT7 active_viewport
IDirect3DDevice IDirect3DDevice_iface
struct ddraw_surface * target
struct wined3d_device * wined3d_device
struct wined3d_vec4 user_clip_planes[D3DMAXUSERCLIPPLANES]
IDirect3DDevice7 IDirect3DDevice7_iface
struct wined3d_stateblock * saved_state
D3DTEXTUREBLEND texture_map_blend
struct wined3d_streaming_buffer vertex_buffer index_buffer
const struct wined3d_stateblock_state * stateblock_state
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
enum ddraw_viewport_version version
struct d3d_device * active_device
struct d3d_material * background
IDirect3DViewport3 IDirect3DViewport3_iface
DWORD active_lights_count
union d3d_viewport::@288 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
struct wined3d_texture * draw_texture
IDirectDrawSurface2 IDirectDrawSurface2_iface
struct ddraw_clipper * clipper
IDirectDrawGammaControl IDirectDrawGammaControl_iface
DDSURFACEDESC2 surface_desc
unsigned int sysmem_fallback
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]
unsigned int texture_location
struct wined3d_texture * wined3d_texture
IDirect3DTexture2 IDirect3DTexture2_iface
struct ddraw_surface * root
struct wined3d_device * wined3d_device
DDSURFACEDESC2 surface_desc
struct wined3d_texture * gdi_surface
struct wined3d_swapchain_state_parent state_parent
IDirectDraw2 IDirectDraw2_iface
IDirect3D3 IDirect3D3_iface
struct ddraw_surface * primary
struct wined3d_device * wined3d_device
IDirectDraw7 IDirectDraw7_iface
IDirect3D IDirect3D_iface
struct wined3d_device_context * immediate_context
struct wined3d_swapchain * wined3d_swapchain
struct list d3ddevice_list
IDirectDraw4 IDirectDraw4_iface
struct list ddraw_list_entry
IDirect3D7 IDirect3D7_iface
struct wined3d_output * wined3d_output
struct d3d_device * device_last_applied_state
struct wined3d_device_parent device_parent
IDirect3D2 IDirect3D2_iface
struct wined3d_adapter * wined3d_adapter
IDirectDraw IDirectDraw_iface
HRESULT(* pfnCreateInstance)(IUnknown *pUnkOuter, LPVOID *ppObj)
#define CONTAINING_RECORD(address, type, field)
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
wined3d_depth_buffer_type