ReactOS 0.4.16-dev-297-gc569aee
device.c File Reference
#include "config.h"
#include "wine/port.h"
#include "ddraw_private.h"
Include dependency graph for device.c:

Go to the source code of this file.

Classes

struct  tss_lookup
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (ddraw)
 
 WINE_DECLARE_DEBUG_CHANNEL (winediag)
 
static void set_fpu_control_word (WORD fpucw)
 
static WORD d3d_fpu_setup (void)
 
static struct d3d_deviceimpl_from_IUnknown (IUnknown *iface)
 
static HRESULT WINAPI d3d_device_inner_QueryInterface (IUnknown *iface, REFIID riid, void **out)
 
static HRESULT WINAPI d3d_device7_QueryInterface (IDirect3DDevice7 *iface, REFIID riid, void **out)
 
static HRESULT WINAPI d3d_device3_QueryInterface (IDirect3DDevice3 *iface, REFIID riid, void **out)
 
static HRESULT WINAPI d3d_device2_QueryInterface (IDirect3DDevice2 *iface, REFIID riid, void **out)
 
static HRESULT WINAPI d3d_device1_QueryInterface (IDirect3DDevice *iface, REFIID riid, void **out)
 
static ULONG WINAPI d3d_device_inner_AddRef (IUnknown *iface)
 
static ULONG WINAPI d3d_device7_AddRef (IDirect3DDevice7 *iface)
 
static ULONG WINAPI d3d_device3_AddRef (IDirect3DDevice3 *iface)
 
static ULONG WINAPI d3d_device2_AddRef (IDirect3DDevice2 *iface)
 
static ULONG WINAPI d3d_device1_AddRef (IDirect3DDevice *iface)
 
static ULONG WINAPI d3d_device_inner_Release (IUnknown *iface)
 
static ULONG WINAPI d3d_device7_Release (IDirect3DDevice7 *iface)
 
static ULONG WINAPI d3d_device3_Release (IDirect3DDevice3 *iface)
 
static ULONG WINAPI d3d_device2_Release (IDirect3DDevice2 *iface)
 
static ULONG WINAPI d3d_device1_Release (IDirect3DDevice *iface)
 
static HRESULT WINAPI d3d_device1_Initialize (IDirect3DDevice *iface, IDirect3D *d3d, GUID *guid, D3DDEVICEDESC *device_desc)
 
static HRESULT d3d_device7_GetCaps (IDirect3DDevice7 *iface, D3DDEVICEDESC7 *device_desc)
 
static HRESULT WINAPI d3d_device7_GetCaps_FPUSetup (IDirect3DDevice7 *iface, D3DDEVICEDESC7 *desc)
 
static HRESULT WINAPI d3d_device7_GetCaps_FPUPreserve (IDirect3DDevice7 *iface, D3DDEVICEDESC7 *desc)
 
static BOOL check_d3ddevicedesc_size (DWORD size)
 
static HRESULT WINAPI d3d_device3_GetCaps (IDirect3DDevice3 *iface, D3DDEVICEDESC *HWDesc, D3DDEVICEDESC *HelDesc)
 
static HRESULT WINAPI d3d_device2_GetCaps (IDirect3DDevice2 *iface, D3DDEVICEDESC *hw_desc, D3DDEVICEDESC *hel_desc)
 
static HRESULT WINAPI d3d_device1_GetCaps (IDirect3DDevice *iface, D3DDEVICEDESC *hw_desc, D3DDEVICEDESC *hel_desc)
 
static HRESULT WINAPI d3d_device2_SwapTextureHandles (IDirect3DDevice2 *iface, IDirect3DTexture2 *tex1, IDirect3DTexture2 *tex2)
 
static HRESULT WINAPI d3d_device1_SwapTextureHandles (IDirect3DDevice *iface, IDirect3DTexture *tex1, IDirect3DTexture *tex2)
 
static HRESULT WINAPI d3d_device3_GetStats (IDirect3DDevice3 *iface, D3DSTATS *Stats)
 
static HRESULT WINAPI d3d_device2_GetStats (IDirect3DDevice2 *iface, D3DSTATS *stats)
 
static HRESULT WINAPI d3d_device1_GetStats (IDirect3DDevice *iface, D3DSTATS *stats)
 
static HRESULT WINAPI d3d_device1_CreateExecuteBuffer (IDirect3DDevice *iface, D3DEXECUTEBUFFERDESC *buffer_desc, IDirect3DExecuteBuffer **ExecuteBuffer, IUnknown *outer_unknown)
 
static HRESULT WINAPI d3d_device1_Execute (IDirect3DDevice *iface, IDirect3DExecuteBuffer *ExecuteBuffer, IDirect3DViewport *viewport, DWORD flags)
 
static HRESULT WINAPI d3d_device3_AddViewport (IDirect3DDevice3 *iface, IDirect3DViewport3 *viewport)
 
static HRESULT WINAPI d3d_device2_AddViewport (IDirect3DDevice2 *iface, IDirect3DViewport2 *viewport)
 
static HRESULT WINAPI d3d_device1_AddViewport (IDirect3DDevice *iface, IDirect3DViewport *viewport)
 
static HRESULT WINAPI d3d_device3_DeleteViewport (IDirect3DDevice3 *iface, IDirect3DViewport3 *viewport)
 
static HRESULT WINAPI d3d_device2_DeleteViewport (IDirect3DDevice2 *iface, IDirect3DViewport2 *viewport)
 
static HRESULT WINAPI d3d_device1_DeleteViewport (IDirect3DDevice *iface, IDirect3DViewport *viewport)
 
static HRESULT WINAPI d3d_device3_NextViewport (IDirect3DDevice3 *iface, IDirect3DViewport3 *Viewport3, IDirect3DViewport3 **lplpDirect3DViewport3, DWORD flags)
 
static HRESULT WINAPI d3d_device2_NextViewport (IDirect3DDevice2 *iface, IDirect3DViewport2 *viewport, IDirect3DViewport2 **next, DWORD flags)
 
static HRESULT WINAPI d3d_device1_NextViewport (IDirect3DDevice *iface, IDirect3DViewport *viewport, IDirect3DViewport **next, DWORD flags)
 
static HRESULT WINAPI d3d_device1_Pick (IDirect3DDevice *iface, IDirect3DExecuteBuffer *buffer, IDirect3DViewport *viewport, DWORD flags, D3DRECT *rect)
 
static HRESULT WINAPI d3d_device1_GetPickRecords (IDirect3DDevice *iface, DWORD *count, D3DPICKRECORD *records)
 
static HRESULT d3d_device7_EnumTextureFormats (IDirect3DDevice7 *iface, LPD3DENUMPIXELFORMATSCALLBACK callback, void *context)
 
static HRESULT WINAPI d3d_device7_EnumTextureFormats_FPUSetup (IDirect3DDevice7 *iface, LPD3DENUMPIXELFORMATSCALLBACK callback, void *context)
 
static HRESULT WINAPI d3d_device7_EnumTextureFormats_FPUPreserve (IDirect3DDevice7 *iface, LPD3DENUMPIXELFORMATSCALLBACK callback, void *context)
 
static HRESULT WINAPI d3d_device3_EnumTextureFormats (IDirect3DDevice3 *iface, LPD3DENUMPIXELFORMATSCALLBACK callback, void *context)
 
static HRESULT WINAPI d3d_device2_EnumTextureFormats (IDirect3DDevice2 *iface, LPD3DENUMTEXTUREFORMATSCALLBACK callback, void *context)
 
static HRESULT WINAPI d3d_device1_EnumTextureFormats (IDirect3DDevice *iface, LPD3DENUMTEXTUREFORMATSCALLBACK callback, void *context)
 
static HRESULT WINAPI d3d_device1_CreateMatrix (IDirect3DDevice *iface, D3DMATRIXHANDLE *D3DMatHandle)
 
static HRESULT WINAPI d3d_device1_SetMatrix (IDirect3DDevice *iface, D3DMATRIXHANDLE D3DMatHandle, D3DMATRIX *D3DMatrix)
 
static HRESULT WINAPI d3d_device1_GetMatrix (IDirect3DDevice *iface, D3DMATRIXHANDLE D3DMatHandle, D3DMATRIX *D3DMatrix)
 
static HRESULT WINAPI d3d_device1_DeleteMatrix (IDirect3DDevice *iface, D3DMATRIXHANDLE D3DMatHandle)
 
static HRESULT d3d_device7_BeginScene (IDirect3DDevice7 *iface)
 
static HRESULT WINAPI d3d_device7_BeginScene_FPUSetup (IDirect3DDevice7 *iface)
 
static HRESULT WINAPI d3d_device7_BeginScene_FPUPreserve (IDirect3DDevice7 *iface)
 
static HRESULT WINAPI d3d_device3_BeginScene (IDirect3DDevice3 *iface)
 
static HRESULT WINAPI d3d_device2_BeginScene (IDirect3DDevice2 *iface)
 
static HRESULT WINAPI d3d_device1_BeginScene (IDirect3DDevice *iface)
 
static HRESULT d3d_device7_EndScene (IDirect3DDevice7 *iface)
 
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d_device7_EndScene_FPUSetup (IDirect3DDevice7 *iface)
 
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d_device7_EndScene_FPUPreserve (IDirect3DDevice7 *iface)
 
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d_device3_EndScene (IDirect3DDevice3 *iface)
 
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d_device2_EndScene (IDirect3DDevice2 *iface)
 
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d_device1_EndScene (IDirect3DDevice *iface)
 
static HRESULT WINAPI d3d_device7_GetDirect3D (IDirect3DDevice7 *iface, IDirect3D7 **d3d)
 
static HRESULT WINAPI d3d_device3_GetDirect3D (IDirect3DDevice3 *iface, IDirect3D3 **d3d)
 
static HRESULT WINAPI d3d_device2_GetDirect3D (IDirect3DDevice2 *iface, IDirect3D2 **d3d)
 
static HRESULT WINAPI d3d_device1_GetDirect3D (IDirect3DDevice *iface, IDirect3D **d3d)
 
static HRESULT WINAPI d3d_device3_SetCurrentViewport (IDirect3DDevice3 *iface, IDirect3DViewport3 *Direct3DViewport3)
 
static HRESULT WINAPI d3d_device2_SetCurrentViewport (IDirect3DDevice2 *iface, IDirect3DViewport2 *viewport)
 
static HRESULT WINAPI d3d_device3_GetCurrentViewport (IDirect3DDevice3 *iface, IDirect3DViewport3 **viewport)
 
static HRESULT WINAPI d3d_device2_GetCurrentViewport (IDirect3DDevice2 *iface, IDirect3DViewport2 **viewport)
 
static BOOL validate_surface_palette (struct ddraw_surface *surface)
 
static HRESULT d3d_device_set_render_target (struct d3d_device *device, struct ddraw_surface *target, IUnknown *rt_iface)
 
static HRESULT d3d_device7_SetRenderTarget (IDirect3DDevice7 *iface, IDirectDrawSurface7 *target, DWORD flags)
 
static HRESULT WINAPI d3d_device7_SetRenderTarget_FPUSetup (IDirect3DDevice7 *iface, IDirectDrawSurface7 *NewTarget, DWORD flags)
 
static HRESULT WINAPI d3d_device7_SetRenderTarget_FPUPreserve (IDirect3DDevice7 *iface, IDirectDrawSurface7 *NewTarget, DWORD flags)
 
static HRESULT WINAPI d3d_device3_SetRenderTarget (IDirect3DDevice3 *iface, IDirectDrawSurface4 *target, DWORD flags)
 
static HRESULT WINAPI d3d_device2_SetRenderTarget (IDirect3DDevice2 *iface, IDirectDrawSurface *target, DWORD flags)
 
static HRESULT WINAPI d3d_device7_GetRenderTarget (IDirect3DDevice7 *iface, IDirectDrawSurface7 **RenderTarget)
 
static HRESULT WINAPI d3d_device3_GetRenderTarget (IDirect3DDevice3 *iface, IDirectDrawSurface4 **RenderTarget)
 
static HRESULT WINAPI d3d_device2_GetRenderTarget (IDirect3DDevice2 *iface, IDirectDrawSurface **RenderTarget)
 
static HRESULT WINAPI d3d_device3_Begin (IDirect3DDevice3 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, DWORD flags)
 
static HRESULT WINAPI d3d_device2_Begin (IDirect3DDevice2 *iface, D3DPRIMITIVETYPE primitive_type, D3DVERTEXTYPE vertex_type, DWORD flags)
 
static HRESULT WINAPI d3d_device3_BeginIndexed (IDirect3DDevice3 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, DWORD flags)
 
static HRESULT WINAPI d3d_device2_BeginIndexed (IDirect3DDevice2 *iface, D3DPRIMITIVETYPE primitive_type, D3DVERTEXTYPE vertex_type, void *vertices, DWORD vertex_count, DWORD flags)
 
static HRESULT WINAPI d3d_device3_Vertex (IDirect3DDevice3 *iface, void *vertex)
 
static HRESULT WINAPI d3d_device2_Vertex (IDirect3DDevice2 *iface, void *vertex)
 
static HRESULT WINAPI d3d_device3_Index (IDirect3DDevice3 *iface, WORD index)
 
static HRESULT WINAPI d3d_device2_Index (IDirect3DDevice2 *iface, WORD index)
 
static HRESULT d3d_device7_GetRenderState (IDirect3DDevice7 *iface, D3DRENDERSTATETYPE state, DWORD *value)
 
static HRESULT WINAPI d3d_device7_GetRenderState_FPUSetup (IDirect3DDevice7 *iface, D3DRENDERSTATETYPE state, DWORD *value)
 
static HRESULT WINAPI d3d_device7_GetRenderState_FPUPreserve (IDirect3DDevice7 *iface, D3DRENDERSTATETYPE state, DWORD *value)
 
static HRESULT WINAPI d3d_device3_GetRenderState (IDirect3DDevice3 *iface, D3DRENDERSTATETYPE state, DWORD *value)
 
static HRESULT WINAPI d3d_device2_GetRenderState (IDirect3DDevice2 *iface, D3DRENDERSTATETYPE state, DWORD *value)
 
static HRESULT d3d_device7_SetRenderState (IDirect3DDevice7 *iface, D3DRENDERSTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d_device7_SetRenderState_FPUSetup (IDirect3DDevice7 *iface, D3DRENDERSTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d_device7_SetRenderState_FPUPreserve (IDirect3DDevice7 *iface, D3DRENDERSTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d_device3_SetRenderState (IDirect3DDevice3 *iface, D3DRENDERSTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d_device2_SetRenderState (IDirect3DDevice2 *iface, D3DRENDERSTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d_device3_SetLightState (IDirect3DDevice3 *iface, D3DLIGHTSTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d_device2_SetLightState (IDirect3DDevice2 *iface, D3DLIGHTSTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d_device3_GetLightState (IDirect3DDevice3 *iface, D3DLIGHTSTATETYPE state, DWORD *value)
 
static HRESULT WINAPI d3d_device2_GetLightState (IDirect3DDevice2 *iface, D3DLIGHTSTATETYPE state, DWORD *value)
 
static HRESULT d3d_device7_SetTransform (IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device7_SetTransform_FPUSetup (IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device7_SetTransform_FPUPreserve (IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device3_SetTransform (IDirect3DDevice3 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device2_SetTransform (IDirect3DDevice2 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT d3d_device7_GetTransform (IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device7_GetTransform_FPUSetup (IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device7_GetTransform_FPUPreserve (IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device3_GetTransform (IDirect3DDevice3 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device2_GetTransform (IDirect3DDevice2 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT d3d_device7_MultiplyTransform (IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device7_MultiplyTransform_FPUSetup (IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device7_MultiplyTransform_FPUPreserve (IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device3_MultiplyTransform (IDirect3DDevice3 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device2_MultiplyTransform (IDirect3DDevice2 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT d3d_device_prepare_vertex_buffer (struct d3d_device *device, UINT min_size)
 
static HRESULT d3d_device7_DrawPrimitive (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, DWORD flags)
 
static HRESULT WINAPI d3d_device7_DrawPrimitive_FPUSetup (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, DWORD flags)
 
static HRESULT WINAPI d3d_device7_DrawPrimitive_FPUPreserve (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, DWORD flags)
 
static void setup_lighting (const struct d3d_device *device, DWORD fvf, DWORD flags)
 
static HRESULT WINAPI d3d_device3_DrawPrimitive (IDirect3DDevice3 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, DWORD flags)
 
static HRESULT WINAPI d3d_device2_DrawPrimitive (IDirect3DDevice2 *iface, D3DPRIMITIVETYPE primitive_type, D3DVERTEXTYPE vertex_type, void *vertices, DWORD vertex_count, DWORD flags)
 
static HRESULT d3d_device_prepare_index_buffer (struct d3d_device *device, UINT min_size)
 
static HRESULT d3d_device7_DrawIndexedPrimitive (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, WORD *indices, DWORD index_count, DWORD flags)
 
static HRESULT WINAPI d3d_device7_DrawIndexedPrimitive_FPUSetup (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, WORD *indices, DWORD index_count, DWORD flags)
 
static HRESULT WINAPI d3d_device7_DrawIndexedPrimitive_FPUPreserve (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, WORD *indices, DWORD index_count, DWORD flags)
 
static HRESULT WINAPI d3d_device3_DrawIndexedPrimitive (IDirect3DDevice3 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, WORD *indices, DWORD index_count, DWORD flags)
 
static HRESULT WINAPI d3d_device2_DrawIndexedPrimitive (IDirect3DDevice2 *iface, D3DPRIMITIVETYPE primitive_type, D3DVERTEXTYPE vertex_type, void *vertices, DWORD vertex_count, WORD *indices, DWORD index_count, DWORD flags)
 
static HRESULT WINAPI d3d_device3_End (IDirect3DDevice3 *iface, DWORD flags)
 
static HRESULT WINAPI d3d_device2_End (IDirect3DDevice2 *iface, DWORD flags)
 
static HRESULT WINAPI d3d_device7_SetClipStatus (IDirect3DDevice7 *iface, D3DCLIPSTATUS *clip_status)
 
static HRESULT WINAPI d3d_device3_SetClipStatus (IDirect3DDevice3 *iface, D3DCLIPSTATUS *clip_status)
 
static HRESULT WINAPI d3d_device2_SetClipStatus (IDirect3DDevice2 *iface, D3DCLIPSTATUS *clip_status)
 
static HRESULT WINAPI d3d_device7_GetClipStatus (IDirect3DDevice7 *iface, D3DCLIPSTATUS *clip_status)
 
static HRESULT WINAPI d3d_device3_GetClipStatus (IDirect3DDevice3 *iface, D3DCLIPSTATUS *clip_status)
 
static HRESULT WINAPI d3d_device2_GetClipStatus (IDirect3DDevice2 *iface, D3DCLIPSTATUS *clip_status)
 
static void pack_strided_data (BYTE *dst, DWORD count, const D3DDRAWPRIMITIVESTRIDEDDATA *src, DWORD fvf)
 
static HRESULT d3d_device7_DrawPrimitiveStrided (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, D3DDRAWPRIMITIVESTRIDEDDATA *strided_data, DWORD vertex_count, DWORD flags)
 
static HRESULT WINAPI d3d_device7_DrawPrimitiveStrided_FPUSetup (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE PrimitiveType, DWORD VertexType, D3DDRAWPRIMITIVESTRIDEDDATA *D3DDrawPrimStrideData, DWORD VertexCount, DWORD Flags)
 
static HRESULT WINAPI d3d_device7_DrawPrimitiveStrided_FPUPreserve (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE PrimitiveType, DWORD VertexType, D3DDRAWPRIMITIVESTRIDEDDATA *D3DDrawPrimStrideData, DWORD VertexCount, DWORD Flags)
 
static HRESULT WINAPI d3d_device3_DrawPrimitiveStrided (IDirect3DDevice3 *iface, D3DPRIMITIVETYPE PrimitiveType, DWORD VertexType, D3DDRAWPRIMITIVESTRIDEDDATA *D3DDrawPrimStrideData, DWORD VertexCount, DWORD Flags)
 
static HRESULT d3d_device7_DrawIndexedPrimitiveStrided (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, D3DDRAWPRIMITIVESTRIDEDDATA *strided_data, DWORD vertex_count, WORD *indices, DWORD index_count, DWORD flags)
 
static HRESULT WINAPI d3d_device7_DrawIndexedPrimitiveStrided_FPUSetup (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE PrimitiveType, DWORD VertexType, D3DDRAWPRIMITIVESTRIDEDDATA *D3DDrawPrimStrideData, DWORD VertexCount, WORD *Indices, DWORD IndexCount, DWORD Flags)
 
static HRESULT WINAPI d3d_device7_DrawIndexedPrimitiveStrided_FPUPreserve (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE PrimitiveType, DWORD VertexType, D3DDRAWPRIMITIVESTRIDEDDATA *D3DDrawPrimStrideData, DWORD VertexCount, WORD *Indices, DWORD IndexCount, DWORD Flags)
 
static HRESULT WINAPI d3d_device3_DrawIndexedPrimitiveStrided (IDirect3DDevice3 *iface, D3DPRIMITIVETYPE PrimitiveType, DWORD VertexType, D3DDRAWPRIMITIVESTRIDEDDATA *D3DDrawPrimStrideData, DWORD VertexCount, WORD *Indices, DWORD IndexCount, DWORD Flags)
 
static HRESULT d3d_device7_DrawPrimitiveVB (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, IDirect3DVertexBuffer7 *vb, DWORD start_vertex, DWORD vertex_count, DWORD flags)
 
static HRESULT WINAPI d3d_device7_DrawPrimitiveVB_FPUSetup (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE PrimitiveType, IDirect3DVertexBuffer7 *D3DVertexBuf, DWORD StartVertex, DWORD NumVertices, DWORD Flags)
 
static HRESULT WINAPI d3d_device7_DrawPrimitiveVB_FPUPreserve (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE PrimitiveType, IDirect3DVertexBuffer7 *D3DVertexBuf, DWORD StartVertex, DWORD NumVertices, DWORD Flags)
 
static HRESULT WINAPI d3d_device3_DrawPrimitiveVB (IDirect3DDevice3 *iface, D3DPRIMITIVETYPE PrimitiveType, IDirect3DVertexBuffer *D3DVertexBuf, DWORD StartVertex, DWORD NumVertices, DWORD Flags)
 
static HRESULT d3d_device7_DrawIndexedPrimitiveVB (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, IDirect3DVertexBuffer7 *vb, DWORD start_vertex, DWORD vertex_count, WORD *indices, DWORD index_count, DWORD flags)
 
static HRESULT WINAPI d3d_device7_DrawIndexedPrimitiveVB_FPUSetup (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE PrimitiveType, IDirect3DVertexBuffer7 *D3DVertexBuf, DWORD StartVertex, DWORD NumVertices, WORD *Indices, DWORD IndexCount, DWORD Flags)
 
static HRESULT WINAPI d3d_device7_DrawIndexedPrimitiveVB_FPUPreserve (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE PrimitiveType, IDirect3DVertexBuffer7 *D3DVertexBuf, DWORD StartVertex, DWORD NumVertices, WORD *Indices, DWORD IndexCount, DWORD Flags)
 
static HRESULT WINAPI d3d_device3_DrawIndexedPrimitiveVB (IDirect3DDevice3 *iface, D3DPRIMITIVETYPE PrimitiveType, IDirect3DVertexBuffer *D3DVertexBuf, WORD *Indices, DWORD IndexCount, DWORD Flags)
 
static DWORD in_plane (UINT idx, struct wined3d_vec4 p, D3DVECTOR center, D3DVALUE radius, BOOL equality)
 
static void prepare_clip_space_planes (struct d3d_device *device, struct wined3d_vec4 *plane)
 
static void compute_sphere_visibility (struct wined3d_vec4 plane[12], DWORD enabled_planes, BOOL equality, D3DVECTOR *centers, D3DVALUE *radii, DWORD sphere_count, DWORD *return_values)
 
static HRESULT WINAPI d3d_device7_ComputeSphereVisibility (IDirect3DDevice7 *iface, D3DVECTOR *centers, D3DVALUE *radii, DWORD sphere_count, DWORD flags, DWORD *return_values)
 
static HRESULT WINAPI d3d_device3_ComputeSphereVisibility (IDirect3DDevice3 *iface, D3DVECTOR *centers, D3DVALUE *radii, DWORD sphere_count, DWORD flags, DWORD *return_values)
 
static HRESULT d3d_device7_GetTexture (IDirect3DDevice7 *iface, DWORD stage, IDirectDrawSurface7 **texture)
 
static HRESULT WINAPI d3d_device7_GetTexture_FPUSetup (IDirect3DDevice7 *iface, DWORD stage, IDirectDrawSurface7 **Texture)
 
static HRESULT WINAPI d3d_device7_GetTexture_FPUPreserve (IDirect3DDevice7 *iface, DWORD stage, IDirectDrawSurface7 **Texture)
 
static HRESULT WINAPI d3d_device3_GetTexture (IDirect3DDevice3 *iface, DWORD stage, IDirect3DTexture2 **Texture2)
 
static HRESULT d3d_device7_SetTexture (IDirect3DDevice7 *iface, DWORD stage, IDirectDrawSurface7 *texture)
 
static HRESULT WINAPI d3d_device7_SetTexture_FPUSetup (IDirect3DDevice7 *iface, DWORD stage, IDirectDrawSurface7 *texture)
 
static HRESULT WINAPI d3d_device7_SetTexture_FPUPreserve (IDirect3DDevice7 *iface, DWORD stage, IDirectDrawSurface7 *texture)
 
static HRESULT WINAPI d3d_device3_SetTexture (IDirect3DDevice3 *iface, DWORD stage, IDirect3DTexture2 *texture)
 
static HRESULT d3d_device7_GetTextureStageState (IDirect3DDevice7 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD *value)
 
static HRESULT WINAPI d3d_device7_GetTextureStageState_FPUSetup (IDirect3DDevice7 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD *value)
 
static HRESULT WINAPI d3d_device7_GetTextureStageState_FPUPreserve (IDirect3DDevice7 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD *value)
 
static HRESULT WINAPI d3d_device3_GetTextureStageState (IDirect3DDevice3 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD *value)
 
static HRESULT d3d_device7_SetTextureStageState (IDirect3DDevice7 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d_device7_SetTextureStageState_FPUSetup (IDirect3DDevice7 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d_device7_SetTextureStageState_FPUPreserve (IDirect3DDevice7 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d_device3_SetTextureStageState (IDirect3DDevice3 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD value)
 
static HRESULT d3d_device7_ValidateDevice (IDirect3DDevice7 *iface, DWORD *pass_count)
 
static HRESULT WINAPI d3d_device7_ValidateDevice_FPUSetup (IDirect3DDevice7 *iface, DWORD *pass_count)
 
static HRESULT WINAPI d3d_device7_ValidateDevice_FPUPreserve (IDirect3DDevice7 *iface, DWORD *pass_count)
 
static HRESULT WINAPI d3d_device3_ValidateDevice (IDirect3DDevice3 *iface, DWORD *pass_count)
 
static HRESULT d3d_device7_Clear (IDirect3DDevice7 *iface, DWORD count, D3DRECT *rects, DWORD flags, D3DCOLOR color, D3DVALUE z, DWORD stencil)
 
static HRESULT WINAPI d3d_device7_Clear_FPUSetup (IDirect3DDevice7 *iface, DWORD count, D3DRECT *rects, DWORD flags, D3DCOLOR color, D3DVALUE z, DWORD stencil)
 
static HRESULT WINAPI d3d_device7_Clear_FPUPreserve (IDirect3DDevice7 *iface, DWORD count, D3DRECT *rects, DWORD flags, D3DCOLOR color, D3DVALUE z, DWORD stencil)
 
static HRESULT d3d_device7_SetViewport (IDirect3DDevice7 *iface, D3DVIEWPORT7 *viewport)
 
static HRESULT WINAPI d3d_device7_SetViewport_FPUSetup (IDirect3DDevice7 *iface, D3DVIEWPORT7 *viewport)
 
static HRESULT WINAPI d3d_device7_SetViewport_FPUPreserve (IDirect3DDevice7 *iface, D3DVIEWPORT7 *viewport)
 
static HRESULT d3d_device7_GetViewport (IDirect3DDevice7 *iface, D3DVIEWPORT7 *viewport)
 
static HRESULT WINAPI d3d_device7_GetViewport_FPUSetup (IDirect3DDevice7 *iface, D3DVIEWPORT7 *viewport)
 
static HRESULT WINAPI d3d_device7_GetViewport_FPUPreserve (IDirect3DDevice7 *iface, D3DVIEWPORT7 *viewport)
 
static HRESULT d3d_device7_SetMaterial (IDirect3DDevice7 *iface, D3DMATERIAL7 *material)
 
static HRESULT WINAPI d3d_device7_SetMaterial_FPUSetup (IDirect3DDevice7 *iface, D3DMATERIAL7 *material)
 
static HRESULT WINAPI d3d_device7_SetMaterial_FPUPreserve (IDirect3DDevice7 *iface, D3DMATERIAL7 *material)
 
static HRESULT d3d_device7_GetMaterial (IDirect3DDevice7 *iface, D3DMATERIAL7 *material)
 
static HRESULT WINAPI d3d_device7_GetMaterial_FPUSetup (IDirect3DDevice7 *iface, D3DMATERIAL7 *material)
 
static HRESULT WINAPI d3d_device7_GetMaterial_FPUPreserve (IDirect3DDevice7 *iface, D3DMATERIAL7 *material)
 
static HRESULT d3d_device7_SetLight (IDirect3DDevice7 *iface, DWORD light_idx, D3DLIGHT7 *light)
 
static HRESULT WINAPI d3d_device7_SetLight_FPUSetup (IDirect3DDevice7 *iface, DWORD light_idx, D3DLIGHT7 *light)
 
static HRESULT WINAPI d3d_device7_SetLight_FPUPreserve (IDirect3DDevice7 *iface, DWORD light_idx, D3DLIGHT7 *light)
 
static HRESULT d3d_device7_GetLight (IDirect3DDevice7 *iface, DWORD light_idx, D3DLIGHT7 *light)
 
static HRESULT WINAPI d3d_device7_GetLight_FPUSetup (IDirect3DDevice7 *iface, DWORD light_idx, D3DLIGHT7 *light)
 
static HRESULT WINAPI d3d_device7_GetLight_FPUPreserve (IDirect3DDevice7 *iface, DWORD light_idx, D3DLIGHT7 *light)
 
static HRESULT d3d_device7_BeginStateBlock (IDirect3DDevice7 *iface)
 
static HRESULT WINAPI d3d_device7_BeginStateBlock_FPUSetup (IDirect3DDevice7 *iface)
 
static HRESULT WINAPI d3d_device7_BeginStateBlock_FPUPreserve (IDirect3DDevice7 *iface)
 
static HRESULT d3d_device7_EndStateBlock (IDirect3DDevice7 *iface, DWORD *stateblock)
 
static HRESULT WINAPI d3d_device7_EndStateBlock_FPUSetup (IDirect3DDevice7 *iface, DWORD *stateblock)
 
static HRESULT WINAPI d3d_device7_EndStateBlock_FPUPreserve (IDirect3DDevice7 *iface, DWORD *stateblock)
 
static HRESULT d3d_device7_PreLoad (IDirect3DDevice7 *iface, IDirectDrawSurface7 *texture)
 
static HRESULT WINAPI d3d_device7_PreLoad_FPUSetup (IDirect3DDevice7 *iface, IDirectDrawSurface7 *texture)
 
static HRESULT WINAPI d3d_device7_PreLoad_FPUPreserve (IDirect3DDevice7 *iface, IDirectDrawSurface7 *texture)
 
static HRESULT d3d_device7_ApplyStateBlock (IDirect3DDevice7 *iface, DWORD stateblock)
 
static HRESULT WINAPI d3d_device7_ApplyStateBlock_FPUSetup (IDirect3DDevice7 *iface, DWORD stateblock)
 
static HRESULT WINAPI d3d_device7_ApplyStateBlock_FPUPreserve (IDirect3DDevice7 *iface, DWORD stateblock)
 
static HRESULT d3d_device7_CaptureStateBlock (IDirect3DDevice7 *iface, DWORD stateblock)
 
static HRESULT WINAPI d3d_device7_CaptureStateBlock_FPUSetup (IDirect3DDevice7 *iface, DWORD stateblock)
 
static HRESULT WINAPI d3d_device7_CaptureStateBlock_FPUPreserve (IDirect3DDevice7 *iface, DWORD stateblock)
 
static HRESULT d3d_device7_DeleteStateBlock (IDirect3DDevice7 *iface, DWORD stateblock)
 
static HRESULT WINAPI d3d_device7_DeleteStateBlock_FPUSetup (IDirect3DDevice7 *iface, DWORD stateblock)
 
static HRESULT WINAPI d3d_device7_DeleteStateBlock_FPUPreserve (IDirect3DDevice7 *iface, DWORD stateblock)
 
static HRESULT d3d_device7_CreateStateBlock (IDirect3DDevice7 *iface, D3DSTATEBLOCKTYPE type, DWORD *stateblock)
 
static HRESULT WINAPI d3d_device7_CreateStateBlock_FPUSetup (IDirect3DDevice7 *iface, D3DSTATEBLOCKTYPE type, DWORD *stateblock)
 
static HRESULT WINAPI d3d_device7_CreateStateBlock_FPUPreserve (IDirect3DDevice7 *iface, D3DSTATEBLOCKTYPE type, DWORD *stateblock)
 
static BOOL is_mip_level_subset (struct ddraw_surface *dest, struct ddraw_surface *src)
 
static void copy_mipmap_chain (struct d3d_device *device, struct ddraw_surface *dst, struct ddraw_surface *src, const POINT *DestPoint, const RECT *SrcRect)
 
static HRESULT d3d_device7_Load (IDirect3DDevice7 *iface, IDirectDrawSurface7 *dst_texture, POINT *dst_pos, IDirectDrawSurface7 *src_texture, RECT *src_rect, DWORD flags)
 
static HRESULT WINAPI d3d_device7_Load_FPUSetup (IDirect3DDevice7 *iface, IDirectDrawSurface7 *dst_texture, POINT *dst_pos, IDirectDrawSurface7 *src_texture, RECT *src_rect, DWORD flags)
 
static HRESULT WINAPI d3d_device7_Load_FPUPreserve (IDirect3DDevice7 *iface, IDirectDrawSurface7 *dst_texture, POINT *dst_pos, IDirectDrawSurface7 *src_texture, RECT *src_rect, DWORD flags)
 
static HRESULT d3d_device7_LightEnable (IDirect3DDevice7 *iface, DWORD light_idx, BOOL enabled)
 
static HRESULT WINAPI d3d_device7_LightEnable_FPUSetup (IDirect3DDevice7 *iface, DWORD light_idx, BOOL enabled)
 
static HRESULT WINAPI d3d_device7_LightEnable_FPUPreserve (IDirect3DDevice7 *iface, DWORD light_idx, BOOL enabled)
 
static HRESULT d3d_device7_GetLightEnable (IDirect3DDevice7 *iface, DWORD light_idx, BOOL *enabled)
 
static HRESULT WINAPI d3d_device7_GetLightEnable_FPUSetup (IDirect3DDevice7 *iface, DWORD light_idx, BOOL *enabled)
 
static HRESULT WINAPI d3d_device7_GetLightEnable_FPUPreserve (IDirect3DDevice7 *iface, DWORD light_idx, BOOL *enabled)
 
static HRESULT d3d_device7_SetClipPlane (IDirect3DDevice7 *iface, DWORD idx, D3DVALUE *plane)
 
static HRESULT WINAPI d3d_device7_SetClipPlane_FPUSetup (IDirect3DDevice7 *iface, DWORD idx, D3DVALUE *plane)
 
static HRESULT WINAPI d3d_device7_SetClipPlane_FPUPreserve (IDirect3DDevice7 *iface, DWORD idx, D3DVALUE *plane)
 
static HRESULT d3d_device7_GetClipPlane (IDirect3DDevice7 *iface, DWORD idx, D3DVALUE *plane)
 
static HRESULT WINAPI d3d_device7_GetClipPlane_FPUSetup (IDirect3DDevice7 *iface, DWORD idx, D3DVALUE *plane)
 
static HRESULT WINAPI d3d_device7_GetClipPlane_FPUPreserve (IDirect3DDevice7 *iface, DWORD idx, D3DVALUE *plane)
 
static HRESULT WINAPI d3d_device7_GetInfo (IDirect3DDevice7 *iface, DWORD info_id, void *info, DWORD info_size)
 
struct d3d_deviceunsafe_impl_from_IDirect3DDevice7 (IDirect3DDevice7 *iface)
 
struct d3d_deviceunsafe_impl_from_IDirect3DDevice3 (IDirect3DDevice3 *iface)
 
struct d3d_deviceunsafe_impl_from_IDirect3DDevice2 (IDirect3DDevice2 *iface)
 
struct d3d_deviceunsafe_impl_from_IDirect3DDevice (IDirect3DDevice *iface)
 
enum wined3d_depth_buffer_type d3d_device_update_depth_stencil (struct d3d_device *device)
 
static HRESULT d3d_device_init (struct d3d_device *device, struct ddraw *ddraw, BOOL hw, struct ddraw_surface *target, IUnknown *rt_iface, UINT version, IUnknown *outer_unknown)
 
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)
 

Variables

const GUID IID_D3DDEVICE_WineD3D
 
static const struct tss_lookup tss_lookup []
 
static const struct IDirect3DDevice7Vtbl d3d_device7_fpu_setup_vtbl
 
static const struct IDirect3DDevice7Vtbl d3d_device7_fpu_preserve_vtbl
 
static const struct IDirect3DDevice3Vtbl d3d_device3_vtbl
 
static const struct IDirect3DDevice2Vtbl d3d_device2_vtbl
 
static const struct IDirect3DDeviceVtbl d3d_device1_vtbl
 
static const struct IUnknownVtbl d3d_device_inner_vtbl
 

Function Documentation

◆ check_d3ddevicedesc_size()

static BOOL check_d3ddevicedesc_size ( DWORD  size)
inlinestatic

Definition at line 461 of file device.c.

462{
463 if (size == FIELD_OFFSET(D3DDEVICEDESC, dwMinTextureWidth) /* 172 */
464 || size == FIELD_OFFSET(D3DDEVICEDESC, dwMaxTextureRepeat) /* 204 */
465 || size == sizeof(D3DDEVICEDESC) /* 252 */) return TRUE;
466 return FALSE;
467}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
GLsizeiptr size
Definition: glext.h:5919
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

Referenced by d3d_device3_GetCaps().

◆ compute_sphere_visibility()

static void compute_sphere_visibility ( struct wined3d_vec4  plane[12],
DWORD  enabled_planes,
BOOL  equality,
D3DVECTOR centers,
D3DVALUE radii,
DWORD  sphere_count,
DWORD return_values 
)
static

Definition at line 4589 of file device.c.

4591{
4592 UINT i, j;
4593
4594 for (i = 0; i < sphere_count; ++i)
4595 {
4596 return_values[i] = 0;
4597 for (j = 0; j < 12; ++j)
4598 if (enabled_planes & 1u << j)
4599 return_values[i] |= in_plane(j, plane[j], centers[i], radii[i], equality);
4600 }
4601}
static DWORD in_plane(UINT idx, struct wined3d_vec4 p, D3DVECTOR center, D3DVALUE radius, BOOL equality)
Definition: device.c:4509
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 GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
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 GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
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 GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum GLint const GLfloat GLenum GLint const GLushort GLint GLint GLsizei GLsizei GLenum GLsizei GLsizei GLenum GLenum const GLvoid GLenum plane
Definition: glfuncs.h:270
unsigned int UINT
Definition: ndis.h:50

Referenced by d3d_device3_ComputeSphereVisibility(), and d3d_device7_ComputeSphereVisibility().

◆ copy_mipmap_chain()

static void copy_mipmap_chain ( struct d3d_device device,
struct ddraw_surface dst,
struct ddraw_surface src,
const POINT DestPoint,
const RECT SrcRect 
)
static

Definition at line 6058 of file device.c.

6060{
6061 struct ddraw_surface *dst_level, *src_level;
6063 DDSURFACEDESC2 ddsd;
6064 POINT point;
6065 RECT src_rect;
6066 HRESULT hr;
6067 IDirectDrawPalette *pal = NULL, *pal_src = NULL;
6068 DWORD ckeyflag;
6069 DDCOLORKEY ddckey;
6070
6071 /* Copy palette, if possible. */
6072 IDirectDrawSurface7_GetPalette(&src->IDirectDrawSurface7_iface, &pal_src);
6073 IDirectDrawSurface7_GetPalette(&dst->IDirectDrawSurface7_iface, &pal);
6074
6075 if (pal_src != NULL && pal != NULL)
6076 {
6077 PALETTEENTRY palent[256];
6078
6079 IDirectDrawPalette_GetEntries(pal_src, 0, 0, 256, palent);
6080 IDirectDrawPalette_SetEntries(pal, 0, 0, 256, palent);
6081 }
6082
6083 if (pal) IDirectDrawPalette_Release(pal);
6084 if (pal_src) IDirectDrawPalette_Release(pal_src);
6085
6086 /* Copy colorkeys, if present. */
6087 for (ckeyflag = DDCKEY_DESTBLT; ckeyflag <= DDCKEY_SRCOVERLAY; ckeyflag <<= 1)
6088 {
6089 hr = IDirectDrawSurface7_GetColorKey(&src->IDirectDrawSurface7_iface, ckeyflag, &ddckey);
6090
6091 if (SUCCEEDED(hr))
6092 {
6093 IDirectDrawSurface7_SetColorKey(&dst->IDirectDrawSurface7_iface, ckeyflag, &ddckey);
6094 }
6095 }
6096
6097 src_level = src;
6098 dst_level = dst;
6099
6100 point = *DestPoint;
6101 src_rect = *SrcRect;
6102
6103 for (;src_level && dst_level;)
6104 {
6105 if (src_level->surface_desc.dwWidth == dst_level->surface_desc.dwWidth
6106 && src_level->surface_desc.dwHeight == dst_level->surface_desc.dwHeight)
6107 {
6108 UINT src_w = src_rect.right - src_rect.left;
6109 UINT src_h = src_rect.bottom - src_rect.top;
6110 RECT dst_rect = {point.x, point.y, point.x + src_w, point.y + src_h};
6111
6112 if (FAILED(hr = wined3d_texture_blt(dst_level->wined3d_texture, dst_level->sub_resource_idx, &dst_rect,
6113 src_level->wined3d_texture, src_level->sub_resource_idx, &src_rect, 0, NULL, WINED3D_TEXF_POINT)))
6114 ERR("Blit failed, hr %#x.\n", hr);
6115
6118 IDirectDrawSurface7_GetAttachedSurface(&dst_level->IDirectDrawSurface7_iface, &ddsd.ddsCaps, &temp);
6119
6120 if (dst_level != dst)
6121 IDirectDrawSurface7_Release(&dst_level->IDirectDrawSurface7_iface);
6122
6124 }
6125
6128 IDirectDrawSurface7_GetAttachedSurface(&src_level->IDirectDrawSurface7_iface, &ddsd.ddsCaps, &temp);
6129
6130 if (src_level != src) IDirectDrawSurface7_Release(&src_level->IDirectDrawSurface7_iface);
6131
6133
6134 point.x /= 2;
6135 point.y /= 2;
6136
6137 src_rect.top /= 2;
6138 src_rect.left /= 2;
6139 src_rect.right = (src_rect.right + 1) / 2;
6140 src_rect.bottom = (src_rect.bottom + 1) / 2;
6141 }
6142
6143 if (src_level && src_level != src)
6144 IDirectDrawSurface7_Release(&src_level->IDirectDrawSurface7_iface);
6145 if (dst_level && dst_level != dst)
6146 IDirectDrawSurface7_Release(&dst_level->IDirectDrawSurface7_iface);
6147}
#define ERR(fmt,...)
Definition: precomp.h:57
struct ddraw_surface * unsafe_impl_from_IDirectDrawSurface7(IDirectDrawSurface7 *iface) DECLSPEC_HIDDEN
Definition: surface.c:5641
#define NULL
Definition: types.h:112
HRESULT CDECL wined3d_texture_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, const RECT *dst_rect, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, const RECT *src_rect, DWORD flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter)
Definition: texture.c:3262
POINTL point
Definition: edittest.c:50
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
DWORD IDirectDrawSurface7
Definition: vmrender.idl:20
static calc_node_t temp
Definition: rpn_ieee.c:38
#define DDSCAPS2_MIPMAPSUBLEVEL
Definition: ddraw.h:304
#define DDCKEY_SRCOVERLAY
Definition: ddraw.h:479
#define DDCKEY_DESTBLT
Definition: ddraw.h:476
#define DDSCAPS_TEXTURE
Definition: ddraw.h:262
HRESULT hr
Definition: shlfolder.c:183
DWORD dwCaps2
Definition: ddraw.h:733
DWORD dwCaps
Definition: ddraw.h:732
DWORD dwWidth
Definition: ddraw.h:1155
DWORD dwHeight
Definition: ddraw.h:1154
DDSCAPS2 ddsCaps
Definition: ddraw.h:1188
LONG y
Definition: windef.h:330
LONG x
Definition: windef.h:329
DDSURFACEDESC2 surface_desc
unsigned int sub_resource_idx
IDirectDrawSurface7 IDirectDrawSurface7_iface
struct wined3d_texture * wined3d_texture
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
@ WINED3D_TEXF_POINT
Definition: wined3d.h:686

Referenced by d3d_device7_Load().

◆ d3d_device1_AddRef()

static ULONG WINAPI d3d_device1_AddRef ( IDirect3DDevice *  iface)
static

Definition at line 214 of file device.c.

215{
217
218 TRACE("iface %p.\n", iface);
219
220 return IUnknown_AddRef(device->outer_unknown);
221}
static struct d3d_device * impl_from_IDirect3DDevice(IDirect3DDevice *iface)
#define TRACE(s)
Definition: solgame.cpp:4
Definition: devices.h:37

◆ d3d_device1_AddViewport()

static HRESULT WINAPI d3d_device1_AddViewport ( IDirect3DDevice *  iface,
IDirect3DViewport *  viewport 
)
static

Definition at line 772 of file device.c.

773{
776
777 TRACE("iface %p, viewport %p.\n", iface, viewport);
778
779 return d3d_device3_AddViewport(&device->IDirect3DDevice3_iface, &vp->IDirect3DViewport3_iface);
780}
struct d3d_viewport * unsafe_impl_from_IDirect3DViewport(IDirect3DViewport *iface) DECLSPEC_HIDDEN
Definition: viewport.c:1138
static HRESULT WINAPI d3d_device3_AddViewport(IDirect3DDevice3 *iface, IDirect3DViewport3 *viewport)
Definition: device.c:740
IDirect3DViewport3 IDirect3DViewport3_iface

◆ d3d_device1_BeginScene()

static HRESULT WINAPI d3d_device1_BeginScene ( IDirect3DDevice *  iface)
static

Definition at line 1516 of file device.c.

1517{
1519
1520 TRACE("iface %p.\n", iface);
1521
1522 return IDirect3DDevice7_BeginScene(&device->IDirect3DDevice7_iface);
1523}
#define IDirect3DDevice7_BeginScene(p)
Definition: d3d.h:1348

◆ d3d_device1_CreateExecuteBuffer()

static HRESULT WINAPI d3d_device1_CreateExecuteBuffer ( IDirect3DDevice *  iface,
D3DEXECUTEBUFFERDESC buffer_desc,
IDirect3DExecuteBuffer **  ExecuteBuffer,
IUnknown outer_unknown 
)
static

Definition at line 652 of file device.c.

654{
657 HRESULT hr;
658
659 TRACE("iface %p, buffer_desc %p, buffer %p, outer_unknown %p.\n",
660 iface, buffer_desc, ExecuteBuffer, outer_unknown);
661
662 if (outer_unknown)
664
665 /* Allocate the new Execute Buffer */
666 if (!(object = heap_alloc_zero(sizeof(*object))))
667 {
668 ERR("Failed to allocate execute buffer memory.\n");
669 return DDERR_OUTOFMEMORY;
670 }
671
672 hr = d3d_execute_buffer_init(object, device, buffer_desc);
673 if (FAILED(hr))
674 {
675 WARN("Failed to initialize execute buffer, hr %#x.\n", hr);
676 heap_free(object);
677 return hr;
678 }
679
680 *ExecuteBuffer = &object->IDirect3DExecuteBuffer_iface;
681
682 TRACE(" Returning IDirect3DExecuteBuffer at %p, implementation is at %p\n", *ExecuteBuffer, object);
683
684 return D3D_OK;
685}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define WARN(fmt,...)
Definition: precomp.h:61
#define D3D_OK
Definition: d3d.h:106
HRESULT d3d_execute_buffer_init(struct d3d_execute_buffer *execute_buffer, struct d3d_device *device, D3DEXECUTEBUFFERDESC *desc) DECLSPEC_HIDDEN
#define DDERR_OUTOFMEMORY
Definition: ddraw.h:111
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662

◆ d3d_device1_CreateMatrix()

static HRESULT WINAPI d3d_device1_CreateMatrix ( IDirect3DDevice *  iface,
D3DMATRIXHANDLE D3DMatHandle 
)
static

Definition at line 1273 of file device.c.

1274{
1277 DWORD h;
1278
1279 TRACE("iface %p, matrix_handle %p.\n", iface, D3DMatHandle);
1280
1281 if(!D3DMatHandle)
1282 return DDERR_INVALIDPARAMS;
1283
1284 if (!(matrix = heap_alloc_zero(sizeof(*matrix))))
1285 {
1286 ERR("Out of memory when allocating a D3DMATRIX\n");
1287 return DDERR_OUTOFMEMORY;
1288 }
1289
1291
1293 if (h == DDRAW_INVALID_HANDLE)
1294 {
1295 ERR("Failed to allocate a matrix handle.\n");
1298 return DDERR_OUTOFMEMORY;
1299 }
1300
1301 *D3DMatHandle = h + 1;
1302
1303 TRACE(" returning matrix handle %d\n", *D3DMatHandle);
1304
1306
1307 return D3D_OK;
1308}
DWORD ddraw_allocate_handle(struct ddraw_handle_table *t, void *object, enum ddraw_handle_type type) DECLSPEC_HIDDEN
Definition: main.c:113
#define DDRAW_INVALID_HANDLE
@ DDRAW_HANDLE_MATRIX
GLuint GLenum matrix
Definition: glext.h:9407
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368

◆ d3d_device1_DeleteMatrix()

static HRESULT WINAPI d3d_device1_DeleteMatrix ( IDirect3DDevice *  iface,
D3DMATRIXHANDLE  D3DMatHandle 
)
static

Definition at line 1428 of file device.c.

1429{
1431 D3DMATRIX *m;
1432
1433 TRACE("iface %p, matrix_handle %#x.\n", iface, D3DMatHandle);
1434
1436
1437 m = ddraw_free_handle(&device->handle_table, D3DMatHandle - 1, DDRAW_HANDLE_MATRIX);
1438 if (!m)
1439 {
1440 WARN("Invalid matrix handle.\n");
1442 return DDERR_INVALIDPARAMS;
1443 }
1444
1446
1447 heap_free(m);
1448
1449 return D3D_OK;
1450}
void * ddraw_free_handle(struct ddraw_handle_table *t, DWORD handle, enum ddraw_handle_type type) DECLSPEC_HIDDEN
Definition: main.c:156
const GLfloat * m
Definition: glext.h:10848

◆ d3d_device1_DeleteViewport()

static HRESULT WINAPI d3d_device1_DeleteViewport ( IDirect3DDevice *  iface,
IDirect3DViewport *  viewport 
)
static

Definition at line 848 of file device.c.

849{
852
853 TRACE("iface %p, viewport %p.\n", iface, viewport);
854
855 return d3d_device3_DeleteViewport(&device->IDirect3DDevice3_iface,
856 vp ? &vp->IDirect3DViewport3_iface : NULL);
857}
static HRESULT WINAPI d3d_device3_DeleteViewport(IDirect3DDevice3 *iface, IDirect3DViewport3 *viewport)
Definition: device.c:798

◆ d3d_device1_EndScene()

static HRESULT WINAPI DECLSPEC_HOTPATCH d3d_device1_EndScene ( IDirect3DDevice *  iface)
static

Definition at line 1589 of file device.c.

1590{
1592
1593 TRACE("iface %p.\n", iface);
1594
1595 return IDirect3DDevice7_EndScene(&device->IDirect3DDevice7_iface);
1596}
#define IDirect3DDevice7_EndScene(p)
Definition: d3d.h:1349

◆ d3d_device1_EnumTextureFormats()

static HRESULT WINAPI d3d_device1_EnumTextureFormats ( IDirect3DDevice *  iface,
LPD3DENUMTEXTUREFORMATSCALLBACK  callback,
void context 
)
static

Definition at line 1247 of file device.c.

1249{
1251
1252 TRACE("iface %p, callback %p, context %p.\n", iface, callback, context);
1253
1254 return d3d_device2_EnumTextureFormats(&device->IDirect3DDevice2_iface, callback, context);
1255}
static HRESULT WINAPI d3d_device2_EnumTextureFormats(IDirect3DDevice2 *iface, LPD3DENUMTEXTUREFORMATSCALLBACK callback, void *context)
Definition: device.c:1178
static IPrintDialogCallback callback
Definition: printdlg.c:326
Definition: http.c:7252

◆ d3d_device1_Execute()

static HRESULT WINAPI d3d_device1_Execute ( IDirect3DDevice *  iface,
IDirect3DExecuteBuffer *  ExecuteBuffer,
IDirect3DViewport *  viewport,
DWORD  flags 
)
static

Definition at line 702 of file device.c.

704{
707 struct d3d_viewport *viewport_impl = unsafe_impl_from_IDirect3DViewport(viewport);
708 HRESULT hr;
709
710 TRACE("iface %p, buffer %p, viewport %p, flags %#x.\n", iface, ExecuteBuffer, viewport, flags);
711
712 if(!buffer)
713 return DDERR_INVALIDPARAMS;
714
715 /* Execute... */
717 hr = d3d_execute_buffer_execute(buffer, device, viewport_impl);
719
720 return hr;
721}
struct d3d_execute_buffer * unsafe_impl_from_IDirect3DExecuteBuffer(IDirect3DExecuteBuffer *iface) DECLSPEC_HIDDEN
HRESULT d3d_execute_buffer_execute(struct d3d_execute_buffer *execute_buffer, struct d3d_device *device, struct d3d_viewport *viewport) DECLSPEC_HIDDEN
Definition: executebuffer.c:51
GLuint buffer
Definition: glext.h:5915
GLbitfield flags
Definition: glext.h:7161

◆ d3d_device1_GetCaps()

static HRESULT WINAPI d3d_device1_GetCaps ( IDirect3DDevice *  iface,
D3DDEVICEDESC hw_desc,
D3DDEVICEDESC hel_desc 
)
static

Definition at line 519 of file device.c.

521{
523
524 TRACE("iface %p, hw_desc %p, hel_desc %p.\n", iface, hw_desc, hel_desc);
525
526 return d3d_device3_GetCaps(&device->IDirect3DDevice3_iface, hw_desc, hel_desc);
527}
static HRESULT WINAPI d3d_device3_GetCaps(IDirect3DDevice3 *iface, D3DDEVICEDESC *HWDesc, D3DDEVICEDESC *HelDesc)
Definition: device.c:469

◆ d3d_device1_GetDirect3D()

static HRESULT WINAPI d3d_device1_GetDirect3D ( IDirect3DDevice *  iface,
IDirect3D **  d3d 
)
static

Definition at line 1660 of file device.c.

1661{
1663
1664 TRACE("iface %p, d3d %p.\n", iface, d3d);
1665
1666 if (!d3d)
1667 return DDERR_INVALIDPARAMS;
1668
1669 *d3d = &device->ddraw->IDirect3D_iface;
1670 IDirect3D_AddRef(*d3d);
1671
1672 TRACE("Returning interface %p.\n", *d3d);
1673 return D3D_OK;
1674}
#define IDirect3D_AddRef(p)
Definition: d3d.h:232

◆ d3d_device1_GetMatrix()

static HRESULT WINAPI d3d_device1_GetMatrix ( IDirect3DDevice *  iface,
D3DMATRIXHANDLE  D3DMatHandle,
D3DMATRIX D3DMatrix 
)
static

Definition at line 1386 of file device.c.

1388{
1390 D3DMATRIX *m;
1391
1392 TRACE("iface %p, matrix_handle %#x, matrix %p.\n", iface, D3DMatHandle, D3DMatrix);
1393
1394 if (!D3DMatrix) return DDERR_INVALIDPARAMS;
1395
1397
1398 m = ddraw_get_object(&device->handle_table, D3DMatHandle - 1, DDRAW_HANDLE_MATRIX);
1399 if (!m)
1400 {
1401 WARN("Invalid matrix handle.\n");
1403 return DDERR_INVALIDPARAMS;
1404 }
1405
1406 *D3DMatrix = *m;
1407
1409
1410 return D3D_OK;
1411}
void * ddraw_get_object(struct ddraw_handle_table *t, DWORD handle, enum ddraw_handle_type type) DECLSPEC_HIDDEN
Definition: main.c:182

◆ d3d_device1_GetPickRecords()

static HRESULT WINAPI d3d_device1_GetPickRecords ( IDirect3DDevice *  iface,
DWORD count,
D3DPICKRECORD records 
)
static

Definition at line 1010 of file device.c.

1012{
1013 FIXME("iface %p, count %p, records %p stub!\n", iface, count, records);
1014
1015 return D3D_OK;
1016}
#define FIXME(fmt,...)
Definition: precomp.h:53
GLuint GLuint GLsizei count
Definition: gl.h:1545

◆ d3d_device1_GetStats()

static HRESULT WINAPI d3d_device1_GetStats ( IDirect3DDevice *  iface,
D3DSTATS stats 
)
static

Definition at line 623 of file device.c.

624{
626
627 TRACE("iface %p, stats %p.\n", iface, stats);
628
629 return d3d_device3_GetStats(&device->IDirect3DDevice3_iface, stats);
630}
static HRESULT WINAPI d3d_device3_GetStats(IDirect3DDevice3 *iface, D3DSTATS *Stats)
Definition: device.c:597

◆ d3d_device1_Initialize()

static HRESULT WINAPI d3d_device1_Initialize ( IDirect3DDevice *  iface,
IDirect3D *  d3d,
GUID guid,
D3DDEVICEDESC device_desc 
)
static

Definition at line 387 of file device.c.

389{
390 /* It shouldn't be crucial, but print a FIXME, I'm interested if
391 * any game calls it and when. */
392 FIXME("iface %p, d3d %p, guid %s, device_desc %p nop!\n",
393 iface, d3d, debugstr_guid(guid), device_desc);
394
395 return D3D_OK;
396}
#define debugstr_guid
Definition: kernel32.h:35
const GUID * guid

◆ d3d_device1_NextViewport()

static HRESULT WINAPI d3d_device1_NextViewport ( IDirect3DDevice *  iface,
IDirect3DViewport *  viewport,
IDirect3DViewport **  next,
DWORD  flags 
)
static

Definition at line 947 of file device.c.

949{
952 IDirect3DViewport3 *res;
953 HRESULT hr;
954
955 TRACE("iface %p, viewport %p, next %p, flags %#x.\n",
956 iface, viewport, next, flags);
957
958 hr = d3d_device3_NextViewport(&device->IDirect3DDevice3_iface,
960 *next = (IDirect3DViewport *)res;
961 return hr;
962}
static HRESULT WINAPI d3d_device3_NextViewport(IDirect3DDevice3 *iface, IDirect3DViewport3 *Viewport3, IDirect3DViewport3 **lplpDirect3DViewport3, DWORD flags)
Definition: device.c:877
GLuint res
Definition: glext.h:9613
static unsigned __int64 next
Definition: rand_nt.c:6

◆ d3d_device1_Pick()

static HRESULT WINAPI d3d_device1_Pick ( IDirect3DDevice *  iface,
IDirect3DExecuteBuffer *  buffer,
IDirect3DViewport *  viewport,
DWORD  flags,
D3DRECT rect 
)
static

Definition at line 985 of file device.c.

987{
988 FIXME("iface %p, buffer %p, viewport %p, flags %#x, rect %s stub!\n",
989 iface, buffer, viewport, flags, wine_dbgstr_rect((RECT *)rect));
990
991 return D3D_OK;
992}
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
& rect
Definition: startmenu.cpp:1413

◆ d3d_device1_QueryInterface()

static HRESULT WINAPI d3d_device1_QueryInterface ( IDirect3DDevice *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 168 of file device.c.

169{
171
172 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
173
174 return IUnknown_QueryInterface(device->outer_unknown, riid, out);
175}
REFIID riid
Definition: atlbase.h:39
static FILE * out
Definition: regtests2xml.c:44

◆ d3d_device1_Release()

static ULONG WINAPI d3d_device1_Release ( IDirect3DDevice *  iface)
static

Definition at line 360 of file device.c.

361{
363
364 TRACE("iface %p.\n", iface);
365
366 return IUnknown_Release(device->outer_unknown);
367}

◆ d3d_device1_SetMatrix()

static HRESULT WINAPI d3d_device1_SetMatrix ( IDirect3DDevice *  iface,
D3DMATRIXHANDLE  D3DMatHandle,
D3DMATRIX D3DMatrix 
)
static

Definition at line 1328 of file device.c.

1330{
1331 struct d3d_device *This = impl_from_IDirect3DDevice(iface);
1332 D3DMATRIX *m;
1333
1334 TRACE("iface %p, matrix_handle %#x, matrix %p.\n", iface, D3DMatHandle, D3DMatrix);
1335
1336 if (!D3DMatrix) return DDERR_INVALIDPARAMS;
1337
1339
1340 m = ddraw_get_object(&This->handle_table, D3DMatHandle - 1, DDRAW_HANDLE_MATRIX);
1341 if (!m)
1342 {
1343 WARN("Invalid matrix handle.\n");
1345 return DDERR_INVALIDPARAMS;
1346 }
1347
1348 if (TRACE_ON(ddraw))
1349 dump_D3DMATRIX(D3DMatrix);
1350
1351 *m = *D3DMatrix;
1352
1353 if (D3DMatHandle == This->world)
1354 wined3d_device_set_transform(This->wined3d_device,
1355 WINED3D_TS_WORLD_MATRIX(0), (struct wined3d_matrix *)D3DMatrix);
1356
1357 if (D3DMatHandle == This->view)
1358 wined3d_device_set_transform(This->wined3d_device,
1359 WINED3D_TS_VIEW, (struct wined3d_matrix *)D3DMatrix);
1360
1361 if (D3DMatHandle == This->proj)
1362 wined3d_device_set_transform(This->wined3d_device,
1363 WINED3D_TS_PROJECTION, (struct wined3d_matrix *)D3DMatrix);
1364
1366
1367 return D3D_OK;
1368}
void dump_D3DMATRIX(const D3DMATRIX *mat) DECLSPEC_HIDDEN
Definition: utils.c:914
void CDECL wined3d_device_set_transform(struct wined3d_device *device, enum wined3d_transform_state d3dts, const struct wined3d_matrix *matrix)
Definition: device.c:1505
#define TRACE_ON(x)
Definition: compat.h:75
#define WINED3D_TS_WORLD_MATRIX(index)
Definition: wined3d.h:664
@ WINED3D_TS_PROJECTION
Definition: wined3d.h:649
@ WINED3D_TS_VIEW
Definition: wined3d.h:648

◆ d3d_device1_SwapTextureHandles()

static HRESULT WINAPI d3d_device1_SwapTextureHandles ( IDirect3DDevice *  iface,
IDirect3DTexture *  tex1,
IDirect3DTexture *  tex2 
)
static

Definition at line 565 of file device.c.

567{
571 IDirect3DTexture2 *t1 = surf1 ? &surf1->IDirect3DTexture2_iface : NULL;
572 IDirect3DTexture2 *t2 = surf2 ? &surf2->IDirect3DTexture2_iface : NULL;
573
574 TRACE("iface %p, tex1 %p, tex2 %p.\n", iface, tex1, tex2);
575
576 return d3d_device2_SwapTextureHandles(&device->IDirect3DDevice2_iface, t1, t2);
577}
struct ddraw_surface * unsafe_impl_from_IDirect3DTexture(IDirect3DTexture *iface) DECLSPEC_HIDDEN
Definition: surface.c:5728
static HRESULT WINAPI d3d_device2_SwapTextureHandles(IDirect3DDevice2 *iface, IDirect3DTexture2 *tex1, IDirect3DTexture2 *tex2)
Definition: device.c:541
IDirect3DTexture2 IDirect3DTexture2_iface

◆ d3d_device2_AddRef()

static ULONG WINAPI d3d_device2_AddRef ( IDirect3DDevice2 *  iface)
static

Definition at line 205 of file device.c.

206{
208
209 TRACE("iface %p.\n", iface);
210
211 return IUnknown_AddRef(device->outer_unknown);
212}
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)

◆ d3d_device2_AddViewport()

static HRESULT WINAPI d3d_device2_AddViewport ( IDirect3DDevice2 *  iface,
IDirect3DViewport2 *  viewport 
)
static

Definition at line 761 of file device.c.

763{
766
767 TRACE("iface %p, viewport %p.\n", iface, viewport);
768
769 return d3d_device3_AddViewport(&device->IDirect3DDevice3_iface, &vp->IDirect3DViewport3_iface);
770}
struct d3d_viewport * unsafe_impl_from_IDirect3DViewport2(IDirect3DViewport2 *iface) DECLSPEC_HIDDEN
Definition: viewport.c:1130

◆ d3d_device2_Begin()

static HRESULT WINAPI d3d_device2_Begin ( IDirect3DDevice2 *  iface,
D3DPRIMITIVETYPE  primitive_type,
D3DVERTEXTYPE  vertex_type,
DWORD  flags 
)
static

Definition at line 2110 of file device.c.

2112{
2114 DWORD fvf;
2115
2116 TRACE("iface %p, primitive_type %#x, vertex_type %#x, flags %#x.\n",
2118
2119 switch (vertex_type)
2120 {
2121 case D3DVT_VERTEX: fvf = D3DFVF_VERTEX; break;
2122 case D3DVT_LVERTEX: fvf = D3DFVF_LVERTEX; break;
2123 case D3DVT_TLVERTEX: fvf = D3DFVF_TLVERTEX; break;
2124 default:
2125 ERR("Unexpected vertex type %#x.\n", vertex_type);
2126 return DDERR_INVALIDPARAMS; /* Should never happen */
2127 };
2128
2129 return d3d_device3_Begin(&device->IDirect3DDevice3_iface, primitive_type, fvf, flags);
2130}
@ D3DVT_TLVERTEX
Definition: d3dtypes.h:816
@ D3DVT_LVERTEX
Definition: d3dtypes.h:815
@ D3DVT_VERTEX
Definition: d3dtypes.h:814
#define D3DFVF_VERTEX
Definition: d3dtypes.h:1328
#define D3DFVF_LVERTEX
Definition: d3dtypes.h:1329
#define D3DFVF_TLVERTEX
Definition: d3dtypes.h:1331
static HRESULT WINAPI d3d_device3_Begin(IDirect3DDevice3 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, DWORD flags)
Definition: device.c:2091
D3DPRIMITIVETYPE primitive_type
DWORD vertex_type

◆ d3d_device2_BeginIndexed()

static HRESULT WINAPI d3d_device2_BeginIndexed ( IDirect3DDevice2 *  iface,
D3DPRIMITIVETYPE  primitive_type,
D3DVERTEXTYPE  vertex_type,
void vertices,
DWORD  vertex_count,
DWORD  flags 
)
static

Definition at line 2162 of file device.c.

2165{
2167 DWORD fvf;
2168
2169 TRACE("iface %p, primitive_type %#x, vertex_type %#x, vertices %p, vertex_count %u, flags %#x stub!\n",
2170 iface, primitive_type, vertex_type, vertices, vertex_count, flags);
2171
2172 switch (vertex_type)
2173 {
2174 case D3DVT_VERTEX: fvf = D3DFVF_VERTEX; break;
2175 case D3DVT_LVERTEX: fvf = D3DFVF_LVERTEX; break;
2176 case D3DVT_TLVERTEX: fvf = D3DFVF_TLVERTEX; break;
2177 default:
2178 ERR("Unexpected vertex type %#x.\n", vertex_type);
2179 return DDERR_INVALIDPARAMS; /* Should never happen */
2180 };
2181
2182 return d3d_device3_BeginIndexed(&device->IDirect3DDevice3_iface,
2183 primitive_type, fvf, vertices, vertex_count, flags);
2184}
static HRESULT WINAPI d3d_device3_BeginIndexed(IDirect3DDevice3 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, DWORD flags)
Definition: device.c:2151
int vertex_count
Definition: d3drm.c:3367

◆ d3d_device2_BeginScene()

static HRESULT WINAPI d3d_device2_BeginScene ( IDirect3DDevice2 *  iface)
static

Definition at line 1507 of file device.c.

1508{
1510
1511 TRACE("iface %p.\n", iface);
1512
1513 return IDirect3DDevice7_BeginScene(&device->IDirect3DDevice7_iface);
1514}

◆ d3d_device2_DeleteViewport()

static HRESULT WINAPI d3d_device2_DeleteViewport ( IDirect3DDevice2 *  iface,
IDirect3DViewport2 *  viewport 
)
static

Definition at line 837 of file device.c.

838{
841
842 TRACE("iface %p, viewport %p.\n", iface, viewport);
843
844 return d3d_device3_DeleteViewport(&device->IDirect3DDevice3_iface,
845 vp ? &vp->IDirect3DViewport3_iface : NULL);
846}

◆ d3d_device2_DrawIndexedPrimitive()

static HRESULT WINAPI d3d_device2_DrawIndexedPrimitive ( IDirect3DDevice2 *  iface,
D3DPRIMITIVETYPE  primitive_type,
D3DVERTEXTYPE  vertex_type,
void vertices,
DWORD  vertex_count,
WORD indices,
DWORD  index_count,
DWORD  flags 
)
static

Definition at line 3805 of file device.c.

3808{
3810 DWORD fvf;
3811
3812 TRACE("iface %p, primitive_type %#x, vertex_type %#x, vertices %p, vertex_count %u, "
3813 "indices %p, index_count %u, flags %#x.\n",
3814 iface, primitive_type, vertex_type, vertices, vertex_count, indices, index_count, flags);
3815
3816 switch (vertex_type)
3817 {
3818 case D3DVT_VERTEX: fvf = D3DFVF_VERTEX; break;
3819 case D3DVT_LVERTEX: fvf = D3DFVF_LVERTEX; break;
3820 case D3DVT_TLVERTEX: fvf = D3DFVF_TLVERTEX; break;
3821 default:
3822 ERR("Unhandled vertex type %#x.\n", vertex_type);
3823 return DDERR_INVALIDPARAMS; /* Should never happen */
3824 }
3825
3826 return d3d_device3_DrawIndexedPrimitive(&device->IDirect3DDevice3_iface,
3827 primitive_type, fvf, vertices, vertex_count, indices, index_count, flags);
3828}
static HRESULT WINAPI d3d_device3_DrawIndexedPrimitive(IDirect3DDevice3 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, WORD *indices, DWORD index_count, DWORD flags)
Definition: device.c:3789
GLuint GLuint GLsizei GLenum const GLvoid * indices
Definition: gl.h:1545

◆ d3d_device2_DrawPrimitive()

static HRESULT WINAPI d3d_device2_DrawPrimitive ( IDirect3DDevice2 *  iface,
D3DPRIMITIVETYPE  primitive_type,
D3DVERTEXTYPE  vertex_type,
void vertices,
DWORD  vertex_count,
DWORD  flags 
)
static

Definition at line 3603 of file device.c.

3606{
3608 DWORD fvf;
3609
3610 TRACE("iface %p, primitive_type %#x, vertex_type %#x, vertices %p, vertex_count %u, flags %#x.\n",
3611 iface, primitive_type, vertex_type, vertices, vertex_count, flags);
3612
3613 switch (vertex_type)
3614 {
3615 case D3DVT_VERTEX: fvf = D3DFVF_VERTEX; break;
3616 case D3DVT_LVERTEX: fvf = D3DFVF_LVERTEX; break;
3617 case D3DVT_TLVERTEX: fvf = D3DFVF_TLVERTEX; break;
3618 default:
3619 FIXME("Unhandled vertex type %#x.\n", vertex_type);
3620 return DDERR_INVALIDPARAMS; /* Should never happen */
3621 }
3622
3623 return d3d_device3_DrawPrimitive(&device->IDirect3DDevice3_iface,
3624 primitive_type, fvf, vertices, vertex_count, flags);
3625}
static HRESULT WINAPI d3d_device3_DrawPrimitive(IDirect3DDevice3 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, DWORD flags)
Definition: device.c:3588

◆ d3d_device2_End()

static HRESULT WINAPI d3d_device2_End ( IDirect3DDevice2 *  iface,
DWORD  flags 
)
static

Definition at line 3858 of file device.c.

3859{
3861
3862 TRACE("iface %p, flags %#x.\n", iface, flags);
3863
3864 return d3d_device3_End(&device->IDirect3DDevice3_iface, flags);
3865}
static HRESULT WINAPI d3d_device3_End(IDirect3DDevice3 *iface, DWORD flags)
Definition: device.c:3848

◆ d3d_device2_EndScene()

static HRESULT WINAPI DECLSPEC_HOTPATCH d3d_device2_EndScene ( IDirect3DDevice2 *  iface)
static

Definition at line 1580 of file device.c.

1581{
1583
1584 TRACE("iface %p.\n", iface);
1585
1586 return IDirect3DDevice7_EndScene(&device->IDirect3DDevice7_iface);
1587}

◆ d3d_device2_EnumTextureFormats()

static HRESULT WINAPI d3d_device2_EnumTextureFormats ( IDirect3DDevice2 *  iface,
LPD3DENUMTEXTUREFORMATSCALLBACK  callback,
void context 
)
static

Definition at line 1178 of file device.c.

1180{
1183 HRESULT hr;
1184 unsigned int i;
1185
1186 static const enum wined3d_format_id FormatList[] =
1187 {
1188 /* 16 bit */
1193 /* 32 bit */
1196 /* 8 bit */
1199 /* FOURCC codes - Not in this version*/
1200 };
1201
1202 TRACE("iface %p, callback %p, context %p.\n", iface, callback, context);
1203
1204 if (!callback)
1205 return DDERR_INVALIDPARAMS;
1206
1208
1209 memset(&mode, 0, sizeof(mode));
1211 {
1213 WARN("Cannot get the current adapter format\n");
1214 return hr;
1215 }
1216
1217 for (i = 0; i < ARRAY_SIZE(FormatList); ++i)
1218 {
1220 mode.format_id, WINED3DUSAGE_TEXTURE, WINED3D_RTYPE_TEXTURE_2D, FormatList[i]) == D3D_OK)
1221 {
1222 DDSURFACEDESC sdesc;
1223
1224 memset(&sdesc, 0, sizeof(sdesc));
1225 sdesc.dwSize = sizeof(sdesc);
1226 sdesc.dwFlags = DDSD_PIXELFORMAT | DDSD_CAPS;
1227 sdesc.ddsCaps.dwCaps = DDSCAPS_TEXTURE;
1228 sdesc.ddpfPixelFormat.dwSize = sizeof(sdesc.ddpfPixelFormat);
1229 ddrawformat_from_wined3dformat(&sdesc.ddpfPixelFormat, FormatList[i]);
1230
1231 TRACE("Enumerating WineD3DFormat %d\n", FormatList[i]);
1232 hr = callback(&sdesc, context);
1233 if(hr != DDENUMRET_OK)
1234 {
1235 TRACE("Format enumeration cancelled by application\n");
1237 return D3D_OK;
1238 }
1239 }
1240 }
1241 TRACE("End of enumeration\n");
1243
1244 return D3D_OK;
1245}
#define ARRAY_SIZE(A)
Definition: main.h:20
void ddrawformat_from_wined3dformat(DDPIXELFORMAT *ddraw_format, enum wined3d_format_id wined3d_format) DECLSPEC_HIDDEN
Definition: utils.c:33
GLenum mode
Definition: glext.h:6217
#define DDSD_PIXELFORMAT
Definition: ddraw.h:216
#define DDENUMRET_OK
Definition: ddraw.h:189
#define DDSD_CAPS
Definition: ddraw.h:208
#define memset(x, y, z)
Definition: compat.h:39
HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_device_type device_type, enum wined3d_format_id adapter_format_id, DWORD usage, enum wined3d_resource_type resource_type, enum wined3d_format_id check_format_id)
Definition: directx.c:5334
HRESULT CDECL wined3d_get_adapter_display_mode(const struct wined3d *wined3d, UINT adapter_idx, struct wined3d_display_mode *mode, enum wined3d_display_rotation *rotation)
Definition: directx.c:4767
#define WINED3DADAPTER_DEFAULT
Definition: wined3d.h:857
@ WINED3D_RTYPE_TEXTURE_2D
Definition: wined3d.h:700
wined3d_format_id
Definition: wined3d.h:106
@ WINED3DFMT_B2G3R3_UNORM
Definition: wined3d.h:111
@ WINED3DFMT_B4G4R4A4_UNORM
Definition: wined3d.h:110
@ WINED3DFMT_B8G8R8A8_UNORM
Definition: wined3d.h:223
@ WINED3DFMT_B8G8R8X8_UNORM
Definition: wined3d.h:224
@ WINED3DFMT_B5G5R5X1_UNORM
Definition: wined3d.h:109
@ WINED3DFMT_B5G5R5A1_UNORM
Definition: wined3d.h:222
@ WINED3DFMT_B5G6R5_UNORM
Definition: wined3d.h:221
@ WINED3DFMT_P8_UINT
Definition: wined3d.h:117
@ WINED3D_DEVICE_TYPE_HAL
Definition: wined3d.h:87
#define WINED3DUSAGE_TEXTURE
Definition: wined3d.h:918

Referenced by d3d_device1_EnumTextureFormats().

◆ d3d_device2_GetCaps()

static HRESULT WINAPI d3d_device2_GetCaps ( IDirect3DDevice2 *  iface,
D3DDEVICEDESC hw_desc,
D3DDEVICEDESC hel_desc 
)
static

Definition at line 509 of file device.c.

511{
513
514 TRACE("iface %p, hw_desc %p, hel_desc %p.\n", iface, hw_desc, hel_desc);
515
516 return d3d_device3_GetCaps(&device->IDirect3DDevice3_iface, hw_desc, hel_desc);
517}

◆ d3d_device2_GetClipStatus()

static HRESULT WINAPI d3d_device2_GetClipStatus ( IDirect3DDevice2 *  iface,
D3DCLIPSTATUS clip_status 
)
static

Definition at line 3936 of file device.c.

3937{
3939
3940 TRACE("iface %p, clip_status %p.\n", iface, clip_status);
3941
3942 return IDirect3DDevice7_GetClipStatus(&device->IDirect3DDevice7_iface, clip_status);
3943}
#define IDirect3DDevice7_GetClipStatus(p, a)
Definition: d3d.h:1371

◆ d3d_device2_GetCurrentViewport()

static HRESULT WINAPI d3d_device2_GetCurrentViewport ( IDirect3DDevice2 *  iface,
IDirect3DViewport2 **  viewport 
)
static

Definition at line 1788 of file device.c.

1789{
1791
1792 TRACE("iface %p, viewport %p.\n", iface, viewport);
1793
1794 return d3d_device3_GetCurrentViewport(&device->IDirect3DDevice3_iface,
1795 (IDirect3DViewport3 **)viewport);
1796}
static HRESULT WINAPI d3d_device3_GetCurrentViewport(IDirect3DDevice3 *iface, IDirect3DViewport3 **viewport)
Definition: device.c:1766

◆ d3d_device2_GetDirect3D()

static HRESULT WINAPI d3d_device2_GetDirect3D ( IDirect3DDevice2 *  iface,
IDirect3D2 **  d3d 
)
static

Definition at line 1644 of file device.c.

1645{
1647
1648 TRACE("iface %p, d3d %p.\n", iface, d3d);
1649
1650 if (!d3d)
1651 return DDERR_INVALIDPARAMS;
1652
1653 *d3d = &device->ddraw->IDirect3D2_iface;
1654 IDirect3D2_AddRef(*d3d);
1655
1656 TRACE("Returning interface %p.\n", *d3d);
1657 return D3D_OK;
1658}
#define IDirect3D2_AddRef(p)
Definition: d3d.h:279

◆ d3d_device2_GetLightState()

static HRESULT WINAPI d3d_device2_GetLightState ( IDirect3DDevice2 *  iface,
D3DLIGHTSTATETYPE  state,
DWORD value 
)
static

Definition at line 3105 of file device.c.

3107{
3109
3110 TRACE("iface %p, state %#x, value %p.\n", iface, state, value);
3111
3112 return d3d_device3_GetLightState(&device->IDirect3DDevice3_iface, state, value);
3113}
static int state
Definition: maze.c:121
static HRESULT WINAPI d3d_device3_GetLightState(IDirect3DDevice3 *iface, D3DLIGHTSTATETYPE state, DWORD *value)
Definition: device.c:3041
Definition: pdh_main.c:94

◆ d3d_device2_GetRenderState()

static HRESULT WINAPI d3d_device2_GetRenderState ( IDirect3DDevice2 *  iface,
D3DRENDERSTATETYPE  state,
DWORD value 
)
static

Definition at line 2534 of file device.c.

2536{
2538
2539 TRACE("iface %p, state %#x, value %p.\n", iface, state, value);
2540
2541 return IDirect3DDevice3_GetRenderState(&device->IDirect3DDevice3_iface, state, value);
2542}
#define IDirect3DDevice3_GetRenderState(p, a, b)
Definition: d3d.h:1212

◆ d3d_device2_GetRenderTarget()

static HRESULT WINAPI d3d_device2_GetRenderTarget ( IDirect3DDevice2 *  iface,
IDirectDrawSurface **  RenderTarget 
)
static

Definition at line 2052 of file device.c.

2053{
2055 IDirectDrawSurface7 *RenderTarget7;
2056 struct ddraw_surface *RenderTargetImpl;
2057 HRESULT hr;
2058
2059 TRACE("iface %p, target %p.\n", iface, RenderTarget);
2060
2061 if(!RenderTarget)
2062 return DDERR_INVALIDPARAMS;
2063
2064 hr = d3d_device7_GetRenderTarget(&device->IDirect3DDevice7_iface, &RenderTarget7);
2065 if(hr != D3D_OK) return hr;
2066 RenderTargetImpl = impl_from_IDirectDrawSurface7(RenderTarget7);
2067 *RenderTarget = &RenderTargetImpl->IDirectDrawSurface_iface;
2068 IDirectDrawSurface_AddRef(*RenderTarget);
2069 IDirectDrawSurface7_Release(RenderTarget7);
2070 return D3D_OK;
2071}
static struct ddraw_surface * impl_from_IDirectDrawSurface7(IDirectDrawSurface7 *iface)
static HRESULT WINAPI d3d_device7_GetRenderTarget(IDirect3DDevice7 *iface, IDirectDrawSurface7 **RenderTarget)
Definition: device.c:2014
IDirectDrawSurface IDirectDrawSurface_iface

◆ d3d_device2_GetStats()

static HRESULT WINAPI d3d_device2_GetStats ( IDirect3DDevice2 *  iface,
D3DSTATS stats 
)
static

Definition at line 614 of file device.c.

615{
617
618 TRACE("iface %p, stats %p.\n", iface, stats);
619
620 return d3d_device3_GetStats(&device->IDirect3DDevice3_iface, stats);
621}

◆ d3d_device2_GetTransform()

static HRESULT WINAPI d3d_device2_GetTransform ( IDirect3DDevice2 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX matrix 
)
static

Definition at line 3321 of file device.c.

3323{
3325
3326 TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
3327
3328 return IDirect3DDevice3_GetTransform(&device->IDirect3DDevice3_iface, state, matrix);
3329}
#define IDirect3DDevice3_GetTransform(p, a, b)
Definition: d3d.h:1217

◆ d3d_device2_Index()

static HRESULT WINAPI d3d_device2_Index ( IDirect3DDevice2 *  iface,
WORD  index 
)
static

Definition at line 2262 of file device.c.

2263{
2265
2266 TRACE("iface %p, index %#x.\n", iface, index);
2267
2268 return d3d_device3_Index(&device->IDirect3DDevice3_iface, index);
2269}
static HRESULT WINAPI d3d_device3_Index(IDirect3DDevice3 *iface, WORD index)
Definition: device.c:2255
GLuint index
Definition: glext.h:6031

◆ d3d_device2_MultiplyTransform()

static HRESULT WINAPI d3d_device2_MultiplyTransform ( IDirect3DDevice2 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX matrix 
)
static

Definition at line 3427 of file device.c.

3429{
3431
3432 TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
3433
3434 return IDirect3DDevice3_MultiplyTransform(&device->IDirect3DDevice3_iface, state, matrix);
3435}
#define IDirect3DDevice3_MultiplyTransform(p, a, b)
Definition: d3d.h:1218

◆ d3d_device2_NextViewport()

static HRESULT WINAPI d3d_device2_NextViewport ( IDirect3DDevice2 *  iface,
IDirect3DViewport2 *  viewport,
IDirect3DViewport2 **  next,
DWORD  flags 
)
static

Definition at line 930 of file device.c.

932{
935 IDirect3DViewport3 *res;
936 HRESULT hr;
937
938 TRACE("iface %p, viewport %p, next %p, flags %#x.\n",
939 iface, viewport, next, flags);
940
941 hr = d3d_device3_NextViewport(&device->IDirect3DDevice3_iface,
943 *next = (IDirect3DViewport2 *)res;
944 return hr;
945}

◆ d3d_device2_QueryInterface()

static HRESULT WINAPI d3d_device2_QueryInterface ( IDirect3DDevice2 *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 159 of file device.c.

160{
162
163 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
164
165 return IUnknown_QueryInterface(device->outer_unknown, riid, out);
166}

◆ d3d_device2_Release()

static ULONG WINAPI d3d_device2_Release ( IDirect3DDevice2 *  iface)
static

Definition at line 351 of file device.c.

352{
354
355 TRACE("iface %p.\n", iface);
356
357 return IUnknown_Release(device->outer_unknown);
358}

◆ d3d_device2_SetClipStatus()

static HRESULT WINAPI d3d_device2_SetClipStatus ( IDirect3DDevice2 *  iface,
D3DCLIPSTATUS clip_status 
)
static

Definition at line 3899 of file device.c.

3900{
3902
3903 TRACE("iface %p, clip_status %p.\n", iface, clip_status);
3904
3905 return IDirect3DDevice7_SetClipStatus(&device->IDirect3DDevice7_iface, clip_status);
3906}
#define IDirect3DDevice7_SetClipStatus(p, a)
Definition: d3d.h:1370

◆ d3d_device2_SetCurrentViewport()

static HRESULT WINAPI d3d_device2_SetCurrentViewport ( IDirect3DDevice2 *  iface,
IDirect3DViewport2 *  viewport 
)
static

Definition at line 1740 of file device.c.

1741{
1744
1745 TRACE("iface %p, viewport %p.\n", iface, viewport);
1746
1747 return d3d_device3_SetCurrentViewport(&device->IDirect3DDevice3_iface,
1748 vp ? &vp->IDirect3DViewport3_iface : NULL);
1749}
static HRESULT WINAPI d3d_device3_SetCurrentViewport(IDirect3DDevice3 *iface, IDirect3DViewport3 *Direct3DViewport3)
Definition: device.c:1692

◆ d3d_device2_SetLightState()

static HRESULT WINAPI d3d_device2_SetLightState ( IDirect3DDevice2 *  iface,
D3DLIGHTSTATETYPE  state,
DWORD  value 
)
static

Definition at line 3013 of file device.c.

3015{
3017
3018 TRACE("iface %p, state %#x, value %#x.\n", iface, state, value);
3019
3020 return d3d_device3_SetLightState(&device->IDirect3DDevice3_iface, state, value);
3021}
static HRESULT WINAPI d3d_device3_SetLightState(IDirect3DDevice3 *iface, D3DLIGHTSTATETYPE state, DWORD value)
Definition: device.c:2925

◆ d3d_device2_SetRenderState()

static HRESULT WINAPI d3d_device2_SetRenderState ( IDirect3DDevice2 *  iface,
D3DRENDERSTATETYPE  state,
DWORD  value 
)
static

Definition at line 2897 of file device.c.

2899{
2901
2902 TRACE("iface %p, state %#x, value %#x.\n", iface, state, value);
2903
2904 return IDirect3DDevice3_SetRenderState(&device->IDirect3DDevice3_iface, state, value);
2905}
#define IDirect3DDevice3_SetRenderState(p, a, b)
Definition: d3d.h:1213

◆ d3d_device2_SetRenderTarget()

static HRESULT WINAPI d3d_device2_SetRenderTarget ( IDirect3DDevice2 *  iface,
IDirectDrawSurface *  target,
DWORD  flags 
)
static

Definition at line 1948 of file device.c.

1950{
1953 HRESULT hr;
1954
1955 TRACE("iface %p, target %p, flags %#x.\n", iface, target, flags);
1956
1958
1959 if (!validate_surface_palette(target_impl))
1960 {
1961 WARN("Surface %p has an indexed pixel format, but no palette.\n", target_impl);
1963 return DDERR_INVALIDCAPS;
1964 }
1965
1966 if (!(target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_3DDEVICE))
1967 {
1968 WARN("Surface %p is not a render target.\n", target_impl);
1970 return DDERR_INVALIDCAPS;
1971 }
1972
1973 if (target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_ZBUFFER)
1974 {
1975 WARN("Surface %p is a depth buffer.\n", target_impl);
1976 IUnknown_Release(device->rt_iface);
1977 device->rt_iface = (IUnknown *)target;
1980 }
1981
1982 if (device->hw && !(target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY))
1983 {
1984 WARN("Surface %p is not in video memory.\n", target_impl);
1985 IDirectDrawSurface_AddRef(target);
1986 IUnknown_Release(device->rt_iface);
1987 device->rt_iface = (IUnknown *)target;
1989 return D3D_OK;
1990 }
1991
1994 return hr;
1995}
struct ddraw_surface * unsafe_impl_from_IDirectDrawSurface(IDirectDrawSurface *iface) DECLSPEC_HIDDEN
Definition: surface.c:5705
static HRESULT d3d_device_set_render_target(struct d3d_device *device, struct ddraw_surface *target, IUnknown *rt_iface)
Definition: device.c:1804
static BOOL validate_surface_palette(struct ddraw_surface *surface)
Definition: device.c:1798
GLenum target
Definition: glext.h:7315
#define DDSCAPS_ZBUFFER
Definition: ddraw.h:267
#define DDERR_INVALIDPIXELFORMAT
Definition: ddraw.h:80
#define DDERR_INVALIDCAPS
Definition: ddraw.h:75
#define DDSCAPS_3DDEVICE
Definition: ddraw.h:263
#define DDSCAPS_VIDEOMEMORY
Definition: ddraw.h:264

◆ d3d_device2_SetTransform()

static HRESULT WINAPI d3d_device2_SetTransform ( IDirect3DDevice2 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX matrix 
)
static

Definition at line 3218 of file device.c.

3220{
3222
3223 TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
3224
3225 return IDirect3DDevice3_SetTransform(&device->IDirect3DDevice3_iface, state, matrix);
3226}
#define IDirect3DDevice3_SetTransform(p, a, b)
Definition: d3d.h:1216

◆ d3d_device2_SwapTextureHandles()

static HRESULT WINAPI d3d_device2_SwapTextureHandles ( IDirect3DDevice2 *  iface,
IDirect3DTexture2 *  tex1,
IDirect3DTexture2 *  tex2 
)
static

Definition at line 541 of file device.c.

543{
547 DWORD h1, h2;
548
549 TRACE("iface %p, tex1 %p, tex2 %p.\n", iface, tex1, tex2);
550
552
553 h1 = surf1->Handle - 1;
554 h2 = surf2->Handle - 1;
555 device->handle_table.entries[h1].object = surf2;
556 device->handle_table.entries[h2].object = surf1;
557 surf2->Handle = h1 + 1;
558 surf1->Handle = h2 + 1;
559
561
562 return D3D_OK;
563}
struct ddraw_surface * unsafe_impl_from_IDirect3DTexture2(IDirect3DTexture2 *iface) DECLSPEC_HIDDEN
Definition: surface.c:5721

Referenced by d3d_device1_SwapTextureHandles().

◆ d3d_device2_Vertex()

static HRESULT WINAPI d3d_device2_Vertex ( IDirect3DDevice2 *  iface,
void vertex 
)
static

Definition at line 2233 of file device.c.

2234{
2236
2237 TRACE("iface %p, vertex %p.\n", iface, vertex);
2238
2239 return d3d_device3_Vertex(&device->IDirect3DDevice3_iface, vertex);
2240}
static HRESULT WINAPI d3d_device3_Vertex(IDirect3DDevice3 *iface, void *vertex)
Definition: device.c:2203
Definition: mesh.c:4558

◆ d3d_device3_AddRef()

static ULONG WINAPI d3d_device3_AddRef ( IDirect3DDevice3 *  iface)
static

Definition at line 196 of file device.c.

197{
199
200 TRACE("iface %p.\n", iface);
201
202 return IUnknown_AddRef(device->outer_unknown);
203}
static struct d3d_device * impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface)

◆ d3d_device3_AddViewport()

static HRESULT WINAPI d3d_device3_AddViewport ( IDirect3DDevice3 *  iface,
IDirect3DViewport3 *  viewport 
)
static

Definition at line 740 of file device.c.

741{
744
745 TRACE("iface %p, viewport %p.\n", iface, viewport);
746
747 /* Sanity check */
748 if(!vp)
749 return DDERR_INVALIDPARAMS;
750
753 list_add_head(&device->viewport_list, &vp->entry);
754 /* Viewport must be usable for Clear() after AddViewport, so set active_device here. */
755 vp->active_device = device;
757
758 return D3D_OK;
759}
static void list_add_head(struct list_entry *head, struct list_entry *entry)
Definition: list.h:76
#define IDirect3DViewport3_AddRef(p)
Definition: d3d.h:826
struct d3d_viewport * unsafe_impl_from_IDirect3DViewport3(IDirect3DViewport3 *iface) DECLSPEC_HIDDEN
Definition: viewport.c:1123
struct d3d_device * active_device
struct list entry

Referenced by d3d_device1_AddViewport(), and d3d_device2_AddViewport().

◆ d3d_device3_Begin()

static HRESULT WINAPI d3d_device3_Begin ( IDirect3DDevice3 *  iface,
D3DPRIMITIVETYPE  primitive_type,
DWORD  fvf,
DWORD  flags 
)
static

Definition at line 2091 of file device.c.

2093{
2095
2096 TRACE("iface %p, primitive_type %#x, fvf %#x, flags %#x.\n",
2097 iface, primitive_type, fvf, flags);
2098
2100 device->primitive_type = primitive_type;
2101 device->vertex_type = fvf;
2102 device->render_flags = flags;
2103 device->vertex_size = get_flexible_vertex_size(device->vertex_type);
2104 device->nb_vertices = 0;
2106
2107 return D3D_OK;
2108}
DWORD get_flexible_vertex_size(DWORD d3dvtVertexType) DECLSPEC_HIDDEN
Definition: utils.c:923

Referenced by d3d_device2_Begin().

◆ d3d_device3_BeginIndexed()

static HRESULT WINAPI d3d_device3_BeginIndexed ( IDirect3DDevice3 *  iface,
D3DPRIMITIVETYPE  primitive_type,
DWORD  fvf,
void vertices,
DWORD  vertex_count,
DWORD  flags 
)
static

Definition at line 2151 of file device.c.

2154{
2155 FIXME("iface %p, primitive_type %#x, fvf %#x, vertices %p, vertex_count %u, flags %#x stub!\n",
2156 iface, primitive_type, fvf, vertices, vertex_count, flags);
2157
2158 return D3D_OK;
2159}

Referenced by d3d_device2_BeginIndexed().

◆ d3d_device3_BeginScene()

static HRESULT WINAPI d3d_device3_BeginScene ( IDirect3DDevice3 *  iface)
static

Definition at line 1498 of file device.c.

1499{
1501
1502 TRACE("iface %p.\n", iface);
1503
1504 return IDirect3DDevice7_BeginScene(&device->IDirect3DDevice7_iface);
1505}

◆ d3d_device3_ComputeSphereVisibility()

static HRESULT WINAPI d3d_device3_ComputeSphereVisibility ( IDirect3DDevice3 *  iface,
D3DVECTOR centers,
D3DVALUE radii,
DWORD  sphere_count,
DWORD  flags,
DWORD return_values 
)
static

Definition at line 4625 of file device.c.

4627{
4628 static const DWORD enabled_planes = 0x3f;
4629 struct wined3d_vec4 plane[6];
4630 unsigned int i, j;
4631
4632 TRACE("iface %p, centers %p, radii %p, sphere_count %u, flags %#x, return_values %p.\n",
4633 iface, centers, radii, sphere_count, flags, return_values);
4634
4636
4637 compute_sphere_visibility(plane, enabled_planes, TRUE, centers, radii, sphere_count, return_values);
4638 for (i = 0; i < sphere_count; ++i)
4639 {
4640 BOOL intersect_frustum = FALSE, outside_frustum = FALSE;
4641 DWORD d3d7_result = return_values[i];
4642
4643 return_values[i] = 0;
4644
4645 for (j = 0; j < 6; ++j)
4646 {
4647 DWORD clip = (d3d7_result >> j) & (D3DSTATUS_CLIPUNIONLEFT | D3DSTATUS_CLIPINTERSECTIONLEFT);
4648
4649 if (clip == D3DSTATUS_CLIPUNIONLEFT)
4650 {
4651 return_values[i] |= D3DVIS_INTERSECT_LEFT << j * 2;
4652 intersect_frustum = TRUE;
4653 }
4654 else if (clip)
4655 {
4656 return_values[i] |= D3DVIS_OUTSIDE_LEFT << j * 2;
4657 outside_frustum = TRUE;
4658 }
4659 }
4660 if (outside_frustum)
4661 return_values[i] |= D3DVIS_OUTSIDE_FRUSTUM;
4662 else if (intersect_frustum)
4663 return_values[i] |= D3DVIS_INTERSECT_FRUSTUM;
4664 }
4665 return D3D_OK;
4666}
#define D3DVIS_INTERSECT_LEFT
Definition: d3dtypes.h:1354
#define D3DSTATUS_CLIPINTERSECTIONLEFT
Definition: d3dtypes.h:434
#define D3DSTATUS_CLIPUNIONLEFT
Definition: d3dtypes.h:421
#define D3DVIS_OUTSIDE_FRUSTUM
Definition: d3dtypes.h:1352
#define D3DVIS_INTERSECT_FRUSTUM
Definition: d3dtypes.h:1351
#define D3DVIS_OUTSIDE_LEFT
Definition: d3dtypes.h:1355
static void prepare_clip_space_planes(struct d3d_device *device, struct wined3d_vec4 *plane)
Definition: device.c:4533
static void compute_sphere_visibility(struct wined3d_vec4 plane[12], DWORD enabled_planes, BOOL equality, D3DVECTOR *centers, D3DVALUE *radii, DWORD sphere_count, DWORD *return_values)
Definition: device.c:4589
unsigned int BOOL
Definition: ntddk_ex.h:94

◆ d3d_device3_DeleteViewport()

static HRESULT WINAPI d3d_device3_DeleteViewport ( IDirect3DDevice3 *  iface,
IDirect3DViewport3 *  viewport 
)
static

Definition at line 798 of file device.c.

799{
802
803 TRACE("iface %p, viewport %p.\n", iface, viewport);
804
805 if (!vp)
806 {
807 WARN("NULL viewport, returning DDERR_INVALIDPARAMS\n");
808 return DDERR_INVALIDPARAMS;
809 }
810
812
813 if (vp->active_device != device)
814 {
815 WARN("Viewport %p active device is %p.\n", vp, vp->active_device);
817 return DDERR_INVALIDPARAMS;
818 }
819
820 if (device->current_viewport == vp)
821 {
822 TRACE("Deleting current viewport, unsetting and releasing\n");
824 device->current_viewport = NULL;
825 }
826
827 vp->active_device = NULL;
828 list_remove(&vp->entry);
829
831
833
834 return D3D_OK;
835}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
#define IDirect3DViewport3_Release(p)
Definition: d3d.h:827

Referenced by d3d_device1_DeleteViewport(), and d3d_device2_DeleteViewport().

◆ d3d_device3_DrawIndexedPrimitive()

static HRESULT WINAPI d3d_device3_DrawIndexedPrimitive ( IDirect3DDevice3 *  iface,
D3DPRIMITIVETYPE  primitive_type,
DWORD  fvf,
void vertices,
DWORD  vertex_count,
WORD indices,
DWORD  index_count,
DWORD  flags 
)
static

Definition at line 3789 of file device.c.

3792{
3794
3795 TRACE("iface %p, primitive_type %#x, fvf %#x, vertices %p, vertex_count %u, "
3796 "indices %p, index_count %u, flags %#x.\n",
3797 iface, primitive_type, fvf, vertices, vertex_count, indices, index_count, flags);
3798
3800
3801 return IDirect3DDevice7_DrawIndexedPrimitive(&device->IDirect3DDevice7_iface,
3802 primitive_type, fvf, vertices, vertex_count, indices, index_count, flags);
3803}
#define IDirect3DDevice7_DrawIndexedPrimitive(p, a, b, c, d, e, f, g)
Definition: d3d.h:1369
static void setup_lighting(const struct d3d_device *device, DWORD fvf, DWORD flags)
Definition: device.c:3576

Referenced by d3d_device2_DrawIndexedPrimitive().

◆ d3d_device3_DrawIndexedPrimitiveStrided()

static HRESULT WINAPI d3d_device3_DrawIndexedPrimitiveStrided ( IDirect3DDevice3 *  iface,
D3DPRIMITIVETYPE  PrimitiveType,
DWORD  VertexType,
D3DDRAWPRIMITIVESTRIDEDDATA D3DDrawPrimStrideData,
DWORD  VertexCount,
WORD Indices,
DWORD  IndexCount,
DWORD  Flags 
)
static

Definition at line 4238 of file device.c.

4242{
4244
4245 TRACE("iface %p, primitive_type %#x, FVF %#x, strided_data %p, vertex_count %u, indices %p, index_count %u, flags %#x.\n",
4246 iface, PrimitiveType, VertexType, D3DDrawPrimStrideData, VertexCount, Indices, IndexCount, Flags);
4247
4248 setup_lighting(device, VertexType, Flags);
4249
4250 return IDirect3DDevice7_DrawIndexedPrimitiveStrided(&device->IDirect3DDevice7_iface,
4251 PrimitiveType, VertexType, D3DDrawPrimStrideData, VertexCount, Indices, IndexCount, Flags);
4252}
#define IDirect3DDevice7_DrawIndexedPrimitiveStrided(p, a, b, c, d, e, f, g)
Definition: d3d.h:1373
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

◆ d3d_device3_DrawIndexedPrimitiveVB()

static HRESULT WINAPI d3d_device3_DrawIndexedPrimitiveVB ( IDirect3DDevice3 *  iface,
D3DPRIMITIVETYPE  PrimitiveType,
IDirect3DVertexBuffer *  D3DVertexBuf,
WORD Indices,
DWORD  IndexCount,
DWORD  Flags 
)
static

Definition at line 4466 of file device.c.

4469{
4471 struct d3d_vertex_buffer *vb = unsafe_impl_from_IDirect3DVertexBuffer7((IDirect3DVertexBuffer7 *)D3DVertexBuf);
4472
4473 TRACE("iface %p, primitive_type %#x, vb %p, indices %p, index_count %u, flags %#x.\n",
4474 iface, PrimitiveType, D3DVertexBuf, Indices, IndexCount, Flags);
4475
4477
4478 return IDirect3DDevice7_DrawIndexedPrimitiveVB(&device->IDirect3DDevice7_iface, PrimitiveType,
4479 &vb->IDirect3DVertexBuffer7_iface, 0, IndexCount, Indices, IndexCount, Flags);
4480}
#define IDirect3DDevice7_DrawIndexedPrimitiveVB(p, a, b, c, d, e, f, g)
Definition: d3d.h:1375
struct d3d_vertex_buffer * unsafe_impl_from_IDirect3DVertexBuffer7(IDirect3DVertexBuffer7 *iface) DECLSPEC_HIDDEN
Definition: vertexbuffer.c:486
IDirect3DVertexBuffer7 IDirect3DVertexBuffer7_iface

◆ d3d_device3_DrawPrimitive()

static HRESULT WINAPI d3d_device3_DrawPrimitive ( IDirect3DDevice3 *  iface,
D3DPRIMITIVETYPE  primitive_type,
DWORD  fvf,
void vertices,
DWORD  vertex_count,
DWORD  flags 
)
static

Definition at line 3588 of file device.c.

3591{
3593
3594 TRACE("iface %p, primitive_type %#x, fvf %#x, vertices %p, vertex_count %u, flags %#x.\n",
3595 iface, primitive_type, fvf, vertices, vertex_count, flags);
3596
3598
3599 return IDirect3DDevice7_DrawPrimitive(&device->IDirect3DDevice7_iface,
3600 primitive_type, fvf, vertices, vertex_count, flags);
3601}
#define IDirect3DDevice7_DrawPrimitive(p, a, b, c, d, e)
Definition: d3d.h:1368

Referenced by d3d_device2_DrawPrimitive(), and d3d_device3_End().

◆ d3d_device3_DrawPrimitiveStrided()

static HRESULT WINAPI d3d_device3_DrawPrimitiveStrided ( IDirect3DDevice3 *  iface,
D3DPRIMITIVETYPE  PrimitiveType,
DWORD  VertexType,
D3DDRAWPRIMITIVESTRIDEDDATA D3DDrawPrimStrideData,
DWORD  VertexCount,
DWORD  Flags 
)
static

Definition at line 4101 of file device.c.

4104{
4106
4107 TRACE("iface %p, primitive_type %#x, FVF %#x, strided_data %p, vertex_count %u, flags %#x.\n",
4108 iface, PrimitiveType, VertexType, D3DDrawPrimStrideData, VertexCount, Flags);
4109
4110 setup_lighting(device, VertexType, Flags);
4111
4112 return IDirect3DDevice7_DrawPrimitiveStrided(&device->IDirect3DDevice7_iface,
4113 PrimitiveType, VertexType, D3DDrawPrimStrideData, VertexCount, Flags);
4114}
#define IDirect3DDevice7_DrawPrimitiveStrided(p, a, b, c, d, e)
Definition: d3d.h:1372

◆ d3d_device3_DrawPrimitiveVB()

static HRESULT WINAPI d3d_device3_DrawPrimitiveVB ( IDirect3DDevice3 *  iface,
D3DPRIMITIVETYPE  PrimitiveType,
IDirect3DVertexBuffer *  D3DVertexBuf,
DWORD  StartVertex,
DWORD  NumVertices,
DWORD  Flags 
)
static

Definition at line 4330 of file device.c.

4332{
4334 struct d3d_vertex_buffer *vb = unsafe_impl_from_IDirect3DVertexBuffer7((IDirect3DVertexBuffer7 *)D3DVertexBuf);
4335
4336 TRACE("iface %p, primitive_type %#x, vb %p, start_vertex %u, vertex_count %u, flags %#x.\n",
4337 iface, PrimitiveType, D3DVertexBuf, StartVertex, NumVertices, Flags);
4338
4340
4341 return IDirect3DDevice7_DrawPrimitiveVB(&device->IDirect3DDevice7_iface,
4342 PrimitiveType, &vb->IDirect3DVertexBuffer7_iface, StartVertex, NumVertices, Flags);
4343}
#define IDirect3DDevice7_DrawPrimitiveVB(p, a, b, c, d, e)
Definition: d3d.h:1374

◆ d3d_device3_End()

static HRESULT WINAPI d3d_device3_End ( IDirect3DDevice3 *  iface,
DWORD  flags 
)
static

Definition at line 3848 of file device.c.

3849{
3851
3852 TRACE("iface %p, flags %#x.\n", iface, flags);
3853
3854 return d3d_device3_DrawPrimitive(&device->IDirect3DDevice3_iface, device->primitive_type,
3855 device->vertex_type, device->sysmem_vertex_buffer, device->nb_vertices, device->render_flags);
3856}

Referenced by d3d_device2_End().

◆ d3d_device3_EndScene()

static HRESULT WINAPI DECLSPEC_HOTPATCH d3d_device3_EndScene ( IDirect3DDevice3 *  iface)
static

Definition at line 1571 of file device.c.

1572{
1574
1575 TRACE("iface %p.\n", iface);
1576
1577 return IDirect3DDevice7_EndScene(&device->IDirect3DDevice7_iface);
1578}

◆ d3d_device3_EnumTextureFormats()

static HRESULT WINAPI d3d_device3_EnumTextureFormats ( IDirect3DDevice3 *  iface,
LPD3DENUMPIXELFORMATSCALLBACK  callback,
void context 
)
static

Definition at line 1158 of file device.c.

1160{
1162
1163 TRACE("iface %p, callback %p, context %p.\n", iface, callback, context);
1164
1165 return IDirect3DDevice7_EnumTextureFormats(&device->IDirect3DDevice7_iface, callback, context);
1166}
#define IDirect3DDevice7_EnumTextureFormats(p, a, b)
Definition: d3d.h:1347

◆ d3d_device3_GetCaps()

static HRESULT WINAPI d3d_device3_GetCaps ( IDirect3DDevice3 *  iface,
D3DDEVICEDESC HWDesc,
D3DDEVICEDESC HelDesc 
)
static

Definition at line 469 of file device.c.

471{
473 D3DDEVICEDESC7 desc7;
474 D3DDEVICEDESC desc1;
475 HRESULT hr;
476
477 TRACE("iface %p, hw_desc %p, hel_desc %p.\n", iface, HWDesc, HelDesc);
478
479 if (!HWDesc)
480 {
481 WARN("HWDesc is NULL, returning DDERR_INVALIDPARAMS.\n");
482 return DDERR_INVALIDPARAMS;
483 }
484 if (!check_d3ddevicedesc_size(HWDesc->dwSize))
485 {
486 WARN("HWDesc->dwSize is %u, returning DDERR_INVALIDPARAMS.\n", HWDesc->dwSize);
487 return DDERR_INVALIDPARAMS;
488 }
489 if (!HelDesc)
490 {
491 WARN("HelDesc is NULL, returning DDERR_INVALIDPARAMS.\n");
492 return DDERR_INVALIDPARAMS;
493 }
494 if (!check_d3ddevicedesc_size(HelDesc->dwSize))
495 {
496 WARN("HelDesc->dwSize is %u, returning DDERR_INVALIDPARAMS.\n", HelDesc->dwSize);
497 return DDERR_INVALIDPARAMS;
498 }
499
500 if (FAILED(hr = ddraw_get_d3dcaps(device->ddraw, &desc7)))
501 return hr;
502
503 ddraw_d3dcaps1_from_7(&desc1, &desc7);
504 DD_STRUCT_COPY_BYSIZE(HWDesc, &desc1);
505 DD_STRUCT_COPY_BYSIZE(HelDesc, &desc1);
506 return D3D_OK;
507}
#define DD_STRUCT_COPY_BYSIZE(to, from)
HRESULT ddraw_get_d3dcaps(const struct ddraw *ddraw, D3DDEVICEDESC7 *caps)
Definition: ddraw.c:1252
void ddraw_d3dcaps1_from_7(D3DDEVICEDESC *caps1, D3DDEVICEDESC7 *caps7)
Definition: ddraw.c:1196
static BOOL check_d3ddevicedesc_size(DWORD size)
Definition: device.c:461
DWORD dwSize
Definition: d3dcaps.h:318

Referenced by d3d_device1_GetCaps(), and d3d_device2_GetCaps().

◆ d3d_device3_GetClipStatus()

static HRESULT WINAPI d3d_device3_GetClipStatus ( IDirect3DDevice3 *  iface,
D3DCLIPSTATUS clip_status 
)
static

Definition at line 3927 of file device.c.

3928{
3930
3931 TRACE("iface %p, clip_status %p.\n", iface, clip_status);
3932
3933 return IDirect3DDevice7_GetClipStatus(&device->IDirect3DDevice7_iface, clip_status);
3934}

◆ d3d_device3_GetCurrentViewport()

static HRESULT WINAPI d3d_device3_GetCurrentViewport ( IDirect3DDevice3 *  iface,
IDirect3DViewport3 **  viewport 
)
static

Definition at line 1766 of file device.c.

1767{
1769
1770 TRACE("iface %p, viewport %p.\n", iface, viewport);
1771
1773 if (!device->current_viewport)
1774 {
1776 WARN("No current viewport, returning D3DERR_NOCURRENTVIEWPORT\n");
1778 }
1779
1780 *viewport = &device->current_viewport->IDirect3DViewport3_iface;
1781 IDirect3DViewport3_AddRef(*viewport);
1782
1783 TRACE("Returning interface %p.\n", *viewport);
1785 return D3D_OK;
1786}
#define D3DERR_NOCURRENTVIEWPORT
Definition: d3d.h:160

Referenced by d3d_device2_GetCurrentViewport().

◆ d3d_device3_GetDirect3D()

static HRESULT WINAPI d3d_device3_GetDirect3D ( IDirect3DDevice3 *  iface,
IDirect3D3 **  d3d 
)
static

Definition at line 1628 of file device.c.

1629{
1631
1632 TRACE("iface %p, d3d %p.\n", iface, d3d);
1633
1634 if (!d3d)
1635 return DDERR_INVALIDPARAMS;
1636
1637 *d3d = &device->ddraw->IDirect3D3_iface;
1638 IDirect3D3_AddRef(*d3d);
1639
1640 TRACE("Returning interface %p.\n", *d3d);
1641 return D3D_OK;
1642}
#define IDirect3D3_AddRef(p)
Definition: d3d.h:329

◆ d3d_device3_GetLightState()

static HRESULT WINAPI d3d_device3_GetLightState ( IDirect3DDevice3 *  iface,
D3DLIGHTSTATETYPE  state,
DWORD value 
)
static

Definition at line 3041 of file device.c.

3043{
3045 HRESULT hr;
3046
3047 TRACE("iface %p, state %#x, value %p.\n", iface, state, value);
3048
3050 {
3051 TRACE("Unexpected Light State Type\n");
3052 return DDERR_INVALIDPARAMS;
3053 }
3054
3055 if (!value)
3056 return DDERR_INVALIDPARAMS;
3057
3060 {
3061 *value = device->material;
3062 }
3063 else if (state == D3DLIGHTSTATE_COLORMODEL)
3064 {
3066 }
3067 else
3068 {
3070 switch (state)
3071 {
3072 case D3DLIGHTSTATE_AMBIENT: /* 2 */
3074 break;
3075 case D3DLIGHTSTATE_FOGMODE: /* 4 */
3077 break;
3078 case D3DLIGHTSTATE_FOGSTART: /* 5 */
3080 break;
3081 case D3DLIGHTSTATE_FOGEND: /* 6 */
3083 break;
3084 case D3DLIGHTSTATE_FOGDENSITY: /* 7 */
3086 break;
3087 case D3DLIGHTSTATE_COLORVERTEX: /* 8 */
3089 break;
3090 default:
3091 FIXME("Unhandled D3DLIGHTSTATETYPE %#x.\n", state);
3093 return DDERR_INVALIDPARAMS;
3094 }
3095
3096 hr = IDirect3DDevice7_GetRenderState(&device->IDirect3DDevice7_iface, rs, value);
3098 return hr;
3099 }
3101
3102 return D3D_OK;
3103}
#define IDirect3DDevice7_GetRenderState(p, a, b)
Definition: d3d.h:1364
#define D3DCOLOR_RGB
Definition: d3dtypes.h:627
D3DRENDERSTATETYPE
Definition: d3dtypes.h:874
@ D3DLIGHTSTATE_MATERIAL
Definition: d3dtypes.h:861
@ D3DLIGHTSTATE_FOGSTART
Definition: d3dtypes.h:865
@ D3DLIGHTSTATE_COLORMODEL
Definition: d3dtypes.h:863
@ D3DLIGHTSTATE_FOGMODE
Definition: d3dtypes.h:864
@ D3DLIGHTSTATE_FOGDENSITY
Definition: d3dtypes.h:867
@ D3DLIGHTSTATE_FOGEND
Definition: d3dtypes.h:866
@ D3DLIGHTSTATE_AMBIENT
Definition: d3dtypes.h:862
@ D3DLIGHTSTATE_COLORVERTEX
Definition: d3dtypes.h:868
#define D3DRENDERSTATE_FOGVERTEXMODE
Definition: dx7todx8.h:49
#define D3DRENDERSTATE_COLORVERTEX
Definition: dx7todx8.h:34
#define D3DRENDERSTATE_FOGSTART
Definition: dx7todx8.h:47
#define D3DRENDERSTATE_FOGDENSITY
Definition: dx7todx8.h:44
#define D3DRENDERSTATE_AMBIENT
Definition: dx7todx8.h:30
#define D3DRENDERSTATE_FOGEND
Definition: dx7todx8.h:46

Referenced by d3d_device2_GetLightState().

◆ d3d_device3_GetRenderState()

static HRESULT WINAPI d3d_device3_GetRenderState ( IDirect3DDevice3 *  iface,
D3DRENDERSTATETYPE  state,
DWORD value 
)
static

Definition at line 2432 of file device.c.

2434{
2436
2437 TRACE("iface %p, state %#x, value %p.\n", iface, state, value);
2438
2439 switch (state)
2440 {
2442 {
2443 /* This state is wrapped to SetTexture in SetRenderState, so
2444 * it has to be wrapped to GetTexture here. */
2445 struct wined3d_texture *tex = NULL;
2446 *value = 0;
2447
2449 if ((tex = wined3d_device_get_texture(device->wined3d_device, 0)))
2450 {
2451 /* The parent of the texture is the IDirectDrawSurface7
2452 * interface of the ddraw surface. */
2454 if (parent)
2455 *value = parent->root->Handle;
2456 }
2458
2459 return D3D_OK;
2460 }
2461
2463 {
2464 /* D3DRENDERSTATE_TEXTUREMAPBLEND is mapped to texture state stages in SetRenderState; reverse
2465 the mapping to get the value. */
2466 DWORD colorop, colorarg1, colorarg2;
2467 DWORD alphaop, alphaarg1, alphaarg2;
2468
2470
2471 device->legacyTextureBlending = TRUE;
2472
2479
2480 if (colorop == WINED3D_TOP_SELECT_ARG1 && colorarg1 == WINED3DTA_TEXTURE
2481 && alphaop == WINED3D_TOP_SELECT_ARG1 && alphaarg1 == WINED3DTA_TEXTURE)
2483 else if (colorop == WINED3D_TOP_SELECT_ARG1 && colorarg1 == WINED3DTA_TEXTURE
2484 && alphaop == WINED3D_TOP_MODULATE
2485 && alphaarg1 == WINED3DTA_TEXTURE && alphaarg2 == WINED3DTA_CURRENT)
2487 else if (colorop == WINED3D_TOP_MODULATE
2488 && colorarg1 == WINED3DTA_TEXTURE && colorarg2 == WINED3DTA_CURRENT
2489 && alphaop == WINED3D_TOP_MODULATE
2490 && alphaarg1 == WINED3DTA_TEXTURE && alphaarg2 == WINED3DTA_CURRENT)
2492 else
2493 {
2494 struct wined3d_texture *tex = NULL;
2495 BOOL tex_alpha = FALSE;
2496 DDPIXELFORMAT ddfmt;
2497
2498 if ((tex = wined3d_device_get_texture(device->wined3d_device, 0)))
2499 {
2501
2503 ddfmt.dwSize = sizeof(ddfmt);
2504 ddrawformat_from_wined3dformat(&ddfmt, desc.format);
2505 if (ddfmt.u5.dwRGBAlphaBitMask)
2506 tex_alpha = TRUE;
2507 }
2508
2509 if (!(colorop == WINED3D_TOP_MODULATE
2510 && colorarg1 == WINED3DTA_TEXTURE && colorarg2 == WINED3DTA_CURRENT
2511 && alphaop == (tex_alpha ? WINED3D_TOP_SELECT_ARG1 : WINED3D_TOP_SELECT_ARG2)
2512 && alphaarg1 == WINED3DTA_TEXTURE && alphaarg2 == WINED3DTA_CURRENT))
2513 ERR("Unexpected texture stage state setup, returning D3DTBLEND_MODULATE - likely erroneous.\n");
2514
2516 }
2517
2519
2520 return D3D_OK;
2521 }
2522
2526 *value = 0xffffffff;
2527 return D3D_OK;
2528
2529 default:
2530 return IDirect3DDevice7_GetRenderState(&device->IDirect3DDevice7_iface, state, value);
2531 }
2532}
@ D3DRENDERSTATE_TEXTUREHANDLE
Definition: d3dtypes.h:875
@ D3DRENDERSTATE_TEXTUREMAPBLEND
Definition: d3dtypes.h:895
@ D3DTBLEND_DECALALPHA
Definition: d3dtypes.h:738
@ D3DTBLEND_MODULATE
Definition: d3dtypes.h:737
@ D3DTBLEND_DECAL
Definition: d3dtypes.h:736
@ D3DTBLEND_MODULATEALPHA
Definition: d3dtypes.h:739
DWORD CDECL wined3d_device_get_texture_stage_state(const struct wined3d_device *device, UINT stage, enum wined3d_texture_stage_state state)
Definition: device.c:3447
struct wined3d_texture *CDECL wined3d_device_get_texture(const struct wined3d_device *device, UINT stage)
Definition: device.c:3510
void CDECL wined3d_resource_get_desc(const struct wined3d_resource *resource, struct wined3d_resource_desc *desc)
Definition: resource.c:295
void *CDECL wined3d_texture_get_parent(const struct wined3d_texture *texture)
Definition: texture.c:1121
struct wined3d_resource *CDECL wined3d_texture_get_resource(struct wined3d_texture *texture)
Definition: texture.c:1052
r parent
Definition: btrfs.c:3010
#define D3DRENDERSTATE_LIGHTING
Definition: dx7todx8.h:51
#define D3DRENDERSTATE_NORMALIZENORMALS
Definition: dx7todx8.h:54
#define D3DRENDERSTATE_LOCALVIEWER
Definition: dx7todx8.h:53
static const WCHAR desc[]
Definition: protectdata.c:36
DWORD dwSize
Definition: ddraw.h:1070
DWORD dwRGBAlphaBitMask
Definition: ddraw.h:1113
@ WINED3D_TSS_COLOR_ARG2
Definition: wined3d.h:577
@ WINED3D_TSS_ALPHA_OP
Definition: wined3d.h:578
@ WINED3D_TSS_COLOR_OP
Definition: wined3d.h:575
@ WINED3D_TSS_ALPHA_ARG2
Definition: wined3d.h:580
@ WINED3D_TSS_COLOR_ARG1
Definition: wined3d.h:576
@ WINED3D_TSS_ALPHA_ARG1
Definition: wined3d.h:579
#define WINED3DTA_CURRENT
Definition: wined3d.h:868
@ WINED3D_TOP_SELECT_ARG1
Definition: wined3d.h:610
@ WINED3D_TOP_MODULATE
Definition: wined3d.h:612
@ WINED3D_TOP_SELECT_ARG2
Definition: wined3d.h:611
#define WINED3DTA_TEXTURE
Definition: wined3d.h:869

◆ d3d_device3_GetRenderTarget()

static HRESULT WINAPI d3d_device3_GetRenderTarget ( IDirect3DDevice3 *  iface,
IDirectDrawSurface4 **  RenderTarget 
)
static

Definition at line 2031 of file device.c.

2032{
2034 IDirectDrawSurface7 *RenderTarget7;
2035 struct ddraw_surface *RenderTargetImpl;
2036 HRESULT hr;
2037
2038 TRACE("iface %p, target %p.\n", iface, RenderTarget);
2039
2040 if(!RenderTarget)
2041 return DDERR_INVALIDPARAMS;
2042
2043 hr = d3d_device7_GetRenderTarget(&device->IDirect3DDevice7_iface, &RenderTarget7);
2044 if(hr != D3D_OK) return hr;
2045 RenderTargetImpl = impl_from_IDirectDrawSurface7(RenderTarget7);
2046 *RenderTarget = &RenderTargetImpl->IDirectDrawSurface4_iface;
2047 IDirectDrawSurface4_AddRef(*RenderTarget);
2048 IDirectDrawSurface7_Release(RenderTarget7);
2049 return D3D_OK;
2050}
IDirectDrawSurface4 IDirectDrawSurface4_iface

◆ d3d_device3_GetStats()

static HRESULT WINAPI d3d_device3_GetStats ( IDirect3DDevice3 *  iface,
D3DSTATS Stats 
)
static

Definition at line 597 of file device.c.

598{
599 FIXME("iface %p, stats %p stub!\n", iface, Stats);
600
601 if(!Stats)
602 return DDERR_INVALIDPARAMS;
603
604 /* Fill the Stats with 0 */
605 Stats->dwTrianglesDrawn = 0;
606 Stats->dwLinesDrawn = 0;
607 Stats->dwPointsDrawn = 0;
608 Stats->dwSpansDrawn = 0;
609 Stats->dwVerticesProcessed = 0;
610
611 return D3D_OK;
612}
DWORD dwTrianglesDrawn
Definition: d3dtypes.h:1249
DWORD dwLinesDrawn
Definition: d3dtypes.h:1250
DWORD dwVerticesProcessed
Definition: d3dtypes.h:1253
DWORD dwPointsDrawn
Definition: d3dtypes.h:1251
DWORD dwSpansDrawn
Definition: d3dtypes.h:1252

Referenced by d3d_device1_GetStats(), and d3d_device2_GetStats().

◆ d3d_device3_GetTexture()

static HRESULT WINAPI d3d_device3_GetTexture ( IDirect3DDevice3 *  iface,
DWORD  stage,
IDirect3DTexture2 **  Texture2 
)
static

Definition at line 4733 of file device.c.

4734{
4736 struct ddraw_surface *ret_val_impl;
4737 HRESULT ret;
4738 IDirectDrawSurface7 *ret_val;
4739
4740 TRACE("iface %p, stage %u, texture %p.\n", iface, stage, Texture2);
4741
4742 ret = IDirect3DDevice7_GetTexture(&device->IDirect3DDevice7_iface, stage, &ret_val);
4743
4744 ret_val_impl = unsafe_impl_from_IDirectDrawSurface7(ret_val);
4745 *Texture2 = ret_val_impl ? &ret_val_impl->IDirect3DTexture2_iface : NULL;
4746
4747 TRACE("Returning texture %p.\n", *Texture2);
4748
4749 return ret;
4750}
#define IDirect3DDevice7_GetTexture(p, a, b)
Definition: d3d.h:1377
int ret

◆ d3d_device3_GetTextureStageState()

static HRESULT WINAPI d3d_device3_GetTextureStageState ( IDirect3DDevice3 *  iface,
DWORD  stage,
D3DTEXTURESTAGESTATETYPE  state,
DWORD value 
)
static

Definition at line 5022 of file device.c.

5024{
5026
5027 TRACE("iface %p, stage %u, state %#x, value %p.\n",
5028 iface, stage, state, value);
5029
5030 return IDirect3DDevice7_GetTextureStageState(&device->IDirect3DDevice7_iface, stage, state, value);
5031}
#define IDirect3DDevice7_GetTextureStageState(p, a, b, c)
Definition: d3d.h:1379

◆ d3d_device3_GetTransform()

static HRESULT WINAPI d3d_device3_GetTransform ( IDirect3DDevice3 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX matrix 
)
static

Definition at line 3300 of file device.c.

3302{
3304
3305 TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
3306
3307 if (!matrix)
3308 return DDERR_INVALIDPARAMS;
3309
3311 {
3313 *matrix = device->legacy_projection;
3315 return DD_OK;
3316 }
3317
3318 return IDirect3DDevice7_GetTransform(&device->IDirect3DDevice7_iface, state, matrix);
3319}
#define IDirect3DDevice7_GetTransform(p, a, b)
Definition: d3d.h:1355
#define D3DTRANSFORMSTATE_PROJECTION
Definition: dx7todx8.h:12
#define DD_OK
Definition: ddraw.h:186

◆ d3d_device3_Index()

static HRESULT WINAPI d3d_device3_Index ( IDirect3DDevice3 *  iface,
WORD  index 
)
static

Definition at line 2255 of file device.c.

2256{
2257 FIXME("iface %p, index %#x stub!\n", iface, index);
2258
2259 return D3D_OK;
2260}

Referenced by d3d_device2_Index().

◆ d3d_device3_MultiplyTransform()

static HRESULT WINAPI d3d_device3_MultiplyTransform ( IDirect3DDevice3 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX matrix 
)
static

Definition at line 3402 of file device.c.

3404{
3406
3407 TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
3408
3410 {
3411 D3DMATRIX projection, tmp;
3412
3414 multiply_matrix(&tmp, &device->legacy_projection, matrix);
3415 multiply_matrix(&projection, &device->legacy_clipspace, &tmp);
3416 wined3d_device_set_transform(device->wined3d_device,
3417 WINED3D_TS_PROJECTION, (struct wined3d_matrix *)&projection);
3418 device->legacy_projection = tmp;
3420
3421 return D3D_OK;
3422 }
3423
3424 return IDirect3DDevice7_MultiplyTransform(&device->IDirect3DDevice7_iface, state, matrix);
3425}
#define IDirect3DDevice7_MultiplyTransform(p, a, b)
Definition: d3d.h:1357
void multiply_matrix(D3DMATRIX *dst, const D3DMATRIX *src1, const D3DMATRIX *src2) DECLSPEC_HIDDEN
Definition: utils.c:1173

◆ d3d_device3_NextViewport()

static HRESULT WINAPI d3d_device3_NextViewport ( IDirect3DDevice3 *  iface,
IDirect3DViewport3 *  Viewport3,
IDirect3DViewport3 **  lplpDirect3DViewport3,
DWORD  flags 
)
static

Definition at line 877 of file device.c.

879{
882 struct d3d_viewport *next;
883 struct list *entry;
884
885 TRACE("iface %p, viewport %p, next %p, flags %#x.\n",
886 iface, Viewport3, lplpDirect3DViewport3, flags);
887
888 if(!vp)
889 {
890 *lplpDirect3DViewport3 = NULL;
891 return DDERR_INVALIDPARAMS;
892 }
893
894
896 switch (flags)
897 {
898 case D3DNEXT_NEXT:
899 entry = list_next(&This->viewport_list, &vp->entry);
900 break;
901
902 case D3DNEXT_HEAD:
903 entry = list_head(&This->viewport_list);
904 break;
905
906 case D3DNEXT_TAIL:
907 entry = list_tail(&This->viewport_list);
908 break;
909
910 default:
911 WARN("Invalid flags %#x.\n", flags);
912 *lplpDirect3DViewport3 = NULL;
914 return DDERR_INVALIDPARAMS;
915 }
916
917 if (entry)
918 {
920 *lplpDirect3DViewport3 = &next->IDirect3DViewport3_iface;
921 }
922 else
923 *lplpDirect3DViewport3 = NULL;
924
926
927 return D3D_OK;
928}
Definition: list.h:37
#define D3DNEXT_NEXT
Definition: d3d.h:192
#define D3DNEXT_TAIL
Definition: d3d.h:194
#define D3DNEXT_HEAD
Definition: d3d.h:193
uint32_t entry
Definition: isohybrid.c:63
__WINE_SERVER_LIST_INLINE struct list * list_next(const struct list *list, const struct list *elem)
Definition: list.h:115
__WINE_SERVER_LIST_INLINE struct list * list_tail(const struct list *list)
Definition: list.h:137
Definition: list.h:15
#define LIST_ENTRY(type)
Definition: queue.h:175

Referenced by d3d_device1_NextViewport(), and d3d_device2_NextViewport().

◆ d3d_device3_QueryInterface()

static HRESULT WINAPI d3d_device3_QueryInterface ( IDirect3DDevice3 *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 150 of file device.c.

151{
153
154 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
155
156 return IUnknown_QueryInterface(device->outer_unknown, riid, out);
157}

◆ d3d_device3_Release()

static ULONG WINAPI d3d_device3_Release ( IDirect3DDevice3 *  iface)
static

Definition at line 342 of file device.c.

343{
345
346 TRACE("iface %p.\n", iface);
347
348 return IUnknown_Release(device->outer_unknown);
349}

◆ d3d_device3_SetClipStatus()

static HRESULT WINAPI d3d_device3_SetClipStatus ( IDirect3DDevice3 *  iface,
D3DCLIPSTATUS clip_status 
)
static

Definition at line 3890 of file device.c.

3891{
3893
3894 TRACE("iface %p, clip_status %p.\n", iface, clip_status);
3895
3896 return IDirect3DDevice7_SetClipStatus(&device->IDirect3DDevice7_iface, clip_status);
3897}

◆ d3d_device3_SetCurrentViewport()

static HRESULT WINAPI d3d_device3_SetCurrentViewport ( IDirect3DDevice3 *  iface,
IDirect3DViewport3 *  Direct3DViewport3 
)
static

Definition at line 1692 of file device.c.

1693{
1695 struct d3d_viewport *vp = unsafe_impl_from_IDirect3DViewport3(Direct3DViewport3);
1696
1697 TRACE("iface %p, viewport %p.\n", iface, Direct3DViewport3);
1698
1699 if (!vp)
1700 {
1701 WARN("Direct3DViewport3 is NULL, returning DDERR_INVALIDPARAMS\n");
1702 return DDERR_INVALIDPARAMS;
1703 }
1704
1706 /* Do nothing if the specified viewport is the same as the current one */
1707 if (This->current_viewport == vp)
1708 {
1710 return D3D_OK;
1711 }
1712
1713 if (vp->active_device != This)
1714 {
1715 WARN("Viewport %p active device is %p.\n", vp, vp->active_device);
1717 return DDERR_INVALIDPARAMS;
1718 }
1719
1720 /* Release previous viewport and AddRef the new one */
1721 if (This->current_viewport)
1722 {
1723 TRACE("ViewportImpl is at %p, interface is at %p\n", This->current_viewport,
1724 &This->current_viewport->IDirect3DViewport3_iface);
1725 IDirect3DViewport3_Release(&This->current_viewport->IDirect3DViewport3_iface);
1726 }
1727 IDirect3DViewport3_AddRef(Direct3DViewport3);
1728
1729 /* Set this viewport as the current viewport */
1730 This->current_viewport = vp;
1731
1732 /* Activate this viewport */
1733 viewport_activate(This->current_viewport, FALSE);
1734
1736
1737 return D3D_OK;
1738}
void viewport_activate(struct d3d_viewport *viewport, BOOL ignore_lights) DECLSPEC_HIDDEN
Definition: viewport.c:55

Referenced by d3d_device2_SetCurrentViewport().

◆ d3d_device3_SetLightState()

static HRESULT WINAPI d3d_device3_SetLightState ( IDirect3DDevice3 *  iface,
D3DLIGHTSTATETYPE  state,
DWORD  value 
)
static

Definition at line 2925 of file device.c.

2927{
2929 HRESULT hr;
2930
2931 TRACE("iface %p, state %#x, value %#x.\n", iface, state, value);
2932
2934 {
2935 TRACE("Unexpected Light State Type\n");
2936 return DDERR_INVALIDPARAMS;
2937 }
2938
2941 {
2942 if (value)
2943 {
2944 struct d3d_material *m;
2945
2946 if (!(m = ddraw_get_object(&device->handle_table, value - 1, DDRAW_HANDLE_MATERIAL)))
2947 {
2948 WARN("Invalid material handle.\n");
2950 return DDERR_INVALIDPARAMS;
2951 }
2952
2954 }
2955
2956 device->material = value;
2957 }
2958 else if (state == D3DLIGHTSTATE_COLORMODEL)
2959 {
2960 switch (value)
2961 {
2962 case D3DCOLOR_MONO:
2963 ERR("DDCOLOR_MONO should not happen!\n");
2964 break;
2965 case D3DCOLOR_RGB:
2966 /* We are already in this mode */
2967 TRACE("Setting color model to RGB (no-op).\n");
2968 break;
2969 default:
2970 ERR("Unknown color model!\n");
2972 return DDERR_INVALIDPARAMS;
2973 }
2974 }
2975 else
2976 {
2978 switch (state)
2979 {
2980 case D3DLIGHTSTATE_AMBIENT: /* 2 */
2982 break;
2983 case D3DLIGHTSTATE_FOGMODE: /* 4 */
2985 break;
2986 case D3DLIGHTSTATE_FOGSTART: /* 5 */
2988 break;
2989 case D3DLIGHTSTATE_FOGEND: /* 6 */
2991 break;
2992 case D3DLIGHTSTATE_FOGDENSITY: /* 7 */
2994 break;
2995 case D3DLIGHTSTATE_COLORVERTEX: /* 8 */
2997 break;
2998 default:
2999 FIXME("Unhandled D3DLIGHTSTATETYPE %#x.\n", state);
3001 return DDERR_INVALIDPARAMS;
3002 }
3003
3004 hr = IDirect3DDevice7_SetRenderState(&device->IDirect3DDevice7_iface, rs, value);
3006 return hr;
3007 }
3009
3010 return D3D_OK;
3011}
#define IDirect3DDevice7_SetRenderState(p, a, b)
Definition: d3d.h:1363
#define D3DCOLOR_MONO
Definition: d3dtypes.h:626
void material_activate(struct d3d_material *material) DECLSPEC_HIDDEN
Definition: material.c:447
@ DDRAW_HANDLE_MATERIAL

Referenced by d3d_device2_SetLightState().

◆ d3d_device3_SetRenderState()

static HRESULT WINAPI d3d_device3_SetRenderState ( IDirect3DDevice3 *  iface,
D3DRENDERSTATETYPE  state,
DWORD  value 
)
static

Definition at line 2720 of file device.c.

2722{
2723 /* Note about D3DRENDERSTATE_TEXTUREMAPBLEND implementation: most of values
2724 for this state can be directly mapped to texture stage colorop and alphaop, but
2725 D3DTBLEND_MODULATE is tricky: it uses alpha from texture when available and alpha
2726 from diffuse otherwise. So changing the texture must be monitored in SetTexture to modify
2727 alphaarg when needed.
2728
2729 Aliens vs Predator 1 depends on accurate D3DTBLEND_MODULATE emulation
2730
2731 Legacy texture blending (TEXTUREMAPBLEND) and texture stage states: directx6 docs state that
2732 TEXTUREMAPBLEND is deprecated, yet can still be used. Games must not use both or results
2733 are undefined. D3DTBLEND_MODULATE mode in particular is dependent on texture pixel format and
2734 requires fixup of stage 0 texture states when texture changes, but this fixup can interfere
2735 with games not using this deprecated state. So a flag 'legacyTextureBlending' has to be kept
2736 in device - TRUE if the app is using TEXTUREMAPBLEND.
2737
2738 Tests show that setting TEXTUREMAPBLEND on native doesn't seem to change values returned by
2739 GetTextureStageState and vice versa. Not so on Wine, but it is 'undefined' anyway so, probably, ok,
2740 unless some broken game will be found that cares. */
2741
2743 HRESULT hr;
2744
2745 TRACE("iface %p, state %#x, value %#x.\n", iface, state, value);
2746
2748 {
2749 WARN("Unhandled state %#x.\n", state);
2750 return DDERR_INVALIDPARAMS;
2751 }
2752
2754
2755 switch (state)
2756 {
2758 {
2759 struct ddraw_surface *surf;
2760
2761 if (value == 0)
2762 {
2763 hr = wined3d_device_set_texture(device->wined3d_device, 0, NULL);
2764 break;
2765 }
2766
2767 surf = ddraw_get_object(&device->handle_table, value - 1, DDRAW_HANDLE_SURFACE);
2768 if (!surf)
2769 {
2770 WARN("Invalid texture handle.\n");
2772 break;
2773 }
2774
2776 break;
2777 }
2778
2780 {
2781 device->legacyTextureBlending = TRUE;
2782
2783 switch (value)
2784 {
2785 case D3DTBLEND_MODULATE:
2786 {
2787 struct wined3d_texture *tex = NULL;
2788 BOOL tex_alpha = FALSE;
2789 DDPIXELFORMAT ddfmt;
2790
2791 if ((tex = wined3d_device_get_texture(device->wined3d_device, 0)))
2792 {
2794
2796 ddfmt.dwSize = sizeof(ddfmt);
2797 ddrawformat_from_wined3dformat(&ddfmt, desc.format);
2798 if (ddfmt.u5.dwRGBAlphaBitMask)
2799 tex_alpha = TRUE;
2800 }
2801
2802 if (tex_alpha)
2805 else
2818 break;
2819 }
2820
2821 case D3DTBLEND_ADD:
2832 break;
2833
2847 break;
2848
2849 case D3DTBLEND_COPY:
2850 case D3DTBLEND_DECAL:
2859 break;
2860
2872 break;
2873
2874 default:
2875 FIXME("Unhandled texture environment %#x.\n", value);
2876 }
2877
2878 hr = D3D_OK;
2879 break;
2880 }
2881
2885 hr = D3D_OK;
2886 break;
2887
2888 default:
2889 hr = IDirect3DDevice7_SetRenderState(&device->IDirect3DDevice7_iface, state, value);
2890 break;
2891 }
2893
2894 return hr;
2895}
#define IDirect3DDevice3_SetTexture(p, a, b)
Definition: d3d.h:1229
@ D3DTBLEND_ADD
Definition: d3dtypes.h:743
@ D3DTBLEND_COPY
Definition: d3dtypes.h:742
#define D3DSTATE_OVERRIDE_BIAS
Definition: d3dtypes.h:834
@ DDRAW_HANDLE_SURFACE
HRESULT CDECL wined3d_device_set_texture(struct wined3d_device *device, UINT stage, struct wined3d_texture *texture)
Definition: device.c:3462
void CDECL wined3d_device_set_texture_stage_state(struct wined3d_device *device, UINT stage, enum wined3d_texture_stage_state state, DWORD value)
Definition: device.c:3405
@ WINED3D_TOP_ADD
Definition: wined3d.h:615
@ WINED3D_TOP_BLEND_TEXTURE_ALPHA
Definition: wined3d.h:621

◆ d3d_device3_SetRenderTarget()

static HRESULT WINAPI d3d_device3_SetRenderTarget ( IDirect3DDevice3 *  iface,
IDirectDrawSurface4 *  target,
DWORD  flags 
)
static

Definition at line 1898 of file device.c.

1900{
1903 HRESULT hr;
1904
1905 TRACE("iface %p, target %p, flags %#x.\n", iface, target, flags);
1906
1908
1909 if (!validate_surface_palette(target_impl))
1910 {
1911 WARN("Surface %p has an indexed pixel format, but no palette.\n", target_impl);
1913 return DDERR_INVALIDCAPS;
1914 }
1915
1916 if (!(target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_3DDEVICE))
1917 {
1918 WARN("Surface %p is not a render target.\n", target_impl);
1920 return DDERR_INVALIDCAPS;
1921 }
1922
1923 if (target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_ZBUFFER)
1924 {
1925 WARN("Surface %p is a depth buffer.\n", target_impl);
1926 IDirectDrawSurface4_AddRef(target);
1927 IUnknown_Release(device->rt_iface);
1928 device->rt_iface = (IUnknown *)target;
1931 }
1932
1933 if (device->hw && !(target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY))
1934 {
1935 WARN("Surface %p is not in video memory.\n", target_impl);
1936 IDirectDrawSurface4_AddRef(target);
1937 IUnknown_Release(device->rt_iface);
1938 device->rt_iface = (IUnknown *)target;
1940 return D3D_OK;
1941 }
1942
1945 return hr;
1946}
struct ddraw_surface * unsafe_impl_from_IDirectDrawSurface4(IDirectDrawSurface4 *iface) DECLSPEC_HIDDEN
Definition: surface.c:5657

◆ d3d_device3_SetTexture()

static HRESULT WINAPI d3d_device3_SetTexture ( IDirect3DDevice3 *  iface,
DWORD  stage,
IDirect3DTexture2 *  texture 
)
static

Definition at line 4806 of file device.c.

4808{
4811 DWORD texmapblend;
4812 HRESULT hr;
4813
4814 TRACE("iface %p, stage %u, texture %p.\n", iface, stage, texture);
4815
4817
4818 if (device->legacyTextureBlending)
4820
4821 hr = IDirect3DDevice7_SetTexture(&device->IDirect3DDevice7_iface, stage, &tex->IDirectDrawSurface7_iface);
4822
4823 if (device->legacyTextureBlending && texmapblend == D3DTBLEND_MODULATE)
4824 {
4825 /* This fixup is required by the way D3DTBLEND_MODULATE maps to texture stage states.
4826 See d3d_device3_SetRenderState() for details. */
4827 struct wined3d_texture *tex = NULL;
4828 BOOL tex_alpha = FALSE;
4829 DDPIXELFORMAT ddfmt;
4830
4831 if ((tex = wined3d_device_get_texture(device->wined3d_device, 0)))
4832 {
4834
4836 ddfmt.dwSize = sizeof(ddfmt);
4837 ddrawformat_from_wined3dformat(&ddfmt, desc.format);
4838 if (ddfmt.u5.dwRGBAlphaBitMask)
4839 tex_alpha = TRUE;
4840 }
4841
4842 /* Args 1 and 2 are already set to WINED3DTA_TEXTURE/WINED3DTA_CURRENT in case of D3DTBLEND_MODULATE */
4843 if (tex_alpha)
4846 else
4849 }
4850
4852
4853 return hr;
4854}
#define IDirect3DDevice7_SetTexture(p, a, b)
Definition: d3d.h:1378
GLenum GLuint texture
Definition: glext.h:6295

◆ d3d_device3_SetTextureStageState()

static HRESULT WINAPI d3d_device3_SetTextureStageState ( IDirect3DDevice3 *  iface,
DWORD  stage,
D3DTEXTURESTAGESTATETYPE  state,
DWORD  value 
)
static

Definition at line 5163 of file device.c.

5165{
5167
5168 TRACE("iface %p, stage %u, state %#x, value %#x.\n",
5169 iface, stage, state, value);
5170
5171 return IDirect3DDevice7_SetTextureStageState(&device->IDirect3DDevice7_iface, stage, state, value);
5172}
#define IDirect3DDevice7_SetTextureStageState(p, a, b, c)
Definition: d3d.h:1380

◆ d3d_device3_SetTransform()

static HRESULT WINAPI d3d_device3_SetTransform ( IDirect3DDevice3 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX matrix 
)
static

Definition at line 3191 of file device.c.

3193{
3195
3196 TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
3197
3198 if (!matrix)
3199 return DDERR_INVALIDPARAMS;
3200
3202 {
3203 D3DMATRIX projection;
3204
3206 multiply_matrix(&projection, &device->legacy_clipspace, matrix);
3207 wined3d_device_set_transform(device->wined3d_device,
3208 WINED3D_TS_PROJECTION, (struct wined3d_matrix *)&projection);
3209 device->legacy_projection = *matrix;
3211
3212 return D3D_OK;
3213 }
3214
3215 return IDirect3DDevice7_SetTransform(&device->IDirect3DDevice7_iface, state, matrix);
3216}
#define IDirect3DDevice7_SetTransform(p, a, b)
Definition: d3d.h:1354

◆ d3d_device3_ValidateDevice()

static HRESULT WINAPI d3d_device3_ValidateDevice ( IDirect3DDevice3 *  iface,
DWORD pass_count 
)
static

Definition at line 5222 of file device.c.

5223{
5225
5226 TRACE("iface %p, pass_count %p.\n", iface, pass_count);
5227
5228 return IDirect3DDevice7_ValidateDevice(&device->IDirect3DDevice7_iface, pass_count);
5229}
#define IDirect3DDevice7_ValidateDevice(p, a)
Definition: d3d.h:1381

◆ d3d_device3_Vertex()

static HRESULT WINAPI d3d_device3_Vertex ( IDirect3DDevice3 *  iface,
void vertex 
)
static

Definition at line 2203 of file device.c.

2204{
2206
2207 TRACE("iface %p, vertex %p.\n", iface, vertex);
2208
2209 if (!vertex)
2210 return DDERR_INVALIDPARAMS;
2211
2213 if ((device->nb_vertices + 1) * device->vertex_size > device->buffer_size)
2214 {
2215 BYTE *old_buffer;
2216
2217 device->buffer_size = device->buffer_size ? device->buffer_size * 2 : device->vertex_size * 3;
2218 old_buffer = device->sysmem_vertex_buffer;
2219 device->sysmem_vertex_buffer = heap_alloc(device->buffer_size);
2220 if (old_buffer)
2221 {
2222 memcpy(device->sysmem_vertex_buffer, old_buffer, device->nb_vertices * device->vertex_size);
2223 heap_free(old_buffer);
2224 }
2225 }
2226
2227 memcpy(device->sysmem_vertex_buffer + device->nb_vertices++ * device->vertex_size, vertex, device->vertex_size);
2229
2230 return D3D_OK;
2231}
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: xxhash.c:193

Referenced by d3d_device2_Vertex().

◆ d3d_device7_AddRef()

static ULONG WINAPI d3d_device7_AddRef ( IDirect3DDevice7 *  iface)
static

Definition at line 187 of file device.c.

188{
190
191 TRACE("iface %p.\n", iface);
192
193 return IUnknown_AddRef(device->outer_unknown);
194}
static struct d3d_device * impl_from_IDirect3DDevice7(IDirect3DDevice7 *iface)

◆ d3d_device7_ApplyStateBlock()

static HRESULT d3d_device7_ApplyStateBlock ( IDirect3DDevice7 *  iface,
DWORD  stateblock 
)
static

Definition at line 5776 of file device.c.

5777{
5779 struct wined3d_stateblock *wined3d_sb;
5780
5781 TRACE("iface %p, stateblock %#x.\n", iface, stateblock);
5782
5784 wined3d_sb = ddraw_get_object(&device->handle_table, stateblock - 1, DDRAW_HANDLE_STATEBLOCK);
5785 if (!wined3d_sb)
5786 {
5787 WARN("Invalid stateblock handle.\n");
5790 }
5791
5792 wined3d_stateblock_apply(wined3d_sb);
5794
5795 return D3D_OK;
5796}
#define D3DERR_INVALIDSTATEBLOCK
Definition: d3d.h:185
@ DDRAW_HANDLE_STATEBLOCK
void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock)
Definition: stateblock.c:965

Referenced by d3d_device7_ApplyStateBlock_FPUPreserve(), and d3d_device7_ApplyStateBlock_FPUSetup().

◆ d3d_device7_ApplyStateBlock_FPUPreserve()

static HRESULT WINAPI d3d_device7_ApplyStateBlock_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD  stateblock 
)
static

Definition at line 5803 of file device.c.

5804{
5805 HRESULT hr;
5806 WORD old_fpucw;
5807
5808 old_fpucw = d3d_fpu_setup();
5809 hr = d3d_device7_ApplyStateBlock(iface, stateblock);
5810 set_fpu_control_word(old_fpucw);
5811
5812 return hr;
5813}
static WORD d3d_fpu_setup(void)
Definition: device.c:55
static void set_fpu_control_word(WORD fpucw)
Definition: device.c:46
static HRESULT d3d_device7_ApplyStateBlock(IDirect3DDevice7 *iface, DWORD stateblock)
Definition: device.c:5776
unsigned short WORD
Definition: ntddk_ex.h:93

◆ d3d_device7_ApplyStateBlock_FPUSetup()

static HRESULT WINAPI d3d_device7_ApplyStateBlock_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD  stateblock 
)
static

Definition at line 5798 of file device.c.

5799{
5800 return d3d_device7_ApplyStateBlock(iface, stateblock);
5801}

◆ d3d_device7_BeginScene()

static HRESULT d3d_device7_BeginScene ( IDirect3DDevice7 *  iface)
static

Definition at line 1466 of file device.c.

1467{
1469 HRESULT hr;
1470
1471 TRACE("iface %p.\n", iface);
1472
1474 hr = wined3d_device_begin_scene(device->wined3d_device);
1476
1477 if(hr == WINED3D_OK) return D3D_OK;
1478 else return D3DERR_SCENE_IN_SCENE; /* TODO: Other possible causes of failure */
1479}
#define D3DERR_SCENE_IN_SCENE
Definition: d3d.h:151
HRESULT CDECL wined3d_device_begin_scene(struct wined3d_device *device)
Definition: device.c:3602
#define WINED3D_OK
Definition: wined3d.h:37

Referenced by d3d_device7_BeginScene_FPUPreserve(), and d3d_device7_BeginScene_FPUSetup().

◆ d3d_device7_BeginScene_FPUPreserve()

static HRESULT WINAPI d3d_device7_BeginScene_FPUPreserve ( IDirect3DDevice7 *  iface)
static

Definition at line 1486 of file device.c.

1487{
1488 HRESULT hr;
1489 WORD old_fpucw;
1490
1491 old_fpucw = d3d_fpu_setup();
1492 hr = d3d_device7_BeginScene(iface);
1493 set_fpu_control_word(old_fpucw);
1494
1495 return hr;
1496}
static HRESULT d3d_device7_BeginScene(IDirect3DDevice7 *iface)
Definition: device.c:1466

◆ d3d_device7_BeginScene_FPUSetup()

static HRESULT WINAPI d3d_device7_BeginScene_FPUSetup ( IDirect3DDevice7 *  iface)
static

Definition at line 1481 of file device.c.

1482{
1483 return d3d_device7_BeginScene(iface);
1484}

◆ d3d_device7_BeginStateBlock()

static HRESULT d3d_device7_BeginStateBlock ( IDirect3DDevice7 *  iface)
static

Definition at line 5611 of file device.c.

5612{
5614 HRESULT hr;
5615
5616 TRACE("iface %p.\n", iface);
5617
5619 hr = wined3d_device_begin_stateblock(device->wined3d_device);
5621
5622 return hr_ddraw_from_wined3d(hr);
5623}
HRESULT hr_ddraw_from_wined3d(HRESULT hr) DECLSPEC_HIDDEN
Definition: utils.c:1206
HRESULT CDECL wined3d_device_begin_stateblock(struct wined3d_device *device)
Definition: device.c:3555

Referenced by d3d_device7_BeginStateBlock_FPUPreserve(), and d3d_device7_BeginStateBlock_FPUSetup().

◆ d3d_device7_BeginStateBlock_FPUPreserve()

static HRESULT WINAPI d3d_device7_BeginStateBlock_FPUPreserve ( IDirect3DDevice7 *  iface)
static

Definition at line 5630 of file device.c.

5631{
5632 HRESULT hr;
5633 WORD old_fpucw;
5634
5635 old_fpucw = d3d_fpu_setup();
5637 set_fpu_control_word(old_fpucw);
5638
5639 return hr;
5640}
static HRESULT d3d_device7_BeginStateBlock(IDirect3DDevice7 *iface)
Definition: device.c:5611

◆ d3d_device7_BeginStateBlock_FPUSetup()

static HRESULT WINAPI d3d_device7_BeginStateBlock_FPUSetup ( IDirect3DDevice7 *  iface)
static

Definition at line 5625 of file device.c.

5626{
5627 return d3d_device7_BeginStateBlock(iface);
5628}

◆ d3d_device7_CaptureStateBlock()

static HRESULT d3d_device7_CaptureStateBlock ( IDirect3DDevice7 *  iface,
DWORD  stateblock 
)
static

Definition at line 5830 of file device.c.

5831{
5833 struct wined3d_stateblock *wined3d_sb;
5834
5835 TRACE("iface %p, stateblock %#x.\n", iface, stateblock);
5836
5838 wined3d_sb = ddraw_get_object(&device->handle_table, stateblock - 1, DDRAW_HANDLE_STATEBLOCK);
5839 if (!wined3d_sb)
5840 {
5841 WARN("Invalid stateblock handle.\n");
5844 }
5845
5846 wined3d_stateblock_capture(wined3d_sb);
5848
5849 return D3D_OK;
5850}
void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock)
Definition: stateblock.c:684

Referenced by d3d_device7_CaptureStateBlock_FPUPreserve(), and d3d_device7_CaptureStateBlock_FPUSetup().

◆ d3d_device7_CaptureStateBlock_FPUPreserve()

static HRESULT WINAPI d3d_device7_CaptureStateBlock_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD  stateblock 
)
static

Definition at line 5857 of file device.c.

5858{
5859 HRESULT hr;
5860 WORD old_fpucw;
5861
5862 old_fpucw = d3d_fpu_setup();
5863 hr = d3d_device7_CaptureStateBlock(iface, stateblock);
5864 set_fpu_control_word(old_fpucw);
5865
5866 return hr;
5867}
static HRESULT d3d_device7_CaptureStateBlock(IDirect3DDevice7 *iface, DWORD stateblock)
Definition: device.c:5830

◆ d3d_device7_CaptureStateBlock_FPUSetup()

static HRESULT WINAPI d3d_device7_CaptureStateBlock_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD  stateblock 
)
static

Definition at line 5852 of file device.c.

5853{
5854 return d3d_device7_CaptureStateBlock(iface, stateblock);
5855}

◆ d3d_device7_Clear()

static HRESULT d3d_device7_Clear ( IDirect3DDevice7 *  iface,
DWORD  count,
D3DRECT rects,
DWORD  flags,
D3DCOLOR  color,
D3DVALUE  z,
DWORD  stencil 
)
static

Definition at line 5251 of file device.c.

5253{
5254 const struct wined3d_color c =
5255 {
5256 ((color >> 16) & 0xff) / 255.0f,
5257 ((color >> 8) & 0xff) / 255.0f,
5258 (color & 0xff) / 255.0f,
5259 ((color >> 24) & 0xff) / 255.0f,
5260 };
5262 HRESULT hr;
5263
5264 TRACE("iface %p, count %u, rects %p, flags %#x, color 0x%08x, z %.8e, stencil %#x.\n",
5265 iface, count, rects, flags, color, z, stencil);
5266
5267 if (count && !rects)
5268 {
5269 WARN("count %u with NULL rects.\n", count);
5270 count = 0;
5271 }
5272
5274 hr = wined3d_device_clear(This->wined3d_device, count, (RECT *)rects, flags, &c, z, stencil);
5276
5277 return hr;
5278}
HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_count, const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil)
Definition: device.c:3633
GLuint color
Definition: glext.h:6243
const GLubyte * c
Definition: glext.h:8905
GLint GLfloat GLint stencil
Definition: glext.h:6260
GLdouble GLdouble z
Definition: glext.h:5874

Referenced by d3d_device7_Clear_FPUPreserve(), and d3d_device7_Clear_FPUSetup().

◆ d3d_device7_Clear_FPUPreserve()

static HRESULT WINAPI d3d_device7_Clear_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD  count,
D3DRECT rects,
DWORD  flags,
D3DCOLOR  color,
D3DVALUE  z,
DWORD  stencil 
)
static

Definition at line 5286 of file device.c.

5288{
5289 HRESULT hr;
5290 WORD old_fpucw;
5291
5292 old_fpucw = d3d_fpu_setup();
5293 hr = d3d_device7_Clear(iface, count, rects, flags, color, z, stencil);
5294 set_fpu_control_word(old_fpucw);
5295
5296 return hr;
5297}
static HRESULT d3d_device7_Clear(IDirect3DDevice7 *iface, DWORD count, D3DRECT *rects, DWORD flags, D3DCOLOR color, D3DVALUE z, DWORD stencil)
Definition: device.c:5251

◆ d3d_device7_Clear_FPUSetup()

static HRESULT WINAPI d3d_device7_Clear_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD  count,
D3DRECT rects,
DWORD  flags,
D3DCOLOR  color,
D3DVALUE  z,
DWORD  stencil 
)
static

Definition at line 5280 of file device.c.

5282{
5283 return d3d_device7_Clear(iface, count, rects, flags, color, z, stencil);
5284}

◆ d3d_device7_ComputeSphereVisibility()

static HRESULT WINAPI d3d_device7_ComputeSphereVisibility ( IDirect3DDevice7 *  iface,
D3DVECTOR centers,
D3DVALUE radii,
DWORD  sphere_count,
DWORD  flags,
DWORD return_values 
)
static

Definition at line 4603 of file device.c.

4605{
4606 struct wined3d_vec4 plane[12];
4607 DWORD enabled_planes = 0x3f;
4608 DWORD user_clip_planes;
4609 UINT j;
4610
4611 TRACE("iface %p, centers %p, radii %p, sphere_count %u, flags %#x, return_values %p.\n",
4612 iface, centers, radii, sphere_count, flags, return_values);
4613
4615
4617 enabled_planes |= user_clip_planes << 6;
4618 for (j = 6; j < 12; ++j)
4620
4621 compute_sphere_visibility(plane, enabled_planes, FALSE, centers, radii, sphere_count, return_values);
4622 return D3D_OK;
4623}
#define IDirect3DDevice7_GetClipPlane(p, a, b)
Definition: d3d.h:1390
float D3DVALUE
Definition: d3dtypes.h:89
#define D3DRENDERSTATE_CLIPPLANEENABLE
Definition: dx7todx8.h:33

◆ d3d_device7_CreateStateBlock()

static HRESULT d3d_device7_CreateStateBlock ( IDirect3DDevice7 *  iface,
D3DSTATEBLOCKTYPE  type,
DWORD stateblock 
)
static

Definition at line 5945 of file device.c.

5947{
5949 struct wined3d_stateblock *wined3d_sb;
5950 HRESULT hr;
5951 DWORD h;
5952
5953 TRACE("iface %p, type %#x, stateblock %p.\n", iface, type, stateblock);
5954
5955 if (!stateblock)
5956 return DDERR_INVALIDPARAMS;
5957
5958 if (type != D3DSBT_ALL
5961 {
5962 WARN("Unexpected stateblock type, returning DDERR_INVALIDPARAMS\n");
5963 return DDERR_INVALIDPARAMS;
5964 }
5965
5967
5968 /* The D3DSTATEBLOCKTYPE enum is fine here. */
5969 hr = wined3d_stateblock_create(device->wined3d_device, type, &wined3d_sb);
5970 if (FAILED(hr))
5971 {
5972 WARN("Failed to create stateblock, hr %#x.\n", hr);
5974 return hr_ddraw_from_wined3d(hr);
5975 }
5976
5977 h = ddraw_allocate_handle(&device->handle_table, wined3d_sb, DDRAW_HANDLE_STATEBLOCK);
5978 if (h == DDRAW_INVALID_HANDLE)
5979 {
5980 ERR("Failed to allocate stateblock handle.\n");
5981 wined3d_stateblock_decref(wined3d_sb);
5983 return DDERR_OUTOFMEMORY;
5984 }
5985
5986 *stateblock = h + 1;
5988
5989 return hr_ddraw_from_wined3d(hr);
5990}
@ D3DSBT_PIXELSTATE
Definition: d3d8types.h:831
@ D3DSBT_ALL
Definition: d3d8types.h:830
@ D3DSBT_VERTEXSTATE
Definition: d3d8types.h:832
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
ULONG CDECL wined3d_stateblock_decref(struct wined3d_stateblock *stateblock)
Definition: stateblock.c:552
HRESULT CDECL wined3d_stateblock_create(struct wined3d_device *device, enum wined3d_stateblock_type type, struct wined3d_stateblock **stateblock)
Definition: stateblock.c:1372

Referenced by d3d_device7_CreateStateBlock_FPUPreserve(), and d3d_device7_CreateStateBlock_FPUSetup().

◆ d3d_device7_CreateStateBlock_FPUPreserve()

static HRESULT WINAPI d3d_device7_CreateStateBlock_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DSTATEBLOCKTYPE  type,
DWORD stateblock 
)
static

Definition at line 5998 of file device.c.

6000{
6001 HRESULT hr;
6002 WORD old_fpucw;
6003
6004 old_fpucw = d3d_fpu_setup();
6005 hr = d3d_device7_CreateStateBlock(iface, type, stateblock);
6006 set_fpu_control_word(old_fpucw);
6007
6008 return hr;
6009}
static HRESULT d3d_device7_CreateStateBlock(IDirect3DDevice7 *iface, D3DSTATEBLOCKTYPE type, DWORD *stateblock)
Definition: device.c:5945

◆ d3d_device7_CreateStateBlock_FPUSetup()

static HRESULT WINAPI d3d_device7_CreateStateBlock_FPUSetup ( IDirect3DDevice7 *  iface,
D3DSTATEBLOCKTYPE  type,
DWORD stateblock 
)
static

Definition at line 5992 of file device.c.

5994{
5995 return d3d_device7_CreateStateBlock(iface, type, stateblock);
5996}

◆ d3d_device7_DeleteStateBlock()

static HRESULT d3d_device7_DeleteStateBlock ( IDirect3DDevice7 *  iface,
DWORD  stateblock 
)
static

Definition at line 5884 of file device.c.

5885{
5887 struct wined3d_stateblock *wined3d_sb;
5888 ULONG ref;
5889
5890 TRACE("iface %p, stateblock %#x.\n", iface, stateblock);
5891
5893
5894 wined3d_sb = ddraw_free_handle(&device->handle_table, stateblock - 1, DDRAW_HANDLE_STATEBLOCK);
5895 if (!wined3d_sb)
5896 {
5897 WARN("Invalid stateblock handle.\n");
5900 }
5901
5902 if ((ref = wined3d_stateblock_decref(wined3d_sb)))
5903 {
5904 ERR("Something is still holding stateblock %p (refcount %u).\n", wined3d_sb, ref);
5905 }
5906
5908
5909 return D3D_OK;
5910}
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

Referenced by d3d_device7_DeleteStateBlock_FPUPreserve(), and d3d_device7_DeleteStateBlock_FPUSetup().

◆ d3d_device7_DeleteStateBlock_FPUPreserve()

static HRESULT WINAPI d3d_device7_DeleteStateBlock_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD  stateblock 
)
static

Definition at line 5917 of file device.c.

5918{
5919 HRESULT hr;
5920 WORD old_fpucw;
5921
5922 old_fpucw = d3d_fpu_setup();
5923 hr = d3d_device7_DeleteStateBlock(iface, stateblock);
5924 set_fpu_control_word(old_fpucw);
5925
5926 return hr;
5927}
static HRESULT d3d_device7_DeleteStateBlock(IDirect3DDevice7 *iface, DWORD stateblock)
Definition: device.c:5884

◆ d3d_device7_DeleteStateBlock_FPUSetup()

static HRESULT WINAPI d3d_device7_DeleteStateBlock_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD  stateblock 
)
static

Definition at line 5912 of file device.c.

5913{
5914 return d3d_device7_DeleteStateBlock(iface, stateblock);
5915}

◆ d3d_device7_DrawIndexedPrimitive()

static HRESULT d3d_device7_DrawIndexedPrimitive ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  primitive_type,
DWORD  fvf,
void vertices,
DWORD  vertex_count,
WORD indices,
DWORD  index_count,
DWORD  flags 
)
static

Definition at line 3686 of file device.c.

3689{
3691 HRESULT hr;
3693 UINT vtx_size = stride * vertex_count, idx_size = index_count * sizeof(*indices);
3695 struct wined3d_box wined3d_box = {0};
3696 struct wined3d_resource *ib, *vb;
3697 UINT vb_pos, ib_pos, align;
3698
3699 TRACE("iface %p, primitive_type %#x, fvf %#x, vertices %p, vertex_count %u, "
3700 "indices %p, index_count %u, flags %#x.\n",
3701 iface, primitive_type, fvf, vertices, vertex_count, indices, index_count, flags);
3702
3703 if (!vertex_count || !index_count)
3704 {
3705 WARN("0 vertex or index count.\n");
3706 return D3D_OK;
3707 }
3708
3709 /* Set the D3DDevice's FVF */
3711
3713 if (FAILED(hr))
3714 goto done;
3715
3716 vb_pos = device->vertex_buffer_pos;
3717 align = vb_pos % stride;
3718 if (align) align = stride - align;
3719 if (vb_pos + vtx_size + align > device->vertex_buffer_size)
3720 vb_pos = 0;
3721 else
3722 vb_pos += align;
3723
3724 wined3d_box.left = vb_pos;
3725 wined3d_box.right = vb_pos + vtx_size;
3726 vb = wined3d_buffer_get_resource(device->vertex_buffer);
3729 goto done;
3730 memcpy(wined3d_map_desc.data, vertices, vtx_size);
3732 device->vertex_buffer_pos = vb_pos + vtx_size;
3733
3735 if (FAILED(hr))
3736 goto done;
3737 ib_pos = device->index_buffer_pos;
3738 if (device->index_buffer_size - idx_size < ib_pos)
3739 ib_pos = 0;
3740
3741 wined3d_box.left = ib_pos;
3742 wined3d_box.right = ib_pos + idx_size;
3743 ib = wined3d_buffer_get_resource(device->index_buffer);
3746 goto done;
3747 memcpy(wined3d_map_desc.data, indices, idx_size);
3749 device->index_buffer_pos = ib_pos + idx_size;
3750
3751 hr = wined3d_device_set_stream_source(device->wined3d_device, 0, device->vertex_buffer, 0, stride);
3752 if (FAILED(hr))
3753 goto done;
3754 wined3d_device_set_index_buffer(device->wined3d_device, device->index_buffer, WINED3DFMT_R16_UINT, 0);
3755
3757 wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0);
3758 wined3d_device_set_base_vertex_index(device->wined3d_device, vb_pos / stride);
3759 hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / sizeof(*indices), index_count);
3760
3761done:
3763 return hr;
3764}
struct wined3d_vertex_declaration * ddraw_find_decl(struct ddraw *This, DWORD fvf)
Definition: ddraw.c:4801
static HRESULT d3d_device_prepare_index_buffer(struct d3d_device *device, UINT min_size)
Definition: device.c:3651
static HRESULT d3d_device_prepare_vertex_buffer(struct d3d_device *device, UINT min_size)
Definition: device.c:3459
struct wined3d_resource *CDECL wined3d_buffer_get_resource(struct wined3d_buffer *buffer)
Definition: buffer.c:995
void CDECL wined3d_device_set_vertex_declaration(struct wined3d_device *device, struct wined3d_vertex_declaration *declaration)
Definition: device.c:2157
void CDECL wined3d_device_set_base_vertex_index(struct wined3d_device *device, INT base_index)
Definition: device.c:1917
HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count)
Definition: device.c:3769
void CDECL wined3d_device_set_index_buffer(struct wined3d_device *device, struct wined3d_buffer *buffer, enum wined3d_format_id format_id, unsigned int offset)
Definition: device.c:1874
void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device, enum wined3d_primitive_type primitive_type, unsigned int patch_vertex_count)
Definition: device.c:3717
HRESULT CDECL wined3d_device_set_stream_source(struct wined3d_device *device, UINT stream_idx, struct wined3d_buffer *buffer, UINT offset, UINT stride)
Definition: device.c:1378
HRESULT CDECL wined3d_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx)
Definition: resource.c:382
HRESULT CDECL wined3d_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags)
Definition: resource.c:344
int align(int length, int align)
Definition: dsound8.c:36
GLsizei stride
Definition: glext.h:5848
UINT left
Definition: wined3d.h:1839
UINT right
Definition: wined3d.h:1841
@ WINED3DFMT_R16_UINT
Definition: wined3d.h:193
#define WINED3D_MAP_DISCARD
Definition: wined3d.h:935
#define WINED3D_MAP_WRITE
Definition: wined3d.h:938
#define WINED3D_MAP_NOOVERWRITE
Definition: wined3d.h:934

Referenced by d3d_device7_DrawIndexedPrimitive_FPUPreserve(), and d3d_device7_DrawIndexedPrimitive_FPUSetup().

◆ d3d_device7_DrawIndexedPrimitive_FPUPreserve()

static HRESULT WINAPI d3d_device7_DrawIndexedPrimitive_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  primitive_type,
DWORD  fvf,
void vertices,
DWORD  vertex_count,
WORD indices,
DWORD  index_count,
DWORD  flags 
)
static

Definition at line 3774 of file device.c.

3777{
3778 HRESULT hr;
3779 WORD old_fpucw;
3780
3781 old_fpucw = d3d_fpu_setup();
3782 hr = d3d_device7_DrawIndexedPrimitive(iface, primitive_type, fvf,
3783 vertices, vertex_count, indices, index_count, flags);
3784 set_fpu_control_word(old_fpucw);
3785
3786 return hr;
3787}
static HRESULT d3d_device7_DrawIndexedPrimitive(IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, WORD *indices, DWORD index_count, DWORD flags)
Definition: device.c:3686

◆ d3d_device7_DrawIndexedPrimitive_FPUSetup()

static HRESULT WINAPI d3d_device7_DrawIndexedPrimitive_FPUSetup ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  primitive_type,
DWORD  fvf,
void vertices,
DWORD  vertex_count,
WORD indices,
DWORD  index_count,
DWORD  flags 
)
static

Definition at line 3766 of file device.c.

3769{
3770 return d3d_device7_DrawIndexedPrimitive(iface, primitive_type, fvf,
3771 vertices, vertex_count, indices, index_count, flags);
3772}

◆ d3d_device7_DrawIndexedPrimitiveStrided()

static HRESULT d3d_device7_DrawIndexedPrimitiveStrided ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  primitive_type,
DWORD  fvf,
D3DDRAWPRIMITIVESTRIDEDDATA strided_data,
DWORD  vertex_count,
WORD indices,
DWORD  index_count,
DWORD  flags 
)
static

Definition at line 4132 of file device.c.

4135{
4137 UINT vtx_dst_stride = get_flexible_vertex_size(fvf);
4138 UINT vtx_dst_size = vertex_count * vtx_dst_stride;
4139 UINT idx_size = index_count * sizeof(WORD);
4141 struct wined3d_box wined3d_box = {0};
4142 struct wined3d_resource *ib, *vb;
4143 UINT vb_pos, align;
4144 UINT ib_pos;
4145 HRESULT hr;
4146
4147 TRACE("iface %p, primitive_type %#x, fvf %#x, strided_data %p, "
4148 "vertex_count %u, indices %p, index_count %u, flags %#x.\n",
4149 iface, primitive_type, fvf, strided_data, vertex_count, indices, index_count, flags);
4150
4151 if (!vertex_count || !index_count)
4152 {
4153 WARN("0 vertex or index count.\n");
4154 return D3D_OK;
4155 }
4156
4158
4160 if (FAILED(hr))
4161 goto done;
4162
4163 vb_pos = device->vertex_buffer_pos;
4164 align = vb_pos % vtx_dst_stride;
4165 if (align) align = vtx_dst_stride - align;
4166 if (vb_pos + vtx_dst_size + align > device->vertex_buffer_size)
4167 vb_pos = 0;
4168 else
4169 vb_pos += align;
4170
4171 wined3d_box.left = vb_pos;
4172 wined3d_box.right = vb_pos + vtx_dst_size;
4173 vb = wined3d_buffer_get_resource(device->vertex_buffer);
4176 goto done;
4179 device->vertex_buffer_pos = vb_pos + vtx_dst_size;
4180
4182 if (FAILED(hr))
4183 goto done;
4184 ib_pos = device->index_buffer_pos;
4185 if (device->index_buffer_size - idx_size < ib_pos)
4186 ib_pos = 0;
4187
4188 wined3d_box.left = ib_pos;
4189 wined3d_box.right = ib_pos + idx_size;
4190 ib = wined3d_buffer_get_resource(device->index_buffer);
4193 goto done;
4194 memcpy(wined3d_map_desc.data, indices, idx_size);
4196 device->index_buffer_pos = ib_pos + idx_size;
4197
4198 hr = wined3d_device_set_stream_source(device->wined3d_device, 0, device->vertex_buffer, 0, vtx_dst_stride);
4199 if (FAILED(hr))
4200 goto done;
4201 wined3d_device_set_index_buffer(device->wined3d_device, device->index_buffer, WINED3DFMT_R16_UINT, 0);
4202 wined3d_device_set_base_vertex_index(device->wined3d_device, vb_pos / vtx_dst_stride);
4203
4205 wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0);
4206 hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / sizeof(WORD), index_count);
4207
4208done:
4210 return hr;
4211}
static void pack_strided_data(BYTE *dst, DWORD count, const D3DDRAWPRIMITIVESTRIDEDDATA *src, DWORD fvf)
Definition: device.c:3965

Referenced by d3d_device7_DrawIndexedPrimitiveStrided_FPUPreserve(), and d3d_device7_DrawIndexedPrimitiveStrided_FPUSetup().

◆ d3d_device7_DrawIndexedPrimitiveStrided_FPUPreserve()

static HRESULT WINAPI d3d_device7_DrawIndexedPrimitiveStrided_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  PrimitiveType,
DWORD  VertexType,
D3DDRAWPRIMITIVESTRIDEDDATA D3DDrawPrimStrideData,
DWORD  VertexCount,
WORD Indices,
DWORD  IndexCount,
DWORD  Flags 
)
static

Definition at line 4222 of file device.c.

4226{
4227 HRESULT hr;
4228 WORD old_fpucw;
4229
4230 old_fpucw = d3d_fpu_setup();
4231 hr = d3d_device7_DrawIndexedPrimitiveStrided(iface, PrimitiveType, VertexType,
4232 D3DDrawPrimStrideData, VertexCount, Indices, IndexCount, Flags);
4233 set_fpu_control_word(old_fpucw);
4234
4235 return hr;
4236}
static HRESULT d3d_device7_DrawIndexedPrimitiveStrided(IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, D3DDRAWPRIMITIVESTRIDEDDATA *strided_data, DWORD vertex_count, WORD *indices, DWORD index_count, DWORD flags)
Definition: device.c:4132

◆ d3d_device7_DrawIndexedPrimitiveStrided_FPUSetup()

static HRESULT WINAPI d3d_device7_DrawIndexedPrimitiveStrided_FPUSetup ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  PrimitiveType,
DWORD  VertexType,
D3DDRAWPRIMITIVESTRIDEDDATA D3DDrawPrimStrideData,
DWORD  VertexCount,
WORD Indices,
DWORD  IndexCount,
DWORD  Flags 
)
static

Definition at line 4213 of file device.c.

4217{
4218 return d3d_device7_DrawIndexedPrimitiveStrided(iface, PrimitiveType, VertexType,
4219 D3DDrawPrimStrideData, VertexCount, Indices, IndexCount, Flags);
4220}

◆ d3d_device7_DrawIndexedPrimitiveVB()

static HRESULT d3d_device7_DrawIndexedPrimitiveVB ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  primitive_type,
IDirect3DVertexBuffer7 *  vb,
DWORD  start_vertex,
DWORD  vertex_count,
WORD indices,
DWORD  index_count,
DWORD  flags 
)
static

Definition at line 4362 of file device.c.

4365{
4370 struct wined3d_box wined3d_box = {0};
4371 struct wined3d_resource *ib;
4372 HRESULT hr;
4373 UINT ib_pos;
4374
4375 TRACE("iface %p, primitive_type %#x, vb %p, start_vertex %u, "
4376 "vertex_count %u, indices %p, index_count %u, flags %#x.\n",
4377 iface, primitive_type, vb, start_vertex, vertex_count, indices, index_count, flags);
4378
4379 if (!vertex_count || !index_count)
4380 {
4381 WARN("0 vertex or index count.\n");
4382 return D3D_OK;
4383 }
4384
4385 /* Steps:
4386 * 1) Upload the indices to the index buffer
4387 * 2) Set the index source
4388 * 3) Set the Vertex Buffer as the Stream source
4389 * 4) Call wined3d_device_draw_indexed_primitive()
4390 */
4391
4393
4395
4396 hr = d3d_device_prepare_index_buffer(device, index_count * sizeof(WORD));
4397 if (FAILED(hr))
4398 {
4400 return hr;
4401 }
4402 ib_pos = device->index_buffer_pos;
4403
4404 if (device->index_buffer_size - index_count * sizeof(WORD) < ib_pos)
4405 ib_pos = 0;
4406
4407 /* Copy the index stream into the index buffer. */
4408 wined3d_box.left = ib_pos;
4409 wined3d_box.right = ib_pos + index_count * sizeof(WORD);
4410 ib = wined3d_buffer_get_resource(device->index_buffer);
4413 {
4414 ERR("Failed to map buffer, hr %#x.\n", hr);
4416 return hr;
4417 }
4418 memcpy(wined3d_map_desc.data, indices, index_count * sizeof(WORD));
4420 device->index_buffer_pos = ib_pos + index_count * sizeof(WORD);
4421
4422 /* Set the index stream */
4423 wined3d_device_set_base_vertex_index(device->wined3d_device, start_vertex);
4424 wined3d_device_set_index_buffer(device->wined3d_device, device->index_buffer, WINED3DFMT_R16_UINT, 0);
4425
4426 /* Set the vertex stream source */
4427 if (FAILED(hr = wined3d_device_set_stream_source(device->wined3d_device,
4428 0, vb_impl->wined3d_buffer, 0, stride)))
4429 {
4430 ERR("(%p) IDirect3DDevice::SetStreamSource failed with hr = %08x\n", device, hr);
4432 return hr;
4433 }
4434
4435 wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0);
4436 hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / sizeof(WORD), index_count);
4437
4439
4440 return hr;
4441}
struct wined3d_vertex_declaration * wined3d_declaration
struct wined3d_buffer * wined3d_buffer

Referenced by d3d_device7_DrawIndexedPrimitiveVB_FPUPreserve(), and d3d_device7_DrawIndexedPrimitiveVB_FPUSetup().

◆ d3d_device7_DrawIndexedPrimitiveVB_FPUPreserve()

static HRESULT WINAPI d3d_device7_DrawIndexedPrimitiveVB_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  PrimitiveType,
IDirect3DVertexBuffer7 *  D3DVertexBuf,
DWORD  StartVertex,
DWORD  NumVertices,
WORD Indices,
DWORD  IndexCount,
DWORD  Flags 
)
static

Definition at line 4451 of file device.c.

4454{
4455 HRESULT hr;
4456 WORD old_fpucw;
4457
4458 old_fpucw = d3d_fpu_setup();
4459 hr = d3d_device7_DrawIndexedPrimitiveVB(iface, PrimitiveType,
4460 D3DVertexBuf, StartVertex, NumVertices, Indices, IndexCount, Flags);
4461 set_fpu_control_word(old_fpucw);
4462
4463 return hr;
4464}
static HRESULT d3d_device7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, IDirect3DVertexBuffer7 *vb, DWORD start_vertex, DWORD vertex_count, WORD *indices, DWORD index_count, DWORD flags)
Definition: device.c:4362

◆ d3d_device7_DrawIndexedPrimitiveVB_FPUSetup()

static HRESULT WINAPI d3d_device7_DrawIndexedPrimitiveVB_FPUSetup ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  PrimitiveType,
IDirect3DVertexBuffer7 *  D3DVertexBuf,
DWORD  StartVertex,
DWORD  NumVertices,
WORD Indices,
DWORD  IndexCount,
DWORD  Flags 
)
static

Definition at line 4443 of file device.c.

4446{
4447 return d3d_device7_DrawIndexedPrimitiveVB(iface, PrimitiveType,
4448 D3DVertexBuf, StartVertex, NumVertices, Indices, IndexCount, Flags);
4449}

◆ d3d_device7_DrawPrimitive()

static HRESULT d3d_device7_DrawPrimitive ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  primitive_type,
DWORD  fvf,
void vertices,
DWORD  vertex_count,
DWORD  flags 
)
static

Definition at line 3495 of file device.c.

3498{
3501 struct wined3d_box wined3d_box = {0};
3502 UINT stride, vb_pos, size, align;
3503 struct wined3d_resource *vb;
3504 HRESULT hr;
3505
3506 TRACE("iface %p, primitive_type %#x, fvf %#x, vertices %p, vertex_count %u, flags %#x.\n",
3507 iface, primitive_type, fvf, vertices, vertex_count, flags);
3508
3509 if (!vertex_count)
3510 {
3511 WARN("0 vertex count.\n");
3512 return D3D_OK;
3513 }
3514
3515 /* Get the stride */
3518
3521 if (FAILED(hr))
3522 goto done;
3523
3524 vb_pos = device->vertex_buffer_pos;
3525 align = vb_pos % stride;
3526 if (align) align = stride - align;
3527 if (vb_pos + size + align > device->vertex_buffer_size)
3528 vb_pos = 0;
3529 else
3530 vb_pos += align;
3531
3532 wined3d_box.left = vb_pos;
3533 wined3d_box.right = vb_pos + size;
3534 vb = wined3d_buffer_get_resource(device->vertex_buffer);
3537 goto done;
3538 memcpy(wined3d_map_desc.data, vertices, size);
3540 device->vertex_buffer_pos = vb_pos + size;
3541
3542 hr = wined3d_device_set_stream_source(device->wined3d_device, 0, device->vertex_buffer, 0, stride);
3543 if (FAILED(hr))
3544 goto done;
3545
3547 wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0);
3548 hr = wined3d_device_draw_primitive(device->wined3d_device, vb_pos / stride, vertex_count);
3549
3550done:
3552 return hr;
3553}
HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT start_vertex, UINT vertex_count)
Definition: device.c:3740

Referenced by d3d_device7_DrawPrimitive_FPUPreserve(), and d3d_device7_DrawPrimitive_FPUSetup().

◆ d3d_device7_DrawPrimitive_FPUPreserve()

static HRESULT WINAPI d3d_device7_DrawPrimitive_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  primitive_type,
DWORD  fvf,
void vertices,
DWORD  vertex_count,
DWORD  flags 
)
static

Definition at line 3562 of file device.c.

3565{
3566 HRESULT hr;
3567 WORD old_fpucw;
3568
3569 old_fpucw = d3d_fpu_setup();
3570 hr = d3d_device7_DrawPrimitive(iface, primitive_type, fvf, vertices, vertex_count, flags);
3571 set_fpu_control_word(old_fpucw);
3572
3573 return hr;
3574}
static HRESULT d3d_device7_DrawPrimitive(IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, DWORD flags)
Definition: device.c:3495

◆ d3d_device7_DrawPrimitive_FPUSetup()

static HRESULT WINAPI d3d_device7_DrawPrimitive_FPUSetup ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  primitive_type,
DWORD  fvf,
void vertices,
DWORD  vertex_count,
DWORD  flags 
)
static

Definition at line 3555 of file device.c.

3558{
3559 return d3d_device7_DrawPrimitive(iface, primitive_type, fvf, vertices, vertex_count, flags);
3560}

◆ d3d_device7_DrawPrimitiveStrided()

static HRESULT d3d_device7_DrawPrimitiveStrided ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  primitive_type,
DWORD  fvf,
D3DDRAWPRIMITIVESTRIDEDDATA strided_data,
DWORD  vertex_count,
DWORD  flags 
)
static

Definition at line 4021 of file device.c.

4023{
4025 HRESULT hr;
4026 UINT dst_stride = get_flexible_vertex_size(fvf);
4027 UINT dst_size = dst_stride * vertex_count;
4029 struct wined3d_box wined3d_box = {0};
4030 struct wined3d_resource *vb;
4031 UINT vb_pos, align;
4032
4033 TRACE("iface %p, primitive_type %#x, fvf %#x, strided_data %p, vertex_count %u, flags %#x.\n",
4034 iface, primitive_type, fvf, strided_data, vertex_count, flags);
4035
4036 if (!vertex_count)
4037 {
4038 WARN("0 vertex count.\n");
4039 return D3D_OK;
4040 }
4041
4044 if (FAILED(hr))
4045 goto done;
4046
4047 vb_pos = device->vertex_buffer_pos;
4048 align = vb_pos % dst_stride;
4049 if (align) align = dst_stride - align;
4050 if (vb_pos + dst_size + align > device->vertex_buffer_size)
4051 vb_pos = 0;
4052 else
4053 vb_pos += align;
4054
4055 wined3d_box.left = vb_pos;
4056 wined3d_box.right = vb_pos + dst_size;
4057 vb = wined3d_buffer_get_resource(device->vertex_buffer);
4060 goto done;
4063 device->vertex_buffer_pos = vb_pos + dst_size;
4064
4065 hr = wined3d_device_set_stream_source(device->wined3d_device, 0, device->vertex_buffer, 0, dst_stride);
4066 if (FAILED(hr))
4067 goto done;
4069
4070 wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0);
4071 hr = wined3d_device_draw_primitive(device->wined3d_device, vb_pos / dst_stride, vertex_count);
4072
4073done:
4075 return hr;
4076}

Referenced by d3d_device7_DrawPrimitiveStrided_FPUPreserve(), and d3d_device7_DrawPrimitiveStrided_FPUSetup().

◆ d3d_device7_DrawPrimitiveStrided_FPUPreserve()

static HRESULT WINAPI d3d_device7_DrawPrimitiveStrided_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  PrimitiveType,
DWORD  VertexType,
D3DDRAWPRIMITIVESTRIDEDDATA D3DDrawPrimStrideData,
DWORD  VertexCount,
DWORD  Flags 
)
static

Definition at line 4086 of file device.c.

4089{
4090 HRESULT hr;
4091 WORD old_fpucw;
4092
4093 old_fpucw = d3d_fpu_setup();
4094 hr = d3d_device7_DrawPrimitiveStrided(iface, PrimitiveType,
4095 VertexType, D3DDrawPrimStrideData, VertexCount, Flags);
4096 set_fpu_control_word(old_fpucw);
4097
4098 return hr;
4099}
static HRESULT d3d_device7_DrawPrimitiveStrided(IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, D3DDRAWPRIMITIVESTRIDEDDATA *strided_data, DWORD vertex_count, DWORD flags)
Definition: device.c:4021

◆ d3d_device7_DrawPrimitiveStrided_FPUSetup()

static HRESULT WINAPI d3d_device7_DrawPrimitiveStrided_FPUSetup ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  PrimitiveType,
DWORD  VertexType,
D3DDRAWPRIMITIVESTRIDEDDATA D3DDrawPrimStrideData,
DWORD  VertexCount,
DWORD  Flags 
)
static

Definition at line 4078 of file device.c.

4081{
4082 return d3d_device7_DrawPrimitiveStrided(iface, PrimitiveType,
4083 VertexType, D3DDrawPrimStrideData, VertexCount, Flags);
4084}

◆ d3d_device7_DrawPrimitiveVB()

static HRESULT d3d_device7_DrawPrimitiveVB ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  primitive_type,
IDirect3DVertexBuffer7 *  vb,
DWORD  start_vertex,
DWORD  vertex_count,
DWORD  flags 
)
static

Definition at line 4273 of file device.c.

4275{
4278 HRESULT hr;
4279 DWORD stride;
4280
4281 TRACE("iface %p, primitive_type %#x, vb %p, start_vertex %u, vertex_count %u, flags %#x.\n",
4282 iface, primitive_type, vb, start_vertex, vertex_count, flags);
4283
4284 if (!vertex_count)
4285 {
4286 WARN("0 vertex count.\n");
4287 return D3D_OK;
4288 }
4289
4291
4294 if (FAILED(hr = wined3d_device_set_stream_source(device->wined3d_device,
4295 0, vb_impl->wined3d_buffer, 0, stride)))
4296 {
4297 WARN("Failed to set stream source, hr %#x.\n", hr);
4299 return hr;
4300 }
4301
4302 /* Now draw the primitives */
4303 wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0);
4304 hr = wined3d_device_draw_primitive(device->wined3d_device, start_vertex, vertex_count);
4305
4307
4308 return hr;
4309}

Referenced by d3d_device7_DrawPrimitiveVB_FPUPreserve(), and d3d_device7_DrawPrimitiveVB_FPUSetup().

◆ d3d_device7_DrawPrimitiveVB_FPUPreserve()

static HRESULT WINAPI d3d_device7_DrawPrimitiveVB_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  PrimitiveType,
IDirect3DVertexBuffer7 *  D3DVertexBuf,
DWORD  StartVertex,
DWORD  NumVertices,
DWORD  Flags 
)
static

Definition at line 4317 of file device.c.

4319{
4320 HRESULT hr;
4321 WORD old_fpucw;
4322
4323 old_fpucw = d3d_fpu_setup();
4324 hr = d3d_device7_DrawPrimitiveVB(iface, PrimitiveType, D3DVertexBuf, StartVertex, NumVertices, Flags);
4325 set_fpu_control_word(old_fpucw);
4326
4327 return hr;
4328}
static HRESULT d3d_device7_DrawPrimitiveVB(IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, IDirect3DVertexBuffer7 *vb, DWORD start_vertex, DWORD vertex_count, DWORD flags)
Definition: device.c:4273

◆ d3d_device7_DrawPrimitiveVB_FPUSetup()

static HRESULT WINAPI d3d_device7_DrawPrimitiveVB_FPUSetup ( IDirect3DDevice7 *  iface,
D3DPRIMITIVETYPE  PrimitiveType,
IDirect3DVertexBuffer7 *  D3DVertexBuf,
DWORD  StartVertex,
DWORD  NumVertices,
DWORD  Flags 
)
static

Definition at line 4311 of file device.c.

4313{
4314 return d3d_device7_DrawPrimitiveVB(iface, PrimitiveType, D3DVertexBuf, StartVertex, NumVertices, Flags);
4315}

◆ d3d_device7_EndScene()

static HRESULT d3d_device7_EndScene ( IDirect3DDevice7 *  iface)
static

Definition at line 1539 of file device.c.

1540{
1542 HRESULT hr;
1543
1544 TRACE("iface %p.\n", iface);
1545
1547 hr = wined3d_device_end_scene(device->wined3d_device);
1549
1550 if(hr == WINED3D_OK) return D3D_OK;
1551 else return D3DERR_SCENE_NOT_IN_SCENE;
1552}
#define D3DERR_SCENE_NOT_IN_SCENE
Definition: d3d.h:152
HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device)
Definition: device.c:3617

Referenced by d3d_device7_EndScene_FPUPreserve(), and d3d_device7_EndScene_FPUSetup().

◆ d3d_device7_EndScene_FPUPreserve()

static HRESULT WINAPI DECLSPEC_HOTPATCH d3d_device7_EndScene_FPUPreserve ( IDirect3DDevice7 *  iface)
static

Definition at line 1559 of file device.c.

1560{
1561 HRESULT hr;
1562 WORD old_fpucw;
1563
1564 old_fpucw = d3d_fpu_setup();
1565 hr = d3d_device7_EndScene(iface);
1566 set_fpu_control_word(old_fpucw);
1567
1568 return hr;
1569}
static HRESULT d3d_device7_EndScene(IDirect3DDevice7 *iface)
Definition: device.c:1539

◆ d3d_device7_EndScene_FPUSetup()

static HRESULT WINAPI DECLSPEC_HOTPATCH d3d_device7_EndScene_FPUSetup ( IDirect3DDevice7 *  iface)
static

Definition at line 1554 of file device.c.

1555{
1556 return d3d_device7_EndScene(iface);
1557}

◆ d3d_device7_EndStateBlock()

static HRESULT d3d_device7_EndStateBlock ( IDirect3DDevice7 *  iface,
DWORD stateblock 
)
static

Definition at line 5658 of file device.c.

5659{
5661 struct wined3d_stateblock *wined3d_sb;
5662 HRESULT hr;
5663 DWORD h;
5664
5665 TRACE("iface %p, stateblock %p.\n", iface, stateblock);
5666
5667 if (!stateblock)
5668 return DDERR_INVALIDPARAMS;
5669
5671
5672 hr = wined3d_device_end_stateblock(device->wined3d_device, &wined3d_sb);
5673 if (FAILED(hr))
5674 {
5675 WARN("Failed to end stateblock, hr %#x.\n", hr);
5677 *stateblock = 0;
5678 return hr_ddraw_from_wined3d(hr);
5679 }
5680
5681 h = ddraw_allocate_handle(&device->handle_table, wined3d_sb, DDRAW_HANDLE_STATEBLOCK);
5682 if (h == DDRAW_INVALID_HANDLE)
5683 {
5684 ERR("Failed to allocate a stateblock handle.\n");
5685 wined3d_stateblock_decref(wined3d_sb);
5687 *stateblock = 0;
5688 return DDERR_OUTOFMEMORY;
5689 }
5690
5692 *stateblock = h + 1;
5693
5694 return hr_ddraw_from_wined3d(hr);
5695}
HRESULT CDECL wined3d_device_end_stateblock(struct wined3d_device *device, struct wined3d_stateblock **stateblock)
Definition: device.c:3577

Referenced by d3d_device7_EndStateBlock_FPUPreserve(), and d3d_device7_EndStateBlock_FPUSetup().

◆ d3d_device7_EndStateBlock_FPUPreserve()

static HRESULT WINAPI d3d_device7_EndStateBlock_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD stateblock 
)
static

Definition at line 5702 of file device.c.

5703{
5704 HRESULT hr;
5705 WORD old_fpucw;
5706
5707 old_fpucw = d3d_fpu_setup();
5708 hr = d3d_device7_EndStateBlock(iface, stateblock);
5709 set_fpu_control_word(old_fpucw);
5710
5711 return hr;
5712}
static HRESULT d3d_device7_EndStateBlock(IDirect3DDevice7 *iface, DWORD *stateblock)
Definition: device.c:5658

◆ d3d_device7_EndStateBlock_FPUSetup()

static HRESULT WINAPI d3d_device7_EndStateBlock_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD stateblock 
)
static

Definition at line 5697 of file device.c.

5698{
5699 return d3d_device7_EndStateBlock(iface, stateblock);
5700}

◆ d3d_device7_EnumTextureFormats()

static HRESULT d3d_device7_EnumTextureFormats ( IDirect3DDevice7 *  iface,
LPD3DENUMPIXELFORMATSCALLBACK  callback,
void context 
)
static

Definition at line 1036 of file device.c.

1038{
1041 HRESULT hr;
1042 unsigned int i;
1043
1044 static const enum wined3d_format_id FormatList[] =
1045 {
1046 /* 16 bit */
1051 /* 32 bit */
1054 /* 8 bit */
1057 /* FOURCC codes */
1063 };
1064
1065 static const enum wined3d_format_id BumpFormatList[] =
1066 {
1072 };
1073
1074 TRACE("iface %p, callback %p, context %p.\n", iface, callback, context);
1075
1076 if (!callback)
1077 return DDERR_INVALIDPARAMS;
1078
1080
1081 memset(&mode, 0, sizeof(mode));
1083 {
1085 WARN("Cannot get the current adapter format\n");
1086 return hr;
1087 }
1088
1089 for (i = 0; i < ARRAY_SIZE(FormatList); ++i)
1090 {
1092 mode.format_id, WINED3DUSAGE_TEXTURE, WINED3D_RTYPE_TEXTURE_2D, FormatList[i]) == D3D_OK)
1093 {
1094 DDPIXELFORMAT pformat;
1095
1096 memset(&pformat, 0, sizeof(pformat));
1097 pformat.dwSize = sizeof(pformat);
1098 ddrawformat_from_wined3dformat(&pformat, FormatList[i]);
1099
1100 TRACE("Enumerating WineD3DFormat %d\n", FormatList[i]);
1101 hr = callback(&pformat, context);
1102 if(hr != DDENUMRET_OK)
1103 {
1104 TRACE("Format enumeration cancelled by application\n");
1106 return D3D_OK;
1107 }
1108 }
1109 }
1110
1111 for (i = 0; i < ARRAY_SIZE(BumpFormatList); ++i)
1112 {
1115 WINED3D_RTYPE_TEXTURE_2D, BumpFormatList[i]) == D3D_OK)
1116 {
1117 DDPIXELFORMAT pformat;
1118
1119 memset(&pformat, 0, sizeof(pformat));
1120 pformat.dwSize = sizeof(pformat);
1121 ddrawformat_from_wined3dformat(&pformat, BumpFormatList[i]);
1122
1123 TRACE("Enumerating WineD3DFormat %d\n", BumpFormatList[i]);
1124 hr = callback(&pformat, context);
1125 if(hr != DDENUMRET_OK)
1126 {
1127 TRACE("Format enumeration cancelled by application\n");
1129 return D3D_OK;
1130 }
1131 }
1132 }
1133 TRACE("End of enumeration\n");
1135
1136 return D3D_OK;
1137}
#define WINED3DUSAGE_QUERY_LEGACYBUMPMAP
Definition: wined3d.h:924
@ WINED3DFMT_DXT2
Definition: wined3d.h:240
@ WINED3DFMT_R10G11B11_SNORM
Definition: wined3d.h:123
@ WINED3DFMT_R8G8_SNORM
Definition: wined3d.h:187
@ WINED3DFMT_R5G5_SNORM_L6_UNORM
Definition: wined3d.h:121
@ WINED3DFMT_DXT1
Definition: wined3d.h:239
@ WINED3DFMT_R10G10B10_SNORM_A2_UNORM
Definition: wined3d.h:126
@ WINED3DFMT_DXT3
Definition: wined3d.h:241
@ WINED3DFMT_DXT4
Definition: wined3d.h:242
@ WINED3DFMT_R8G8_SNORM_L8X8_UNORM
Definition: wined3d.h:122
@ WINED3DFMT_DXT5
Definition: wined3d.h:243

Referenced by d3d_device7_EnumTextureFormats_FPUPreserve(), and d3d_device7_EnumTextureFormats_FPUSetup().

◆ d3d_device7_EnumTextureFormats_FPUPreserve()

static HRESULT WINAPI d3d_device7_EnumTextureFormats_FPUPreserve ( IDirect3DDevice7 *  iface,
LPD3DENUMPIXELFORMATSCALLBACK  callback,
void context 
)
static

Definition at line 1145 of file device.c.

1147{
1148 HRESULT hr;
1149 WORD old_fpucw;
1150
1151 old_fpucw = d3d_fpu_setup();
1153 set_fpu_control_word(old_fpucw);
1154
1155 return hr;
1156}
static HRESULT d3d_device7_EnumTextureFormats(IDirect3DDevice7 *iface, LPD3DENUMPIXELFORMATSCALLBACK callback, void *context)
Definition: device.c:1036

◆ d3d_device7_EnumTextureFormats_FPUSetup()

static HRESULT WINAPI d3d_device7_EnumTextureFormats_FPUSetup ( IDirect3DDevice7 *  iface,
LPD3DENUMPIXELFORMATSCALLBACK  callback,
void context 
)
static

Definition at line 1139 of file device.c.

1141{
1143}

◆ d3d_device7_GetCaps()

static HRESULT d3d_device7_GetCaps ( IDirect3DDevice7 *  iface,
D3DDEVICEDESC7 device_desc 
)
static

Definition at line 398 of file device.c.

399{
401
402 TRACE("iface %p, device_desc %p.\n", iface, device_desc);
403
404 if (!device_desc)
405 {
406 WARN("device_desc is NULL, returning DDERR_INVALIDPARAMS.\n");
407 return DDERR_INVALIDPARAMS;
408 }
409
410 /* Call the same function used by IDirect3D, this saves code */
411 return ddraw_get_d3dcaps(device->ddraw, device_desc);
412}

Referenced by d3d_device7_GetCaps_FPUPreserve(), and d3d_device7_GetCaps_FPUSetup().

◆ d3d_device7_GetCaps_FPUPreserve()

static HRESULT WINAPI d3d_device7_GetCaps_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DDEVICEDESC7 desc 
)
static

Definition at line 419 of file device.c.

420{
421 HRESULT hr;
422 WORD old_fpucw;
423
424 old_fpucw = d3d_fpu_setup();
425 hr = d3d_device7_GetCaps(iface, desc);
426 set_fpu_control_word(old_fpucw);
427
428 return hr;
429}
static HRESULT d3d_device7_GetCaps(IDirect3DDevice7 *iface, D3DDEVICEDESC7 *device_desc)
Definition: device.c:398

◆ d3d_device7_GetCaps_FPUSetup()

static HRESULT WINAPI d3d_device7_GetCaps_FPUSetup ( IDirect3DDevice7 *  iface,
D3DDEVICEDESC7 desc 
)
static

Definition at line 414 of file device.c.

415{
416 return d3d_device7_GetCaps(iface, desc);
417}

◆ d3d_device7_GetClipPlane()

static HRESULT d3d_device7_GetClipPlane ( IDirect3DDevice7 *  iface,
DWORD  idx,
D3DVALUE plane 
)
static

Definition at line 6529 of file device.c.

6530{
6532 struct wined3d_vec4 *wined3d_plane;
6533 HRESULT hr;
6534
6535 TRACE("iface %p, idx %u, plane %p.\n", iface, idx, plane);
6536
6537 if (!plane)
6538 return DDERR_INVALIDPARAMS;
6539
6540 wined3d_plane = (struct wined3d_vec4 *)plane;
6541
6543 hr = wined3d_device_get_clip_plane(device->wined3d_device, idx, wined3d_plane);
6544 if (hr == WINED3DERR_INVALIDCALL && idx < ARRAY_SIZE(device->user_clip_planes))
6545 {
6546 WARN("Clip plane %u is not supported.\n", idx);
6547 *wined3d_plane = device->user_clip_planes[idx];
6548 hr = D3D_OK;
6549 }
6551
6552 return hr;
6553}
HRESULT CDECL wined3d_device_get_clip_plane(const struct wined3d_device *device, UINT plane_idx, struct wined3d_vec4 *plane)
Definition: device.c:1811
unsigned int idx
Definition: utils.c:41
#define WINED3DERR_INVALIDCALL
Definition: wined3d.h:48

Referenced by d3d_device7_GetClipPlane_FPUPreserve(), and d3d_device7_GetClipPlane_FPUSetup().

◆ d3d_device7_GetClipPlane_FPUPreserve()

static HRESULT WINAPI d3d_device7_GetClipPlane_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD  idx,
D3DVALUE plane 
)
static

Definition at line 6560 of file device.c.

6561{
6562 HRESULT hr;
6563 WORD old_fpucw;
6564
6565 old_fpucw = d3d_fpu_setup();
6567 set_fpu_control_word(old_fpucw);
6568
6569 return hr;
6570}
static HRESULT d3d_device7_GetClipPlane(IDirect3DDevice7 *iface, DWORD idx, D3DVALUE *plane)
Definition: device.c:6529

◆ d3d_device7_GetClipPlane_FPUSetup()

static HRESULT WINAPI d3d_device7_GetClipPlane_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD  idx,
D3DVALUE plane 
)
static

Definition at line 6555 of file device.c.

6556{
6557 return d3d_device7_GetClipPlane(iface, idx, plane);
6558}

◆ d3d_device7_GetClipStatus()

static HRESULT WINAPI d3d_device7_GetClipStatus ( IDirect3DDevice7 *  iface,
D3DCLIPSTATUS clip_status 
)
static

Definition at line 3920 of file device.c.

3921{
3922 FIXME("iface %p, clip_status %p stub!\n", iface, clip_status);
3923
3924 return D3D_OK;
3925}

◆ d3d_device7_GetDirect3D()

static HRESULT WINAPI d3d_device7_GetDirect3D ( IDirect3DDevice7 *  iface,
IDirect3D7 **  d3d 
)
static

Definition at line 1612 of file device.c.

1613{
1615
1616 TRACE("iface %p, d3d %p.\n", iface, d3d);
1617
1618 if (!d3d)
1619 return DDERR_INVALIDPARAMS;
1620
1621 *d3d = &device->ddraw->IDirect3D7_iface;
1622 IDirect3D7_AddRef(*d3d);
1623
1624 TRACE("Returning interface %p.\n", *d3d);
1625 return D3D_OK;
1626}
#define IDirect3D7_AddRef(p)
Definition: d3d.h:380

◆ d3d_device7_GetInfo()

static HRESULT WINAPI d3d_device7_GetInfo ( IDirect3DDevice7 *  iface,
DWORD  info_id,
void info,
DWORD  info_size 
)
static

Definition at line 6588 of file device.c.

6589{
6590 TRACE("iface %p, info_id %#x, info %p, info_size %u.\n",
6591 iface, info_id, info, info_size);
6592
6593 if (TRACE_ON(ddraw))
6594 {
6595 TRACE(" info requested : ");
6596 switch (info_id)
6597 {
6598 case D3DDEVINFOID_TEXTUREMANAGER: TRACE("D3DDEVINFOID_TEXTUREMANAGER\n"); break;
6599 case D3DDEVINFOID_D3DTEXTUREMANAGER: TRACE("D3DDEVINFOID_D3DTEXTUREMANAGER\n"); break;
6600 case D3DDEVINFOID_TEXTURING: TRACE("D3DDEVINFOID_TEXTURING\n"); break;
6601 default: ERR(" invalid flag !!!\n"); return DDERR_INVALIDPARAMS;
6602 }
6603 }
6604
6605 return S_FALSE; /* According to MSDN, this is valid for a non-debug driver */
6606}
#define D3DDEVINFOID_TEXTUREMANAGER
Definition: d3dtypes.h:1383
#define D3DDEVINFOID_D3DTEXTUREMANAGER
Definition: d3dtypes.h:1384
#define D3DDEVINFOID_TEXTURING
Definition: d3dtypes.h:1385
#define S_FALSE
Definition: winerror.h:2357

◆ d3d_device7_GetLight()

static HRESULT d3d_device7_GetLight ( IDirect3DDevice7 *  iface,
DWORD  light_idx,
D3DLIGHT7 light 
)
static

Definition at line 5567 of file device.c.

5568{
5570 HRESULT rc;
5571
5572 TRACE("iface %p, light_idx %u, light %p.\n", iface, light_idx, light);
5573
5575 /* Note: D3DLIGHT7 is compatible with struct wined3d_light. */
5576 rc = wined3d_device_get_light(device->wined3d_device, light_idx, (struct wined3d_light *)light);
5578
5579 /* Translate the result. WineD3D returns other values than D3D7 */
5580 return hr_ddraw_from_wined3d(rc);
5581}
HRESULT CDECL wined3d_device_get_light(const struct wined3d_device *device, UINT light_idx, struct wined3d_light *light)
Definition: device.c:1724
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
Definition: glfuncs.h:170

Referenced by d3d_device7_GetLight_FPUPreserve(), and d3d_device7_GetLight_FPUSetup().

◆ d3d_device7_GetLight_FPUPreserve()

static HRESULT WINAPI d3d_device7_GetLight_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD  light_idx,
D3DLIGHT7 light 
)
static

Definition at line 5588 of file device.c.

5589{
5590 HRESULT hr;
5591 WORD old_fpucw;
5592
5593 old_fpucw = d3d_fpu_setup();
5594 hr = d3d_device7_GetLight(iface, light_idx, light);
5595 set_fpu_control_word(old_fpucw);
5596
5597 return hr;
5598}
static HRESULT d3d_device7_GetLight(IDirect3DDevice7 *iface, DWORD light_idx, D3DLIGHT7 *light)
Definition: device.c:5567

◆ d3d_device7_GetLight_FPUSetup()

static HRESULT WINAPI d3d_device7_GetLight_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD  light_idx,
D3DLIGHT7 light 
)
static

Definition at line 5583 of file device.c.

5584{
5585 return d3d_device7_GetLight(iface, light_idx, light);
5586}

◆ d3d_device7_GetLightEnable()

static HRESULT d3d_device7_GetLightEnable ( IDirect3DDevice7 *  iface,
DWORD  light_idx,
BOOL enabled 
)
static

Definition at line 6419 of file device.c.

6420{
6422 HRESULT hr;
6423
6424 TRACE("iface %p, light_idx %u, enabled %p.\n", iface, light_idx, enabled);
6425
6426 if (!enabled)
6427 return DDERR_INVALIDPARAMS;
6428
6430 hr = wined3d_device_get_light_enable(device->wined3d_device, light_idx, enabled);
6432
6433 return hr_ddraw_from_wined3d(hr);
6434}
HRESULT CDECL wined3d_device_get_light_enable(const struct wined3d_device *device, UINT light_idx, BOOL *enable)
Definition: device.c:1767
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: glext.h:7750

Referenced by d3d_device7_GetLightEnable_FPUPreserve(), and d3d_device7_GetLightEnable_FPUSetup().

◆ d3d_device7_GetLightEnable_FPUPreserve()

static HRESULT WINAPI d3d_device7_GetLightEnable_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD  light_idx,
BOOL enabled 
)
static

Definition at line 6441 of file device.c.

6442{
6443 HRESULT hr;
6444 WORD old_fpucw;
6445
6446 old_fpucw = d3d_fpu_setup();
6447 hr = d3d_device7_GetLightEnable(iface, light_idx, enabled);
6448 set_fpu_control_word(old_fpucw);
6449
6450 return hr;
6451}
static HRESULT d3d_device7_GetLightEnable(IDirect3DDevice7 *iface, DWORD light_idx, BOOL *enabled)
Definition: device.c:6419

◆ d3d_device7_GetLightEnable_FPUSetup()

static HRESULT WINAPI d3d_device7_GetLightEnable_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD  light_idx,
BOOL enabled 
)
static

Definition at line 6436 of file device.c.

6437{
6438 return d3d_device7_GetLightEnable(iface, light_idx, enabled);
6439}

◆ d3d_device7_GetMaterial()

static HRESULT d3d_device7_GetMaterial ( IDirect3DDevice7 *  iface,
D3DMATERIAL7 material 
)
static

Definition at line 5476 of file device.c.

5477{
5479
5480 TRACE("iface %p, material %p.\n", iface, material);
5481
5483 /* Note: D3DMATERIAL7 is compatible with struct wined3d_material. */
5484 wined3d_device_get_material(device->wined3d_device, (struct wined3d_material *)material);
5486
5487 return D3D_OK;
5488}
void CDECL wined3d_device_get_material(const struct wined3d_device *device, struct wined3d_material *material)
Definition: device.c:1861
DWORD material

Referenced by d3d_device7_GetMaterial_FPUPreserve(), and d3d_device7_GetMaterial_FPUSetup().

◆ d3d_device7_GetMaterial_FPUPreserve()

static HRESULT WINAPI d3d_device7_GetMaterial_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DMATERIAL7 material 
)
static

Definition at line 5495 of file device.c.

5496{
5497 HRESULT hr;
5498 WORD old_fpucw;
5499
5500 old_fpucw = d3d_fpu_setup();
5501 hr = d3d_device7_GetMaterial(iface, material);
5502 set_fpu_control_word(old_fpucw);
5503
5504 return hr;
5505}
static HRESULT d3d_device7_GetMaterial(IDirect3DDevice7 *iface, D3DMATERIAL7 *material)
Definition: device.c:5476

◆ d3d_device7_GetMaterial_FPUSetup()

static HRESULT WINAPI d3d_device7_GetMaterial_FPUSetup ( IDirect3DDevice7 *  iface,
D3DMATERIAL7 material 
)
static

Definition at line 5490 of file device.c.

5491{
5492 return d3d_device7_GetMaterial(iface, material);
5493}

◆ d3d_device7_GetRenderState()

static HRESULT d3d_device7_GetRenderState ( IDirect3DDevice7 *  iface,
D3DRENDERSTATETYPE  state,
DWORD value 
)
static

Definition at line 2288 of file device.c.

2290{
2292 HRESULT hr = D3D_OK;
2293
2294 TRACE("iface %p, state %#x, value %p.\n", iface, state, value);
2295
2296 if (!value)
2297 return DDERR_INVALIDPARAMS;
2298
2300 switch (state)
2301 {
2303 {
2304 enum wined3d_texture_filter_type tex_mag;
2305
2307 switch (tex_mag)
2308 {
2309 case WINED3D_TEXF_POINT:
2311 break;
2314 break;
2315 default:
2316 ERR("Unhandled texture mag %d !\n",tex_mag);
2317 *value = 0;
2318 }
2319 break;
2320 }
2321
2323 {
2324 enum wined3d_texture_filter_type tex_min;
2325 enum wined3d_texture_filter_type tex_mip;
2326
2329 switch (tex_min)
2330 {
2331 case WINED3D_TEXF_POINT:
2332 switch (tex_mip)
2333 {
2334 case WINED3D_TEXF_NONE:
2336 break;
2337 case WINED3D_TEXF_POINT:
2339 break;
2342 break;
2343 default:
2344 ERR("Unhandled mip filter %#x.\n", tex_mip);
2346 break;
2347 }
2348 break;
2350 switch (tex_mip)
2351 {
2352 case WINED3D_TEXF_NONE:
2354 break;
2355 case WINED3D_TEXF_POINT:
2357 break;
2360 break;
2361 default:
2362 ERR("Unhandled mip filter %#x.\n", tex_mip);
2364 break;
2365 }
2366 break;
2367 default:
2368 ERR("Unhandled texture min filter %#x.\n",tex_min);
2370 break;
2371 }
2372 break;
2373 }
2374
2378 break;
2381 break;
2382
2384 FIXME("Unhandled render state D3DRENDERSTATE_BORDERCOLOR.\n");
2385 hr = E_NOTIMPL;
2386 break;
2387
2390 WARN("Render state %#x is invalid in d3d7.\n", state);
2392 break;
2393
2396 break;
2397
2398 default:
2401 {
2402 FIXME("Unhandled stipple pattern render state (%#x).\n", state);
2403 hr = E_NOTIMPL;
2404 break;
2405 }
2407 }
2409
2410 return hr;
2411}
@ D3DFILTER_MIPLINEAR
Definition: d3dtypes.h:707
@ D3DFILTER_LINEARMIPLINEAR
Definition: d3dtypes.h:709
@ D3DFILTER_MIPNEAREST
Definition: d3dtypes.h:706
@ D3DFILTER_LINEAR
Definition: d3dtypes.h:705
@ D3DFILTER_NEAREST
Definition: d3dtypes.h:704
@ D3DFILTER_LINEARMIPNEAREST
Definition: d3dtypes.h:708
@ D3DRENDERSTATE_BORDERCOLOR
Definition: d3dtypes.h:919
@ D3DRENDERSTATE_STIPPLEPATTERN31
Definition: d3dtypes.h:970
@ D3DRENDERSTATE_TEXTUREMAG
Definition: d3dtypes.h:891
@ D3DRENDERSTATE_TEXTUREMIN
Definition: d3dtypes.h:892
@ D3DRENDERSTATE_TEXTUREADDRESS
Definition: d3dtypes.h:877
@ D3DRENDERSTATE_TEXTUREADDRESSU
Definition: d3dtypes.h:920
@ D3DRENDERSTATE_TEXTUREADDRESSV
Definition: d3dtypes.h:921
@ D3DRENDERSTATE_STIPPLEPATTERN00
Definition: d3dtypes.h:939
#define E_NOTIMPL
Definition: ddrawi.h:99
DWORD CDECL wined3d_device_get_render_state(const struct wined3d_device *device, enum wined3d_render_state state)
Definition: device.c:2064
DWORD CDECL wined3d_device_get_sampler_state(const struct wined3d_device *device, UINT sampler_idx, enum wined3d_sampler_state state)
Definition: device.c:2108
#define D3DRENDERSTATE_ZBIAS
Definition: dx7todx8.h:78
@ WINED3D_RS_DEPTHBIAS
Definition: wined3d.h:378
@ WINED3D_SAMP_MIN_FILTER
Definition: wined3d.h:541
@ WINED3D_SAMP_MIP_FILTER
Definition: wined3d.h:542
@ WINED3D_SAMP_MAG_FILTER
Definition: wined3d.h:540
@ WINED3D_SAMP_ADDRESS_V
Definition: wined3d.h:537
@ WINED3D_SAMP_ADDRESS_U
Definition: wined3d.h:536
wined3d_texture_filter_type
Definition: wined3d.h:684
@ WINED3D_TEXF_NONE
Definition: wined3d.h:685
@ WINED3D_TEXF_LINEAR
Definition: wined3d.h:687

Referenced by d3d_device7_GetRenderState_FPUPreserve(), and d3d_device7_GetRenderState_FPUSetup().

◆ d3d_device7_GetRenderState_FPUPreserve()

static HRESULT WINAPI d3d_device7_GetRenderState_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DRENDERSTATETYPE  state,
DWORD value 
)
static

Definition at line 2419 of file device.c.

2421{
2422 HRESULT hr;
2423 WORD old_fpucw;
2424
2425 old_fpucw = d3d_fpu_setup();
2427 set_fpu_control_word(old_fpucw);
2428
2429 return hr;
2430}
static HRESULT d3d_device7_GetRenderState(IDirect3DDevice7 *iface, D3DRENDERSTATETYPE state, DWORD *value)
Definition: device.c:2288

◆ d3d_device7_GetRenderState_FPUSetup()

static HRESULT WINAPI d3d_device7_GetRenderState_FPUSetup ( IDirect3DDevice7 *  iface,
D3DRENDERSTATETYPE  state,
DWORD value 
)
static

Definition at line 2413 of file device.c.

2415{
2416 return d3d_device7_GetRenderState(iface, state, value);
2417}

◆ d3d_device7_GetRenderTarget()

static HRESULT WINAPI d3d_device7_GetRenderTarget ( IDirect3DDevice7 *  iface,
IDirectDrawSurface7 **  RenderTarget 
)
static

Definition at line 2014 of file device.c.

2015{
2017 HRESULT hr;
2018
2019 TRACE("iface %p, target %p.\n", iface, RenderTarget);
2020
2021 if(!RenderTarget)
2022 return DDERR_INVALIDPARAMS;
2023
2025 hr = IUnknown_QueryInterface(device->rt_iface, &IID_IDirectDrawSurface7, (void **)RenderTarget);
2027
2028 return hr;
2029}

Referenced by d3d_device2_GetRenderTarget(), and d3d_device3_GetRenderTarget().

◆ d3d_device7_GetTexture()

static HRESULT d3d_device7_GetTexture ( IDirect3DDevice7 *  iface,
DWORD  stage,
IDirectDrawSurface7 **  texture 
)
static

Definition at line 4686 of file device.c.

4688{
4692
4693 TRACE("iface %p, stage %u, texture %p.\n", iface, stage, texture);
4694
4695 if (!texture)
4696 return DDERR_INVALIDPARAMS;
4697
4699 if (!(wined3d_texture = wined3d_device_get_texture(device->wined3d_device, stage)))
4700 {
4701 *texture = NULL;
4703 return D3D_OK;
4704 }
4705
4707 *texture = &ddraw_texture->root->IDirectDrawSurface7_iface;
4708 IDirectDrawSurface7_AddRef(*texture);
4710
4711 return D3D_OK;
4712}
struct ddraw_surface * root

Referenced by d3d_device7_GetTexture_FPUPreserve(), and d3d_device7_GetTexture_FPUSetup().

◆ d3d_device7_GetTexture_FPUPreserve()

static HRESULT WINAPI d3d_device7_GetTexture_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD  stage,
IDirectDrawSurface7 **  Texture 
)
static

Definition at line 4720 of file device.c.

4722{
4723 HRESULT hr;
4724 WORD old_fpucw;
4725
4726 old_fpucw = d3d_fpu_setup();
4727 hr = d3d_device7_GetTexture(iface, stage, Texture);
4728 set_fpu_control_word(old_fpucw);
4729
4730 return hr;
4731}
static HRESULT d3d_device7_GetTexture(IDirect3DDevice7 *iface, DWORD stage, IDirectDrawSurface7 **texture)
Definition: device.c:4686

◆ d3d_device7_GetTexture_FPUSetup()

static HRESULT WINAPI d3d_device7_GetTexture_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD  stage,
IDirectDrawSurface7 **  Texture 
)
static

Definition at line 4714 of file device.c.

4716{
4717 return d3d_device7_GetTexture(iface, stage, Texture);
4718}

◆ d3d_device7_GetTextureStageState()

static HRESULT d3d_device7_GetTextureStageState ( IDirect3DDevice7 *  iface,
DWORD  stage,
D3DTEXTURESTAGESTATETYPE  state,
DWORD value 
)
static

Definition at line 4911 of file device.c.

4913{
4915 const struct tss_lookup *l;
4916
4917 TRACE("iface %p, stage %u, state %#x, value %p.\n",
4918 iface, stage, state, value);
4919
4920 if (!value)
4921 return DDERR_INVALIDPARAMS;
4922
4924 {
4925 WARN("Invalid state %#x passed.\n", state);
4926 return DD_OK;
4927 }
4928
4929 l = &tss_lookup[state];
4930
4932
4933 if (l->sampler_state)
4934 {
4935 *value = wined3d_device_get_sampler_state(device->wined3d_device, stage, l->u.sampler_state);
4936
4937 switch (state)
4938 {
4939 /* Mipfilter is a sampler state with different values */
4940 case D3DTSS_MIPFILTER:
4941 {
4942 switch (*value)
4943 {
4944 case WINED3D_TEXF_NONE:
4945 *value = D3DTFP_NONE;
4946 break;
4947 case WINED3D_TEXF_POINT:
4949 break;
4952 break;
4953 default:
4954 ERR("Unexpected mipfilter value %#x.\n", *value);
4955 *value = D3DTFP_NONE;
4956 break;
4957 }
4958 break;
4959 }
4960
4961 /* Magfilter has slightly different values */
4962 case D3DTSS_MAGFILTER:
4963 {
4964 switch (*value)
4965 {
4966 case WINED3D_TEXF_POINT:
4968 break;
4971 break;
4974 break;
4977 break;
4980 break;
4981 default:
4982 ERR("Unexpected wined3d mag filter value %#x.\n", *value);
4984 break;
4985 }
4986 break;
4987 }
4988
4989 default:
4990 break;
4991 }
4992 }
4993 else
4994 {
4995 *value = wined3d_device_get_texture_stage_state(device->wined3d_device, stage, l->u.texture_state);
4996 }
4997
4999
5000 return D3D_OK;
5001}
r l[0]
Definition: byte_order.h:168
@ D3DTSS_MAGFILTER
Definition: d3d8types.h:926
@ D3DTSS_MIPFILTER
Definition: d3d8types.h:928
@ D3DTSS_TEXTURETRANSFORMFLAGS
Definition: d3d8types.h:934
@ D3DTFP_LINEAR
Definition: d3dtypes.h:1166
@ D3DTFP_POINT
Definition: d3dtypes.h:1165
@ D3DTFP_NONE
Definition: d3dtypes.h:1164
@ D3DTFG_GAUSSIANCUBIC
Definition: d3dtypes.h:1149
@ D3DTFG_POINT
Definition: d3dtypes.h:1146
@ D3DTFG_ANISOTROPIC
Definition: d3dtypes.h:1150
@ D3DTFG_FLATCUBIC
Definition: d3dtypes.h:1148
@ D3DTFG_LINEAR
Definition: d3dtypes.h:1147
@ WINED3D_TEXF_GAUSSIAN_CUBIC
Definition: wined3d.h:690
@ WINED3D_TEXF_FLAT_CUBIC
Definition: wined3d.h:689
@ WINED3D_TEXF_ANISOTROPIC
Definition: wined3d.h:688

Referenced by d3d_device7_GetTextureStageState_FPUPreserve(), and d3d_device7_GetTextureStageState_FPUSetup().

◆ d3d_device7_GetTextureStageState_FPUPreserve()

static HRESULT WINAPI d3d_device7_GetTextureStageState_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD  stage,
D3DTEXTURESTAGESTATETYPE  state,
DWORD value 
)
static

Definition at line 5009 of file device.c.

5011{
5012 HRESULT hr;
5013 WORD old_fpucw;
5014
5015 old_fpucw = d3d_fpu_setup();
5017 set_fpu_control_word(old_fpucw);
5018
5019 return hr;
5020}
static HRESULT d3d_device7_GetTextureStageState(IDirect3DDevice7 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD *value)
Definition: device.c:4911

◆ d3d_device7_GetTextureStageState_FPUSetup()

static HRESULT WINAPI d3d_device7_GetTextureStageState_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD  stage,
D3DTEXTURESTAGESTATETYPE  state,
DWORD value 
)
static

Definition at line 5003 of file device.c.

5005{
5006 return d3d_device7_GetTextureStageState(iface, stage, state, value);
5007}

◆ d3d_device7_GetTransform()

static HRESULT d3d_device7_GetTransform ( IDirect3DDevice7 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX matrix 
)
static

Definition at line 3244 of file device.c.

3246{
3249
3250 TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
3251
3252 switch (state)
3253 {
3256 break;
3259 break;
3262 break;
3265 break;
3266 default:
3268 }
3269
3270 if (!matrix)
3271 return DDERR_INVALIDPARAMS;
3272
3273 /* Note: D3DMATRIX is compatible with struct wined3d_matrix. */
3277
3278 return D3D_OK;
3279}
void CDECL wined3d_device_get_transform(const struct wined3d_device *device, enum wined3d_transform_state state, struct wined3d_matrix *matrix)
Definition: device.c:1540
#define D3DTRANSFORMSTATE_WORLD2
Definition: dx7todx8.h:24
#define D3DTRANSFORMSTATE_WORLD1
Definition: dx7todx8.h:23
#define D3DTRANSFORMSTATE_WORLD
Definition: dx7todx8.h:22
#define D3DTRANSFORMSTATE_WORLD3
Definition: dx7todx8.h:25
wined3d_transform_state
Definition: wined3d.h:647

Referenced by d3d_device7_GetTransform_FPUPreserve(), and d3d_device7_GetTransform_FPUSetup().

◆ d3d_device7_GetTransform_FPUPreserve()

static HRESULT WINAPI d3d_device7_GetTransform_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX matrix 
)
static

Definition at line 3287 of file device.c.

3289{
3290 HRESULT hr;
3291 WORD old_fpucw;
3292
3293 old_fpucw = d3d_fpu_setup();
3295 set_fpu_control_word(old_fpucw);
3296
3297 return hr;
3298}
static HRESULT d3d_device7_GetTransform(IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
Definition: device.c:3244

◆ d3d_device7_GetTransform_FPUSetup()

static HRESULT WINAPI d3d_device7_GetTransform_FPUSetup ( IDirect3DDevice7 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX matrix 
)
static

Definition at line 3281 of file device.c.

3283{
3284 return d3d_device7_GetTransform(iface, state, matrix);
3285}

◆ d3d_device7_GetViewport()

static HRESULT d3d_device7_GetViewport ( IDirect3DDevice7 *  iface,
D3DVIEWPORT7 viewport 
)
static

Definition at line 5371 of file device.c.

5372{
5375
5376 TRACE("iface %p, viewport %p.\n", iface, viewport);
5377
5378 if (!viewport)
5379 return DDERR_INVALIDPARAMS;
5380
5384
5385 viewport->dwX = wined3d_viewport.x;
5386 viewport->dwY = wined3d_viewport.y;
5387 viewport->dwWidth = wined3d_viewport.width;
5388 viewport->dwHeight = wined3d_viewport.height;
5389 viewport->dvMinZ = wined3d_viewport.min_z;
5390 viewport->dvMaxZ = wined3d_viewport.max_z;
5391
5392 return D3D_OK;
5393}
void CDECL wined3d_device_get_viewport(const struct wined3d_device *device, struct wined3d_viewport *viewport)
Definition: device.c:1950
D3DVALUE dvMinZ
Definition: d3dtypes.h:395
DWORD dwWidth
Definition: d3dtypes.h:393
D3DVALUE dvMaxZ
Definition: d3dtypes.h:396
DWORD dwHeight
Definition: d3dtypes.h:394

Referenced by d3d_device7_GetViewport_FPUPreserve(), and d3d_device7_GetViewport_FPUSetup().

◆ d3d_device7_GetViewport_FPUPreserve()

static HRESULT WINAPI d3d_device7_GetViewport_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DVIEWPORT7 viewport 
)
static

Definition at line 5400 of file device.c.

5401{
5402 HRESULT hr;
5403 WORD old_fpucw;
5404
5405 old_fpucw = d3d_fpu_setup();
5406 hr = d3d_device7_GetViewport(iface, viewport);
5407 set_fpu_control_word(old_fpucw);
5408
5409 return hr;
5410}
static HRESULT d3d_device7_GetViewport(IDirect3DDevice7 *iface, D3DVIEWPORT7 *viewport)
Definition: device.c:5371

◆ d3d_device7_GetViewport_FPUSetup()

static HRESULT WINAPI d3d_device7_GetViewport_FPUSetup ( IDirect3DDevice7 *  iface,
D3DVIEWPORT7 viewport 
)
static

Definition at line 5395 of file device.c.

5396{
5397 return d3d_device7_GetViewport(iface, viewport);
5398}

◆ d3d_device7_LightEnable()

static HRESULT d3d_device7_LightEnable ( IDirect3DDevice7 *  iface,
DWORD  light_idx,
BOOL  enabled 
)
static

Definition at line 6372 of file device.c.

6373{
6375 HRESULT hr;
6376
6377 TRACE("iface %p, light_idx %u, enabled %#x.\n", iface, light_idx, enabled);
6378
6380 hr = wined3d_device_set_light_enable(device->wined3d_device, light_idx, enabled);
6382
6383 return hr_ddraw_from_wined3d(hr);
6384}
HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UINT light_idx, BOOL enable)
Definition: device.c:1741

Referenced by d3d_device7_LightEnable_FPUPreserve(), and d3d_device7_LightEnable_FPUSetup().

◆ d3d_device7_LightEnable_FPUPreserve()

static HRESULT WINAPI d3d_device7_LightEnable_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD  light_idx,
BOOL  enabled 
)
static

Definition at line 6391 of file device.c.

6392{
6393 HRESULT hr;
6394 WORD old_fpucw;
6395
6396 old_fpucw = d3d_fpu_setup();
6397 hr = d3d_device7_LightEnable(iface, light_idx, enabled);
6398 set_fpu_control_word(old_fpucw);
6399
6400 return hr;
6401}
static HRESULT d3d_device7_LightEnable(IDirect3DDevice7 *iface, DWORD light_idx, BOOL enabled)
Definition: device.c:6372

◆ d3d_device7_LightEnable_FPUSetup()

static HRESULT WINAPI d3d_device7_LightEnable_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD  light_idx,
BOOL  enabled 
)
static

Definition at line 6386 of file device.c.

6387{
6388 return d3d_device7_LightEnable(iface, light_idx, enabled);
6389}

◆ d3d_device7_Load()

static HRESULT d3d_device7_Load ( IDirect3DDevice7 *  iface,
IDirectDrawSurface7 dst_texture,
POINT dst_pos,
IDirectDrawSurface7 src_texture,
RECT src_rect,
DWORD  flags 
)
static

Definition at line 6173 of file device.c.

6175{
6179 POINT destpoint;
6180 RECT srcrect;
6181
6182 TRACE("iface %p, dst_texture %p, dst_pos %s, src_texture %p, src_rect %s, flags %#x.\n",
6183 iface, dst_texture, wine_dbgstr_point(dst_pos), src_texture, wine_dbgstr_rect(src_rect), flags);
6184
6185 if( (!src) || (!dest) )
6186 return DDERR_INVALIDPARAMS;
6187
6189
6190 if (!src_rect)
6191 SetRect(&srcrect, 0, 0, src->surface_desc.dwWidth, src->surface_desc.dwHeight);
6192 else
6193 srcrect = *src_rect;
6194
6195 if (!dst_pos)
6196 destpoint.x = destpoint.y = 0;
6197 else
6198 destpoint = *dst_pos;
6199
6200 /* Check bad dimensions. dst_pos is validated against src, not dest, because
6201 * destination can be a subset of mip levels, in which case actual coordinates used
6202 * for it may be divided. If any dimension of dest is larger than source, it can't be
6203 * mip level subset, so an error can be returned early.
6204 */
6205 if (IsRectEmpty(&srcrect) || srcrect.right > src->surface_desc.dwWidth ||
6206 srcrect.bottom > src->surface_desc.dwHeight ||
6207 destpoint.x + srcrect.right - srcrect.left > src->surface_desc.dwWidth ||
6208 destpoint.y + srcrect.bottom - srcrect.top > src->surface_desc.dwHeight ||
6209 dest->surface_desc.dwWidth > src->surface_desc.dwWidth ||
6210 dest->surface_desc.dwHeight > src->surface_desc.dwHeight)
6211 {
6213 return DDERR_INVALIDPARAMS;
6214 }
6215
6216 /* Must be top level surfaces. */
6217 if (src->surface_desc.ddsCaps.dwCaps2 & DDSCAPS2_MIPMAPSUBLEVEL ||
6218 dest->surface_desc.ddsCaps.dwCaps2 & DDSCAPS2_MIPMAPSUBLEVEL)
6219 {
6221 return DDERR_INVALIDPARAMS;
6222 }
6223
6224 if (src->surface_desc.ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP)
6225 {
6226 struct ddraw_surface *src_face, *dest_face;
6227 DWORD src_face_flag, dest_face_flag;
6229 DDSURFACEDESC2 ddsd;
6230 int i;
6231
6232 if (!(dest->surface_desc.ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP))
6233 {
6235 return DDERR_INVALIDPARAMS;
6236 }
6237
6238 /* Iterate through cube faces 2 times. First time is just to check INVALIDPARAMS conditions, second
6239 * time it's actual surface loading. */
6240 for (i = 0; i < 2; i++)
6241 {
6242 dest_face = dest;
6243 src_face = src;
6244
6245 for (;dest_face && src_face;)
6246 {
6247 src_face_flag = src_face->surface_desc.ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP_ALLFACES;
6248 dest_face_flag = dest_face->surface_desc.ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP_ALLFACES;
6249
6250 if (src_face_flag == dest_face_flag)
6251 {
6252 if (i == 0)
6253 {
6254 /* Destination mip levels must be subset of source mip levels. */
6255 if (!is_mip_level_subset(dest_face, src_face))
6256 {
6258 return DDERR_INVALIDPARAMS;
6259 }
6260 }
6261 else if (flags & dest_face_flag)
6262 {
6263 copy_mipmap_chain(device, dest_face, src_face, &destpoint, &srcrect);
6264 }
6265
6266 if (src_face_flag < DDSCAPS2_CUBEMAP_NEGATIVEZ)
6267 {
6269 ddsd.ddsCaps.dwCaps2 = DDSCAPS2_CUBEMAP | (src_face_flag << 1);
6270 IDirectDrawSurface7_GetAttachedSurface(&src->IDirectDrawSurface7_iface, &ddsd.ddsCaps, &temp);
6271
6272 if (src_face != src) IDirectDrawSurface7_Release(&src_face->IDirectDrawSurface7_iface);
6273
6275 }
6276 else
6277 {
6278 if (src_face != src) IDirectDrawSurface7_Release(&src_face->IDirectDrawSurface7_iface);
6279
6280 src_face = NULL;
6281 }
6282 }
6283
6284 if (dest_face_flag < DDSCAPS2_CUBEMAP_NEGATIVEZ)
6285 {
6287 ddsd.ddsCaps.dwCaps2 = DDSCAPS2_CUBEMAP | (dest_face_flag << 1);
6288 IDirectDrawSurface7_GetAttachedSurface(&dest->IDirectDrawSurface7_iface, &ddsd.ddsCaps, &temp);
6289
6290 if (dest_face != dest) IDirectDrawSurface7_Release(&dest_face->IDirectDrawSurface7_iface);
6291
6293 }
6294 else
6295 {
6296 if (dest_face != dest) IDirectDrawSurface7_Release(&dest_face->IDirectDrawSurface7_iface);
6297
6298 dest_face = NULL;
6299 }
6300 }
6301
6302 if (i == 0)
6303 {
6304 /* Native returns error if src faces are not subset of dest faces. */
6305 if (src_face)
6306 {
6308 return DDERR_INVALIDPARAMS;
6309 }
6310 }
6311 }
6312
6314 return D3D_OK;
6315 }
6316 else if (dest->surface_desc.ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP)
6317 {
6319 return DDERR_INVALIDPARAMS;
6320 }
6321
6322 /* Handle non cube map textures. */
6323
6324 /* Destination mip levels must be subset of source mip levels. */
6326 {
6328 return DDERR_INVALIDPARAMS;
6329 }
6330
6331 copy_mipmap_chain(device, dest, src, &destpoint, &srcrect);
6332
6334
6335 return D3D_OK;
6336}
static const char * wine_dbgstr_point(const POINT *ppt)
Definition: atltest.h:138
static BOOL is_mip_level_subset(struct ddraw_surface *dest, struct ddraw_surface *src)
Definition: device.c:6011
static void copy_mipmap_chain(struct d3d_device *device, struct ddraw_surface *dst, struct ddraw_surface *src, const POINT *DestPoint, const RECT *SrcRect)
Definition: device.c:6058
static char * dest
Definition: rtl.c:135
#define DDSCAPS2_CUBEMAP_NEGATIVEZ
Definition: ddraw.h:296
#define DDSCAPS2_CUBEMAP_ALLFACES
Definition: ddraw.h:297
#define DDSCAPS2_CUBEMAP
Definition: ddraw.h:290
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)

Referenced by d3d_device7_Load_FPUPreserve(), and d3d_device7_Load_FPUSetup().

◆ d3d_device7_Load_FPUPreserve()

static HRESULT WINAPI d3d_device7_Load_FPUPreserve ( IDirect3DDevice7 *  iface,
IDirectDrawSurface7 dst_texture,
POINT dst_pos,
IDirectDrawSurface7 src_texture,
RECT src_rect,
DWORD  flags 
)
static

Definition at line 6344 of file device.c.

6346{
6347 HRESULT hr;
6348 WORD old_fpucw;
6349
6350 old_fpucw = d3d_fpu_setup();
6351 hr = d3d_device7_Load(iface, dst_texture, dst_pos, src_texture, src_rect, flags);
6352 set_fpu_control_word(old_fpucw);
6353
6354 return hr;
6355}
static HRESULT d3d_device7_Load(IDirect3DDevice7 *iface, IDirectDrawSurface7 *dst_texture, POINT *dst_pos, IDirectDrawSurface7 *src_texture, RECT *src_rect, DWORD flags)
Definition: device.c:6173

◆ d3d_device7_Load_FPUSetup()

static HRESULT WINAPI d3d_device7_Load_FPUSetup ( IDirect3DDevice7 *  iface,
IDirectDrawSurface7 dst_texture,
POINT dst_pos,
IDirectDrawSurface7 src_texture,
RECT src_rect,
DWORD  flags 
)
static

Definition at line 6338 of file device.c.

6340{
6341 return d3d_device7_Load(iface, dst_texture, dst_pos, src_texture, src_rect, flags);
6342}

◆ d3d_device7_MultiplyTransform()

static HRESULT d3d_device7_MultiplyTransform ( IDirect3DDevice7 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX matrix 
)
static

Definition at line 3348 of file device.c.

3350{
3353
3354 TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
3355
3356 switch (state)
3357 {
3360 break;
3363 break;
3366 break;
3369 break;
3370 default:
3372 }
3373
3374 /* Note: D3DMATRIX is compatible with struct wined3d_matrix. */
3379
3380 return D3D_OK;
3381}
void CDECL wined3d_device_multiply_transform(struct wined3d_device *device, enum wined3d_transform_state state, const struct wined3d_matrix *matrix)
Definition: device.c:1548

Referenced by d3d_device7_MultiplyTransform_FPUPreserve(), and d3d_device7_MultiplyTransform_FPUSetup().

◆ d3d_device7_MultiplyTransform_FPUPreserve()

static HRESULT WINAPI d3d_device7_MultiplyTransform_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX matrix 
)
static

Definition at line 3389 of file device.c.

3391{
3392 HRESULT hr;
3393 WORD old_fpucw;
3394
3395 old_fpucw = d3d_fpu_setup();
3397 set_fpu_control_word(old_fpucw);
3398
3399 return hr;
3400}
static HRESULT d3d_device7_MultiplyTransform(IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
Definition: device.c:3348

◆ d3d_device7_MultiplyTransform_FPUSetup()

static HRESULT WINAPI d3d_device7_MultiplyTransform_FPUSetup ( IDirect3DDevice7 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX matrix 
)
static

Definition at line 3383 of file device.c.

3385{
3387}

◆ d3d_device7_PreLoad()

static HRESULT d3d_device7_PreLoad ( IDirect3DDevice7 *  iface,
IDirectDrawSurface7 texture 
)
static

Definition at line 5730 of file device.c.

5731{
5733
5734 TRACE("iface %p, texture %p.\n", iface, texture);
5735
5736 if (!texture)
5737 return DDERR_INVALIDPARAMS;
5738
5742
5743 return D3D_OK;
5744}
void CDECL wined3d_resource_preload(struct wined3d_resource *resource)
Definition: resource.c:482

Referenced by d3d_device7_PreLoad_FPUPreserve(), and d3d_device7_PreLoad_FPUSetup().

◆ d3d_device7_PreLoad_FPUPreserve()

static HRESULT WINAPI d3d_device7_PreLoad_FPUPreserve ( IDirect3DDevice7 *  iface,
IDirectDrawSurface7 texture 
)
static

Definition at line 5751 of file device.c.

5752{
5753 HRESULT hr;
5754 WORD old_fpucw;
5755
5756 old_fpucw = d3d_fpu_setup();
5757 hr = d3d_device7_PreLoad(iface, texture);
5758 set_fpu_control_word(old_fpucw);
5759
5760 return hr;
5761}
static HRESULT d3d_device7_PreLoad(IDirect3DDevice7 *iface, IDirectDrawSurface7 *texture)
Definition: device.c:5730

◆ d3d_device7_PreLoad_FPUSetup()

static HRESULT WINAPI d3d_device7_PreLoad_FPUSetup ( IDirect3DDevice7 *  iface,
IDirectDrawSurface7 texture 
)
static

Definition at line 5746 of file device.c.

5747{
5748 return d3d_device7_PreLoad(iface, texture);
5749}

◆ d3d_device7_QueryInterface()

static HRESULT WINAPI d3d_device7_QueryInterface ( IDirect3DDevice7 *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 141 of file device.c.

142{
144
145 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
146
147 return IUnknown_QueryInterface(device->outer_unknown, riid, out);
148}

◆ d3d_device7_Release()

static ULONG WINAPI d3d_device7_Release ( IDirect3DDevice7 *  iface)
static

Definition at line 333 of file device.c.

334{
336
337 TRACE("iface %p.\n", iface);
338
339 return IUnknown_Release(device->outer_unknown);
340}

◆ d3d_device7_SetClipPlane()

static HRESULT d3d_device7_SetClipPlane ( IDirect3DDevice7 *  iface,
DWORD  idx,
D3DVALUE plane 
)
static

Definition at line 6469 of file device.c.

6470{
6472 const struct wined3d_vec4 *wined3d_plane;
6473 HRESULT hr;
6474
6475 TRACE("iface %p, idx %u, plane %p.\n", iface, idx, plane);
6476
6477 if (!plane)
6478 return DDERR_INVALIDPARAMS;
6479
6480 wined3d_plane = (struct wined3d_vec4 *)plane;
6481
6483 hr = wined3d_device_set_clip_plane(device->wined3d_device, idx, wined3d_plane);
6484 if (idx < ARRAY_SIZE(device->user_clip_planes))
6485 {
6486 device->user_clip_planes[idx] = *wined3d_plane;
6488 {
6489 WARN("Clip plane %u is not supported.\n", idx);
6490 hr = D3D_OK;
6491 }
6492 }
6494
6495 return hr;
6496}
HRESULT CDECL wined3d_device_set_clip_plane(struct wined3d_device *device, UINT plane_idx, const struct wined3d_vec4 *plane)
Definition: device.c:1783

Referenced by d3d_device7_SetClipPlane_FPUPreserve(), and d3d_device7_SetClipPlane_FPUSetup().

◆ d3d_device7_SetClipPlane_FPUPreserve()

static HRESULT WINAPI d3d_device7_SetClipPlane_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD  idx,
D3DVALUE plane 
)
static

Definition at line 6503 of file device.c.

6504{
6505 HRESULT hr;
6506 WORD old_fpucw;
6507
6508 old_fpucw = d3d_fpu_setup();
6510 set_fpu_control_word(old_fpucw);
6511
6512 return hr;
6513}
static HRESULT d3d_device7_SetClipPlane(IDirect3DDevice7 *iface, DWORD idx, D3DVALUE *plane)
Definition: device.c:6469

◆ d3d_device7_SetClipPlane_FPUSetup()

static HRESULT WINAPI d3d_device7_SetClipPlane_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD  idx,
D3DVALUE plane 
)
static

Definition at line 6498 of file device.c.

6499{
6500 return d3d_device7_SetClipPlane(iface, idx, plane);
6501}

◆ d3d_device7_SetClipStatus()

static HRESULT WINAPI d3d_device7_SetClipStatus ( IDirect3DDevice7 *  iface,
D3DCLIPSTATUS clip_status 
)
static

Definition at line 3883 of file device.c.

3884{
3885 FIXME("iface %p, clip_status %p stub!\n", iface, clip_status);
3886
3887 return D3D_OK;
3888}

◆ d3d_device7_SetLight()

static HRESULT d3d_device7_SetLight ( IDirect3DDevice7 *  iface,
DWORD  light_idx,
D3DLIGHT7 light 
)
static

Definition at line 5522 of file device.c.

5523{
5525 HRESULT hr;
5526
5527 TRACE("iface %p, light_idx %u, light %p.\n", iface, light_idx, light);
5528
5530 /* Note: D3DLIGHT7 is compatible with struct wined3d_light. */
5531 hr = wined3d_device_set_light(device->wined3d_device, light_idx, (struct wined3d_light *)light);
5533
5534 return hr_ddraw_from_wined3d(hr);
5535}
HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, UINT light_idx, const struct wined3d_light *light)
Definition: device.c:1580

Referenced by d3d_device7_SetLight_FPUPreserve(), and d3d_device7_SetLight_FPUSetup().

◆ d3d_device7_SetLight_FPUPreserve()

static HRESULT WINAPI d3d_device7_SetLight_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD  light_idx,
D3DLIGHT7 light 
)
static

Definition at line 5542 of file device.c.

5543{
5544 HRESULT hr;
5545 WORD old_fpucw;
5546
5547 old_fpucw = d3d_fpu_setup();
5548 hr = d3d_device7_SetLight(iface, light_idx, light);
5549 set_fpu_control_word(old_fpucw);
5550
5551 return hr;
5552}
static HRESULT d3d_device7_SetLight(IDirect3DDevice7 *iface, DWORD light_idx, D3DLIGHT7 *light)
Definition: device.c:5522

◆ d3d_device7_SetLight_FPUSetup()

static HRESULT WINAPI d3d_device7_SetLight_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD  light_idx,
D3DLIGHT7 light 
)
static

Definition at line 5537 of file device.c.

5538{
5539 return d3d_device7_SetLight(iface, light_idx, light);
5540}

◆ d3d_device7_SetMaterial()

static HRESULT d3d_device7_SetMaterial ( IDirect3DDevice7 *  iface,
D3DMATERIAL7 material 
)
static

Definition at line 5427 of file device.c.

5428{
5430
5431 TRACE("iface %p, material %p.\n", iface, material);
5432
5433 if (!material)
5434 return DDERR_INVALIDPARAMS;
5435
5437 /* Note: D3DMATERIAL7 is compatible with struct wined3d_material. */
5438 wined3d_device_set_material(device->wined3d_device, (struct wined3d_material *)material);
5440
5441 return D3D_OK;
5442}
void CDECL wined3d_device_set_material(struct wined3d_device *device, const struct wined3d_material *material)
Definition: device.c:1849

Referenced by d3d_device7_SetMaterial_FPUPreserve(), and d3d_device7_SetMaterial_FPUSetup().

◆ d3d_device7_SetMaterial_FPUPreserve()

static HRESULT WINAPI d3d_device7_SetMaterial_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DMATERIAL7 material 
)
static

Definition at line 5449 of file device.c.

5450{
5451 HRESULT hr;
5452 WORD old_fpucw;
5453
5454 old_fpucw = d3d_fpu_setup();
5455 hr = d3d_device7_SetMaterial(iface, material);
5456 set_fpu_control_word(old_fpucw);
5457
5458 return hr;
5459}
static HRESULT d3d_device7_SetMaterial(IDirect3DDevice7 *iface, D3DMATERIAL7 *material)
Definition: device.c:5427

◆ d3d_device7_SetMaterial_FPUSetup()

static HRESULT WINAPI d3d_device7_SetMaterial_FPUSetup ( IDirect3DDevice7 *  iface,
D3DMATERIAL7 material 
)
static

Definition at line 5444 of file device.c.

5445{
5446 return d3d_device7_SetMaterial(iface, material);
5447}

◆ d3d_device7_SetRenderState()

static HRESULT d3d_device7_SetRenderState ( IDirect3DDevice7 *  iface,
D3DRENDERSTATETYPE  state,
DWORD  value 
)
static

Definition at line 2557 of file device.c.

2559{
2561 HRESULT hr = D3D_OK;
2562
2563 TRACE("iface %p, state %#x, value %#x.\n", iface, state, value);
2564
2566 /* Some render states need special care */
2567 switch (state)
2568 {
2569 /*
2570 * The ddraw texture filter mapping works like this:
2571 * D3DFILTER_NEAREST Point min/mag, no mip
2572 * D3DFILTER_MIPNEAREST Point min/mag, point mip
2573 * D3DFILTER_LINEARMIPNEAREST: Point min/mag, linear mip
2574 *
2575 * D3DFILTER_LINEAR Linear min/mag, no mip
2576 * D3DFILTER_MIPLINEAR Linear min/mag, point mip
2577 * D3DFILTER_LINEARMIPLINEAR Linear min/mag, linear mip
2578 *
2579 * This is the opposite of the GL naming convention,
2580 * D3DFILTER_LINEARMIPNEAREST corresponds to GL_NEAREST_MIPMAP_LINEAR.
2581 */
2583 {
2584 enum wined3d_texture_filter_type tex_mag;
2585
2586 switch (value)
2587 {
2588 case D3DFILTER_NEAREST:
2591 tex_mag = WINED3D_TEXF_POINT;
2592 break;
2593 case D3DFILTER_LINEAR:
2596 tex_mag = WINED3D_TEXF_LINEAR;
2597 break;
2598 default:
2599 tex_mag = WINED3D_TEXF_POINT;
2600 FIXME("Unhandled texture mag %#x.\n", value);
2601 break;
2602 }
2603
2605 break;
2606 }
2607
2609 {
2610 enum wined3d_texture_filter_type tex_min;
2611 enum wined3d_texture_filter_type tex_mip;
2612
2613 switch (value)
2614 {
2615 case D3DFILTER_NEAREST:
2616 tex_min = WINED3D_TEXF_POINT;
2617 tex_mip = WINED3D_TEXF_NONE;
2618 break;
2619 case D3DFILTER_LINEAR:
2620 tex_min = WINED3D_TEXF_LINEAR;
2621 tex_mip = WINED3D_TEXF_NONE;
2622 break;
2624 tex_min = WINED3D_TEXF_POINT;
2625 tex_mip = WINED3D_TEXF_POINT;
2626 break;
2628 tex_min = WINED3D_TEXF_LINEAR;
2629 tex_mip = WINED3D_TEXF_POINT;
2630 break;
2632 tex_min = WINED3D_TEXF_POINT;
2633 tex_mip = WINED3D_TEXF_LINEAR;
2634 break;
2636 tex_min = WINED3D_TEXF_LINEAR;
2637 tex_mip = WINED3D_TEXF_LINEAR;
2638 break;
2639
2640 default:
2641 FIXME("Unhandled texture min %#x.\n",value);
2642 tex_min = WINED3D_TEXF_POINT;
2643 tex_mip = WINED3D_TEXF_NONE;
2644 break;
2645 }
2646
2648 0, WINED3D_SAMP_MIP_FILTER, tex_mip);
2650 0, WINED3D_SAMP_MIN_FILTER, tex_min);
2651 break;
2652 }
2653
2657 /* Drop through */
2661 break;
2665 break;
2666
2668 /* This should probably just forward to the corresponding sampler
2669 * state. Needs tests. */
2670 FIXME("Unhandled render state D3DRENDERSTATE_BORDERCOLOR.\n");
2671 hr = E_NOTIMPL;
2672 break;
2673
2676 WARN("Render state %#x is invalid in d3d7.\n", state);
2678 break;
2679
2682 break;
2683
2684 default:
2687 {
2688 FIXME("Unhandled stipple pattern render state (%#x).\n", state);
2689 hr = E_NOTIMPL;
2690 break;
2691 }
2692
2694 break;
2695 }
2697
2698 return hr;
2699}
void CDECL wined3d_device_set_sampler_state(struct wined3d_device *device, UINT sampler_idx, enum wined3d_sampler_state state, DWORD value)
Definition: device.c:2071
void CDECL wined3d_device_set_render_state(struct wined3d_device *device, enum wined3d_render_state state, DWORD value)
Definition: device.c:2027

Referenced by d3d_device7_SetRenderState_FPUPreserve(), and d3d_device7_SetRenderState_FPUSetup().

◆ d3d_device7_SetRenderState_FPUPreserve()

static HRESULT WINAPI d3d_device7_SetRenderState_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DRENDERSTATETYPE  state,
DWORD  value 
)
static

Definition at line 2707 of file device.c.

2709{
2710 HRESULT hr;
2711 WORD old_fpucw;
2712
2713 old_fpucw = d3d_fpu_setup();
2715 set_fpu_control_word(old_fpucw);
2716
2717 return hr;
2718}
static HRESULT d3d_device7_SetRenderState(IDirect3DDevice7 *iface, D3DRENDERSTATETYPE state, DWORD value)
Definition: device.c:2557

◆ d3d_device7_SetRenderState_FPUSetup()

static HRESULT WINAPI d3d_device7_SetRenderState_FPUSetup ( IDirect3DDevice7 *  iface,
D3DRENDERSTATETYPE  state,
DWORD  value 
)
static

Definition at line 2701 of file device.c.

2703{
2704 return d3d_device7_SetRenderState(iface, state, value);
2705}

◆ d3d_device7_SetRenderTarget()

static HRESULT d3d_device7_SetRenderTarget ( IDirect3DDevice7 *  iface,
IDirectDrawSurface7 target,
DWORD  flags 
)
static

Definition at line 1832 of file device.c.

1834{
1837 HRESULT hr;
1838
1839 TRACE("iface %p, target %p, flags %#x.\n", iface, target, flags);
1840
1842
1843 if (!validate_surface_palette(target_impl))
1844 {
1845 WARN("Surface %p has an indexed pixel format, but no palette.\n", target_impl);
1847 return DDERR_INVALIDCAPS;
1848 }
1849
1850 if (!(target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_3DDEVICE))
1851 {
1852 WARN("Surface %p is not a render target.\n", target_impl);
1854 return DDERR_INVALIDCAPS;
1855 }
1856
1857 if (device->hw && !(target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY))
1858 {
1859 WARN("Surface %p is not in video memory.\n", target_impl);
1861 return DDERR_INVALIDPARAMS;
1862 }
1863
1864 if (target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_ZBUFFER)
1865 {
1866 WARN("Surface %p is a depth buffer.\n", target_impl);
1867 IDirectDrawSurface7_AddRef(target);
1868 IUnknown_Release(device->rt_iface);
1869 device->rt_iface = (IUnknown *)target;
1872 }
1873
1876 return hr;
1877}

Referenced by d3d_device7_SetRenderTarget_FPUPreserve(), and d3d_device7_SetRenderTarget_FPUSetup().

◆ d3d_device7_SetRenderTarget_FPUPreserve()

static HRESULT WINAPI d3d_device7_SetRenderTarget_FPUPreserve ( IDirect3DDevice7 *  iface,
IDirectDrawSurface7 NewTarget,
DWORD  flags 
)
static

Definition at line 1885 of file device.c.

1887{
1888 HRESULT hr;
1889 WORD old_fpucw;
1890
1891 old_fpucw = d3d_fpu_setup();
1892 hr = d3d_device7_SetRenderTarget(iface, NewTarget, flags);
1893 set_fpu_control_word(old_fpucw);
1894
1895 return hr;
1896}
static HRESULT d3d_device7_SetRenderTarget(IDirect3DDevice7 *iface, IDirectDrawSurface7 *target, DWORD flags)
Definition: device.c:1832

◆ d3d_device7_SetRenderTarget_FPUSetup()

static HRESULT WINAPI d3d_device7_SetRenderTarget_FPUSetup ( IDirect3DDevice7 *  iface,
IDirectDrawSurface7 NewTarget,
DWORD  flags 
)
static

Definition at line 1879 of file device.c.

1881{
1882 return d3d_device7_SetRenderTarget(iface, NewTarget, flags);
1883}

◆ d3d_device7_SetTexture()

static HRESULT d3d_device7_SetTexture ( IDirect3DDevice7 *  iface,
DWORD  stage,
IDirectDrawSurface7 texture 
)
static

Definition at line 4767 of file device.c.

4769{
4773 HRESULT hr;
4774
4775 TRACE("iface %p, stage %u, texture %p.\n", iface, stage, texture);
4776
4777 if (surf && (surf->surface_desc.ddsCaps.dwCaps & DDSCAPS_TEXTURE))
4779
4781 hr = wined3d_device_set_texture(device->wined3d_device, stage, wined3d_texture);
4783
4784 return hr;
4785}

Referenced by d3d_device7_SetTexture_FPUPreserve(), and d3d_device7_SetTexture_FPUSetup().

◆ d3d_device7_SetTexture_FPUPreserve()

static HRESULT WINAPI d3d_device7_SetTexture_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD  stage,
IDirectDrawSurface7 texture 
)
static

Definition at line 4793 of file device.c.

4795{
4796 HRESULT hr;
4797 WORD old_fpucw;
4798
4799 old_fpucw = d3d_fpu_setup();
4800 hr = d3d_device7_SetTexture(iface, stage, texture);
4801 set_fpu_control_word(old_fpucw);
4802
4803 return hr;
4804}
static HRESULT d3d_device7_SetTexture(IDirect3DDevice7 *iface, DWORD stage, IDirectDrawSurface7 *texture)
Definition: device.c:4767

◆ d3d_device7_SetTexture_FPUSetup()

static HRESULT WINAPI d3d_device7_SetTexture_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD  stage,
IDirectDrawSurface7 texture 
)
static

Definition at line 4787 of file device.c.

4789{
4790 return d3d_device7_SetTexture(iface, stage, texture);
4791}

◆ d3d_device7_SetTextureStageState()

static HRESULT d3d_device7_SetTextureStageState ( IDirect3DDevice7 *  iface,
DWORD  stage,
D3DTEXTURESTAGESTATETYPE  state,
DWORD  value 
)
static

Definition at line 5050 of file device.c.

5052{
5054 const struct tss_lookup *l;
5055
5056 TRACE("iface %p, stage %u, state %#x, value %#x.\n",
5057 iface, stage, state, value);
5058
5060 {
5061 WARN("Invalid state %#x passed.\n", state);
5062 return DD_OK;
5063 }
5064
5065 l = &tss_lookup[state];
5066
5068
5069 if (l->sampler_state)
5070 {
5071 switch (state)
5072 {
5073 /* Mipfilter is a sampler state with different values */
5074 case D3DTSS_MIPFILTER:
5075 {
5076 switch (value)
5077 {
5078 case D3DTFP_NONE:
5080 break;
5081 case D3DTFP_POINT:
5083 break;
5084 case 0: /* Unchecked */
5085 case D3DTFP_LINEAR:
5087 break;
5088 default:
5089 ERR("Unexpected mipfilter value %#x.\n", value);
5091 break;
5092 }
5093 break;
5094 }
5095
5096 /* Magfilter has slightly different values */
5097 case D3DTSS_MAGFILTER:
5098 {
5099 switch (value)
5100 {
5101 case D3DTFG_POINT:
5103 break;
5104 case D3DTFG_LINEAR:
5106 break;
5107 case D3DTFG_FLATCUBIC:
5109 break;
5112 break;
5113 case D3DTFG_ANISOTROPIC:
5115 break;
5116 default:
5117 ERR("Unexpected d3d7 mag filter value %#x.\n", value);
5119 break;
5120 }
5121 break;
5122 }
5123
5124 case D3DTSS_ADDRESS:
5126 break;
5127
5128 default:
5129 break;
5130 }
5131
5132 wined3d_device_set_sampler_state(device->wined3d_device, stage, l->u.sampler_state, value);
5133 }
5134 else
5135 {
5136 wined3d_device_set_texture_stage_state(device->wined3d_device, stage, l->u.texture_state, value);
5137 }
5138
5140
5141 return D3D_OK;
5142}
@ D3DTSS_ADDRESS
Definition: d3dtypes.h:1077

Referenced by d3d_device7_SetTextureStageState_FPUPreserve(), and d3d_device7_SetTextureStageState_FPUSetup().

◆ d3d_device7_SetTextureStageState_FPUPreserve()

static HRESULT WINAPI d3d_device7_SetTextureStageState_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD  stage,
D3DTEXTURESTAGESTATETYPE  state,
DWORD  value 
)
static

Definition at line 5150 of file device.c.

5152{
5153 HRESULT hr;
5154 WORD old_fpucw;
5155
5156 old_fpucw = d3d_fpu_setup();
5158 set_fpu_control_word(old_fpucw);
5159
5160 return hr;
5161}
static HRESULT d3d_device7_SetTextureStageState(IDirect3DDevice7 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD value)
Definition: device.c:5050

◆ d3d_device7_SetTextureStageState_FPUSetup()

static HRESULT WINAPI d3d_device7_SetTextureStageState_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD  stage,
D3DTEXTURESTAGESTATETYPE  state,
DWORD  value 
)
static

Definition at line 5144 of file device.c.

5146{
5147 return d3d_device7_SetTextureStageState(iface, stage, state, value);
5148}

◆ d3d_device7_SetTransform()

static HRESULT d3d_device7_SetTransform ( IDirect3DDevice7 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX matrix 
)
static

Definition at line 3135 of file device.c.

3137{
3140
3141 TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
3142
3143 switch (state)
3144 {
3147 break;
3150 break;
3153 break;
3156 break;
3157 default:
3159 }
3160
3161 if (!matrix)
3162 return DDERR_INVALIDPARAMS;
3163
3164 /* Note: D3DMATRIX is compatible with struct wined3d_matrix. */
3168
3169 return D3D_OK;
3170}

Referenced by d3d_device7_SetTransform_FPUPreserve(), and d3d_device7_SetTransform_FPUSetup().

◆ d3d_device7_SetTransform_FPUPreserve()

static HRESULT WINAPI d3d_device7_SetTransform_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX matrix 
)
static

Definition at line 3178 of file device.c.

3180{
3181 HRESULT hr;
3182 WORD old_fpucw;
3183
3184 old_fpucw = d3d_fpu_setup();
3186 set_fpu_control_word(old_fpucw);
3187
3188 return hr;
3189}
static HRESULT d3d_device7_SetTransform(IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
Definition: device.c:3135

◆ d3d_device7_SetTransform_FPUSetup()

static HRESULT WINAPI d3d_device7_SetTransform_FPUSetup ( IDirect3DDevice7 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX matrix 
)
static

Definition at line 3172 of file device.c.

3174{
3175 return d3d_device7_SetTransform(iface, state, matrix);
3176}

◆ d3d_device7_SetViewport()

static HRESULT d3d_device7_SetViewport ( IDirect3DDevice7 *  iface,
D3DVIEWPORT7 viewport 
)
static

Definition at line 5315 of file device.c.

5316{
5318 struct wined3d_viewport vp;
5319
5320 TRACE("iface %p, viewport %p.\n", iface, viewport);
5321
5322 if (!viewport)
5323 return DDERR_INVALIDPARAMS;
5324
5325 vp.x = viewport->dwX;
5326 vp.y = viewport->dwY;
5327 vp.width = viewport->dwWidth;
5328 vp.height = viewport->dwHeight;
5329 vp.min_z = viewport->dvMinZ;
5330 vp.max_z = viewport->dvMaxZ;
5331
5333 wined3d_device_set_viewport(device->wined3d_device, &vp);
5335
5336 return D3D_OK;
5337}
void CDECL wined3d_device_set_viewport(struct wined3d_device *device, const struct wined3d_viewport *viewport)
Definition: device.c:1931

Referenced by d3d_device7_SetViewport_FPUPreserve(), and d3d_device7_SetViewport_FPUSetup().

◆ d3d_device7_SetViewport_FPUPreserve()

static HRESULT WINAPI d3d_device7_SetViewport_FPUPreserve ( IDirect3DDevice7 *  iface,
D3DVIEWPORT7 viewport 
)
static

Definition at line 5344 of file device.c.

5345{
5346 HRESULT hr;
5347 WORD old_fpucw;
5348
5349 old_fpucw = d3d_fpu_setup();
5350 hr = d3d_device7_SetViewport(iface, viewport);
5351 set_fpu_control_word(old_fpucw);
5352
5353 return hr;
5354}
static HRESULT d3d_device7_SetViewport(IDirect3DDevice7 *iface, D3DVIEWPORT7 *viewport)
Definition: device.c:5315

◆ d3d_device7_SetViewport_FPUSetup()

static HRESULT WINAPI d3d_device7_SetViewport_FPUSetup ( IDirect3DDevice7 *  iface,
D3DVIEWPORT7 viewport 
)
static

Definition at line 5339 of file device.c.

5340{
5341 return d3d_device7_SetViewport(iface, viewport);
5342}

◆ d3d_device7_ValidateDevice()

static HRESULT d3d_device7_ValidateDevice ( IDirect3DDevice7 *  iface,
DWORD pass_count 
)
static

Definition at line 5191 of file device.c.

5192{
5194 HRESULT hr;
5195
5196 TRACE("iface %p, pass_count %p.\n", iface, pass_count);
5197
5199 hr = wined3d_device_validate_device(device->wined3d_device, pass_count);
5201
5202 return hr;
5203}
HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device, DWORD *num_passes)
Definition: device.c:3905

Referenced by d3d_device7_ValidateDevice_FPUPreserve(), and d3d_device7_ValidateDevice_FPUSetup().

◆ d3d_device7_ValidateDevice_FPUPreserve()

static HRESULT WINAPI d3d_device7_ValidateDevice_FPUPreserve ( IDirect3DDevice7 *  iface,
DWORD pass_count 
)
static

Definition at line 5210 of file device.c.

5211{
5212 HRESULT hr;
5213 WORD old_fpucw;
5214
5215 old_fpucw = d3d_fpu_setup();
5216 hr = d3d_device7_ValidateDevice(iface, pass_count);
5217 set_fpu_control_word(old_fpucw);
5218
5219 return hr;
5220}
static HRESULT d3d_device7_ValidateDevice(IDirect3DDevice7 *iface, DWORD *pass_count)
Definition: device.c:5191

◆ d3d_device7_ValidateDevice_FPUSetup()

static HRESULT WINAPI d3d_device7_ValidateDevice_FPUSetup ( IDirect3DDevice7 *  iface,
DWORD pass_count 
)
static

Definition at line 5205 of file device.c.

5206{
5207 return d3d_device7_ValidateDevice(iface, pass_count);
5208}

◆ d3d_device_create()

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 
)

Definition at line 6980 of file device.c.

6982{
6983 struct d3d_device *object;
6984 BOOL hw = TRUE;
6985 HRESULT hr;
6986
6987 TRACE("ddraw %p, guid %s, target %p, version %u, device %p, outer_unknown %p.\n",
6989
6990 if (IsEqualGUID(guid, &IID_IDirect3DRGBDevice))
6991 hw = FALSE;
6992
6993 if (!(target->surface_desc.ddsCaps.dwCaps & DDSCAPS_3DDEVICE)
6994 || (target->surface_desc.ddsCaps.dwCaps & DDSCAPS_ZBUFFER))
6995 {
6996 WARN("Surface %p is not a render target.\n", target);
6997 return DDERR_INVALIDCAPS;
6998 }
6999
7001 {
7002 WARN("Surface %p has an indexed pixel format, but no palette.\n", target);
7004 }
7005
7006 if (hw && !(target->surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY))
7007 {
7008 WARN("Surface %p is not in video memory.\n", target);
7010 }
7011
7012 if (ddraw->flags & DDRAW_NO3D)
7013 {
7014 ERR_(winediag)("The application wants to create a Direct3D device, "
7015 "but the current DirectDrawRenderer does not support this.\n");
7016
7017 return DDERR_NO3D;
7018 }
7019
7020 if (ddraw->d3ddevice)
7021 {
7022 FIXME("Only one Direct3D device per DirectDraw object supported.\n");
7023 return DDERR_INVALIDPARAMS;
7024 }
7025
7026 if (!(object = heap_alloc_zero(sizeof(*object))))
7027 {
7028 ERR("Failed to allocate device memory.\n");
7029 return DDERR_OUTOFMEMORY;
7030 }
7031
7033 {
7034 WARN("Failed to initialize device, hr %#x.\n", hr);
7035 heap_free(object);
7036 return hr;
7037 }
7038
7039 TRACE("Created device %p.\n", object);
7040 *device = object;
7041
7042 return D3D_OK;
7043}
#define D3DERR_SURFACENOTINVIDMEM
Definition: d3d.h:147
#define DDRAW_NO3D
Definition: ddraw_private.h:57
static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw, BOOL hw, struct ddraw_surface *target, IUnknown *rt_iface, UINT version, IUnknown *outer_unknown)
Definition: device.c:6906
static const WCHAR version[]
Definition: asmname.c:66
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define DDERR_NOPALETTEATTACHED
Definition: ddraw.h:146
#define DDERR_NO3D
Definition: ddraw.h:83
#define ERR_(ch,...)
Definition: debug.h:156
IUnknown * outer_unknown
IUnknown * rt_iface
DWORD flags
Definition: ddraw_private.h:94
struct d3d_device * d3ddevice

Referenced by d3d2_CreateDevice(), d3d3_CreateDevice(), d3d7_CreateDevice(), and ddraw_surface7_QueryInterface().

◆ d3d_device_init()

static HRESULT d3d_device_init ( struct d3d_device device,
struct ddraw ddraw,
BOOL  hw,
struct ddraw_surface target,
IUnknown rt_iface,
UINT  version,
IUnknown outer_unknown 
)
static

Definition at line 6906 of file device.c.

6908{
6909 static const D3DMATRIX ident =
6910 {
6911 1.0f, 0.0f, 0.0f, 0.0f,
6912 0.0f, 1.0f, 0.0f, 0.0f,
6913 0.0f, 0.0f, 1.0f, 0.0f,
6914 0.0f, 0.0f, 0.0f, 1.0f,
6915 };
6916 HRESULT hr;
6917
6919 device->IDirect3DDevice7_iface.lpVtbl = &d3d_device7_fpu_preserve_vtbl;
6920 else
6921 device->IDirect3DDevice7_iface.lpVtbl = &d3d_device7_fpu_setup_vtbl;
6922
6923 device->IDirect3DDevice3_iface.lpVtbl = &d3d_device3_vtbl;
6924 device->IDirect3DDevice2_iface.lpVtbl = &d3d_device2_vtbl;
6925 device->IDirect3DDevice_iface.lpVtbl = &d3d_device1_vtbl;
6926 device->IUnknown_inner.lpVtbl = &d3d_device_inner_vtbl;
6927 device->ref = 1;
6928 device->version = version;
6929 device->hw = hw;
6930
6931 if (outer_unknown)
6932 device->outer_unknown = outer_unknown;
6933 else
6934 device->outer_unknown = &device->IUnknown_inner;
6935
6936 device->ddraw = ddraw;
6937 list_init(&device->viewport_list);
6938
6939 if (!ddraw_handle_table_init(&device->handle_table, 64))
6940 {
6941 ERR("Failed to initialize handle table.\n");
6942 return DDERR_OUTOFMEMORY;
6943 }
6944
6945 device->legacyTextureBlending = FALSE;
6946 device->legacy_projection = ident;
6947 device->legacy_clipspace = ident;
6948
6949 /* This is for convenience. */
6950 device->wined3d_device = ddraw->wined3d_device;
6952
6953 /* Render to the back buffer */
6956 {
6957 ERR("Failed to set render target, hr %#x.\n", hr);
6958 ddraw_handle_table_destroy(&device->handle_table);
6959 return hr;
6960 }
6961
6962 device->rt_iface = rt_iface;
6963 if (version != 1)
6964 IUnknown_AddRef(device->rt_iface);
6965
6967
6970 if (version == 1) /* Color keying is initially enabled for version 1 devices. */
6972 else if (version == 2)
6974 if (version < 7)
6976
6977 return D3D_OK;
6978}
static void list_init(struct list_entry *head)
Definition: list.h:51
struct wined3d_rendertarget_view * ddraw_surface_get_rendertarget_view(struct ddraw_surface *surface) DECLSPEC_HIDDEN
Definition: surface.c:6520
void ddraw_handle_table_destroy(struct ddraw_handle_table *t) DECLSPEC_HIDDEN
Definition: main.c:107
BOOL ddraw_handle_table_init(struct ddraw_handle_table *t, UINT initial_size) DECLSPEC_HIDDEN
Definition: main.c:93
static const struct IDirect3DDevice7Vtbl d3d_device7_fpu_preserve_vtbl
Definition: device.c:6673
static const struct IDirect3DDeviceVtbl d3d_device1_vtbl
Definition: device.c:6815
static const struct IDirect3DDevice2Vtbl d3d_device2_vtbl
Definition: device.c:6776
enum wined3d_depth_buffer_type d3d_device_update_depth_stencil(struct d3d_device *device)
Definition: device.c:6878
static const struct IUnknownVtbl d3d_device_inner_vtbl
Definition: device.c:6843
static const struct IDirect3DDevice7Vtbl d3d_device7_fpu_setup_vtbl
Definition: device.c:6618
static const struct IDirect3DDevice3Vtbl d3d_device3_vtbl
Definition: device.c:6728
HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device, unsigned int view_idx, struct wined3d_rendertarget_view *view, BOOL set_viewport)
Definition: device.c:4468
ULONG CDECL wined3d_device_incref(struct wined3d_device *device)
Definition: device.c:456
#define DDSCL_FPUPRESERVE
Definition: ddraw.h:543
struct wined3d_device * wined3d_device
Definition: ddraw_private.h:93
DWORD cooperative_level
_In_ ULONG _In_ ULONG_PTR ident
Definition: winddi.h:3994
@ WINED3D_RS_COLORKEYENABLE
Definition: wined3d.h:300
@ WINED3D_RS_ZENABLE
Definition: wined3d.h:269
@ WINED3D_RS_NORMALIZENORMALS
Definition: wined3d.h:330
@ WINED3D_RS_SPECULARENABLE
Definition: wined3d.h:288

Referenced by d3d_device_create().

◆ d3d_device_inner_AddRef()

static ULONG WINAPI d3d_device_inner_AddRef ( IUnknown iface)
static

Definition at line 177 of file device.c.

178{
179 struct d3d_device *device = impl_from_IUnknown(iface);
181
182 TRACE("%p increasing refcount to %u.\n", device, ref);
183
184 return ref;
185}
#define InterlockedIncrement
Definition: armddk.h:53
static struct d3d_device * impl_from_IUnknown(IUnknown *iface)
Definition: device.c:78

◆ d3d_device_inner_QueryInterface()

static HRESULT WINAPI d3d_device_inner_QueryInterface ( IUnknown iface,
REFIID  riid,
void **  out 
)
static

Definition at line 83 of file device.c.

84{
85 struct d3d_device *device = impl_from_IUnknown(iface);
86
87 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
88
89 if (!riid)
90 {
91 *out = NULL;
93 }
94
96 {
97 IDirect3DDevice7_AddRef(&device->IDirect3DDevice7_iface);
98 *out = &device->IDirect3DDevice7_iface;
99 return S_OK;
100 }
101
102 if (device->version == 7)
103 {
104 if (IsEqualGUID(&IID_IDirect3DDevice7, riid))
105 {
106 IDirect3DDevice7_AddRef(&device->IDirect3DDevice7_iface);
107 *out = &device->IDirect3DDevice7_iface;
108 return S_OK;
109 }
110 }
111 else
112 {
113 if (IsEqualGUID(&IID_IDirect3DDevice3, riid) && device->version == 3)
114 {
115 IDirect3DDevice3_AddRef(&device->IDirect3DDevice3_iface);
116 *out = &device->IDirect3DDevice3_iface;
117 return S_OK;
118 }
119
120 if (IsEqualGUID(&IID_IDirect3DDevice2, riid) && device->version >= 2)
121 {
122 IDirect3DDevice2_AddRef(&device->IDirect3DDevice2_iface);
123 *out = &device->IDirect3DDevice2_iface;
124 return S_OK;
125 }
126
127 if (IsEqualGUID(&IID_IDirect3DDevice, riid))
128 {
129 IDirect3DDevice_AddRef(&device->IDirect3DDevice_iface);
130 *out = &device->IDirect3DDevice_iface;
131 return S_OK;
132 }
133 }
134
135 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
136
137 *out = NULL;
138 return E_NOINTERFACE;
139}
const GUID IID_IUnknown
#define IDirect3DDevice2_AddRef(p)
Definition: d3d.h:1063
#define IDirect3DDevice_AddRef(p)
Definition: d3d.h:965
#define IDirect3DDevice3_AddRef(p)
Definition: d3d.h:1191
#define IDirect3DDevice7_AddRef(p)
Definition: d3d.h:1343
#define S_OK
Definition: intsafe.h:52
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ d3d_device_inner_Release()

static ULONG WINAPI d3d_device_inner_Release ( IUnknown iface)
static

Definition at line 223 of file device.c.

224{
225 struct d3d_device *This = impl_from_IUnknown(iface);
228
229 TRACE("%p decreasing refcount to %u.\n", This, ref);
230
231 /* This method doesn't destroy the wined3d device, because it's still in
232 * use for 2D rendering. IDirectDrawSurface7::Release will destroy the
233 * wined3d device when the render target is released. */
234 if (!ref)
235 {
236 DWORD i;
237 struct list *vp_entry, *vp_entry2;
238
240
241 /* There is no need to unset any resources here, wined3d will take
242 * care of that on uninit_3d(). */
243
244 if (This->index_buffer)
245 wined3d_buffer_decref(This->index_buffer);
246 if (This->vertex_buffer)
247 wined3d_buffer_decref(This->vertex_buffer);
248
250
251 /* Release the wined3d device. This won't destroy it. */
252 if (!wined3d_device_decref(This->wined3d_device))
253 ERR("The wined3d device (%p) was destroyed unexpectedly.\n", This->wined3d_device);
254
255 /* The texture handles should be unset by now, but there might be some bits
256 * missing in our reference counting(needs test). Do a sanity check. */
257 for (i = 0; i < This->handle_table.entry_count; ++i)
258 {
259 struct ddraw_handle_entry *entry = &This->handle_table.entries[i];
260
261 switch (entry->type)
262 {
264 break;
265
267 {
268 struct d3d_material *m = entry->object;
269 FIXME("Material handle %#x (%p) not unset properly.\n", i + 1, m);
270 m->Handle = 0;
271 break;
272 }
273
275 {
276 /* No FIXME here because this might happen because of sloppy applications. */
277 WARN("Leftover matrix handle %#x (%p), deleting.\n", i + 1, entry->object);
278 IDirect3DDevice_DeleteMatrix(&This->IDirect3DDevice_iface, i + 1);
279 break;
280 }
281
283 {
284 /* No FIXME here because this might happen because of sloppy applications. */
285 WARN("Leftover stateblock handle %#x (%p), deleting.\n", i + 1, entry->object);
286 IDirect3DDevice7_DeleteStateBlock(&This->IDirect3DDevice7_iface, i + 1);
287 break;
288 }
289
291 {
292 struct ddraw_surface *surf = entry->object;
293 FIXME("Texture handle %#x (%p) not unset properly.\n", i + 1, surf);
294 surf->Handle = 0;
295 break;
296 }
297
298 default:
299 FIXME("Handle %#x (%p) has unknown type %#x.\n", i + 1, entry->object, entry->type);
300 break;
301 }
302 }
303
304 ddraw_handle_table_destroy(&This->handle_table);
305
306 LIST_FOR_EACH_SAFE(vp_entry, vp_entry2, &This->viewport_list)
307 {
308 struct d3d_viewport *vp = LIST_ENTRY(vp_entry, struct d3d_viewport, entry);
309 IDirect3DDevice3_DeleteViewport(&This->IDirect3DDevice3_iface, &vp->IDirect3DViewport3_iface);
310 }
311
312 TRACE("Releasing render target %p.\n", This->rt_iface);
313 rt_iface = This->rt_iface;
314 This->rt_iface = NULL;
315 if (This->version != 1)
316 IUnknown_Release(rt_iface);
317 TRACE("Render target release done.\n");
318
319 /* Releasing the render target above may have released the last
320 * reference to the ddraw object. */
321 if (This->ddraw)
322 This->ddraw->d3ddevice = NULL;
323
324 /* Now free the structure */
327 }
328
329 TRACE("Done\n");
330 return ref;
331}
#define InterlockedDecrement
Definition: armddk.h:52
#define IDirect3DDevice3_DeleteViewport(p, a)
Definition: d3d.h:1197
#define IDirect3DDevice7_DeleteStateBlock(p, a)
Definition: d3d.h:1384
#define IDirect3DDevice_DeleteMatrix(p, a)
Definition: d3d.h:983
@ DDRAW_HANDLE_FREE
ULONG CDECL wined3d_buffer_decref(struct wined3d_buffer *buffer)
Definition: buffer.c:791
ULONG CDECL wined3d_device_decref(struct wined3d_device *device)
Definition: device.c:472
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
Definition: list.h:192

◆ d3d_device_prepare_index_buffer()

static HRESULT d3d_device_prepare_index_buffer ( struct d3d_device device,
UINT  min_size 
)
static

Definition at line 3651 of file device.c.

3652{
3653 HRESULT hr;
3654
3655 if (device->index_buffer_size < min_size || !device->index_buffer)
3656 {
3657 UINT size = max(device->index_buffer_size * 2, min_size);
3659 struct wined3d_buffer *buffer;
3660
3661 TRACE("Growing index buffer to %u bytes\n", size);
3662
3663 desc.byte_width = size;
3665 desc.bind_flags = WINED3D_BIND_INDEX_BUFFER;
3667 desc.misc_flags = 0;
3668 desc.structure_byte_stride = 0;
3669
3670 if (FAILED(hr = wined3d_buffer_create(device->wined3d_device, &desc,
3672 {
3673 ERR("Failed to create index buffer, hr %#x.\n", hr);
3674 return hr;
3675 }
3676
3677 if (device->index_buffer)
3678 wined3d_buffer_decref(device->index_buffer);
3679 device->index_buffer = buffer;
3680 device->index_buffer_size = size;
3681 device->index_buffer_pos = 0;
3682 }
3683 return D3D_OK;
3684}
const struct wined3d_parent_ops ddraw_null_wined3d_parent_ops
Definition: ddraw.c:83
HRESULT CDECL wined3d_buffer_create(struct wined3d_device *device, const struct wined3d_buffer_desc *desc, const struct wined3d_sub_resource_data *data, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_buffer **buffer)
Definition: buffer.c:1436
#define max(a, b)
Definition: svc.c:63
#define WINED3DUSAGE_WRITEONLY
Definition: wined3d.h:901
#define WINED3D_RESOURCE_ACCESS_GPU
Definition: wined3d.h:55
#define WINED3D_RESOURCE_ACCESS_MAP_R
Definition: wined3d.h:57
#define WINED3DUSAGE_DYNAMIC
Definition: wined3d.h:907
#define WINED3DUSAGE_STATICDECL
Definition: wined3d.h:920
#define WINED3D_BIND_INDEX_BUFFER
Definition: wined3d.h:891
#define WINED3D_RESOURCE_ACCESS_MAP_W
Definition: wined3d.h:58

Referenced by d3d_device7_DrawIndexedPrimitive(), d3d_device7_DrawIndexedPrimitiveStrided(), and d3d_device7_DrawIndexedPrimitiveVB().

◆ d3d_device_prepare_vertex_buffer()

static HRESULT d3d_device_prepare_vertex_buffer ( struct d3d_device device,
UINT  min_size 
)
static

Definition at line 3459 of file device.c.

3460{
3461 HRESULT hr;
3462
3463 if (device->vertex_buffer_size < min_size || !device->vertex_buffer)
3464 {
3465 UINT size = max(device->vertex_buffer_size * 2, min_size);
3467 struct wined3d_buffer *buffer;
3468
3469 TRACE("Growing vertex buffer to %u bytes\n", size);
3470
3471 desc.byte_width = size;
3473 desc.bind_flags = WINED3D_BIND_VERTEX_BUFFER;
3475 desc.misc_flags = 0;
3476 desc.structure_byte_stride = 0;
3477
3478 if (FAILED(hr = wined3d_buffer_create(device->wined3d_device, &desc,
3480 {
3481 ERR("Failed to create vertex buffer, hr %#x.\n", hr);
3482 return hr;
3483 }
3484
3485 if (device->vertex_buffer)
3486 wined3d_buffer_decref(device->vertex_buffer);
3487
3488 device->vertex_buffer = buffer;
3489 device->vertex_buffer_size = size;
3490 device->vertex_buffer_pos = 0;
3491 }
3492 return D3D_OK;
3493}
#define WINED3D_BIND_VERTEX_BUFFER
Definition: wined3d.h:890

Referenced by d3d_device7_DrawIndexedPrimitive(), d3d_device7_DrawIndexedPrimitiveStrided(), d3d_device7_DrawPrimitive(), and d3d_device7_DrawPrimitiveStrided().

◆ d3d_device_set_render_target()

static HRESULT d3d_device_set_render_target ( struct d3d_device device,
struct ddraw_surface target,
IUnknown rt_iface 
)
static

Definition at line 1804 of file device.c.

1806{
1807 HRESULT hr;
1808
1809 if (device->rt_iface == rt_iface)
1810 {
1811 TRACE("No-op SetRenderTarget operation, not doing anything\n");
1812 return D3D_OK;
1813 }
1814 if (!target)
1815 {
1816 WARN("Trying to set render target to NULL.\n");
1817 return DDERR_INVALIDPARAMS;
1818 }
1819
1822 return hr;
1823
1824 IUnknown_AddRef(rt_iface);
1825 IUnknown_Release(device->rt_iface);
1826 device->rt_iface = rt_iface;
1828
1829 return D3D_OK;
1830}

Referenced by d3d_device2_SetRenderTarget(), d3d_device3_SetRenderTarget(), and d3d_device7_SetRenderTarget().

◆ d3d_device_update_depth_stencil()

enum wined3d_depth_buffer_type d3d_device_update_depth_stencil ( struct d3d_device device)

Definition at line 6878 of file device.c.

6879{
6880 IDirectDrawSurface7 *depthStencil = NULL;
6881 IDirectDrawSurface7 *render_target;
6882 static DDSCAPS2 depthcaps = { DDSCAPS_ZBUFFER, 0, 0, {0} };
6883 struct ddraw_surface *dsi;
6884
6885 if (device->rt_iface && SUCCEEDED(IUnknown_QueryInterface(device->rt_iface,
6886 &IID_IDirectDrawSurface7, (void **)&render_target)))
6887 {
6888 IDirectDrawSurface7_GetAttachedSurface(render_target, &depthcaps, &depthStencil);
6889 IDirectDrawSurface7_Release(render_target);
6890 }
6891 if (!depthStencil)
6892 {
6893 TRACE("Setting wined3d depth stencil to NULL\n");
6895 return WINED3D_ZB_FALSE;
6896 }
6897
6898 dsi = impl_from_IDirectDrawSurface7(depthStencil);
6901
6902 IDirectDrawSurface7_Release(depthStencil);
6903 return WINED3D_ZB_TRUE;
6904}
void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view)
Definition: device.c:4524
@ WINED3D_ZB_TRUE
Definition: wined3d.h:465
@ WINED3D_ZB_FALSE
Definition: wined3d.h:464

Referenced by d3d_device_init(), d3d_device_set_render_target(), and ddraw_surface_attach_surface().

◆ d3d_fpu_setup()

static WORD d3d_fpu_setup ( void  )
inlinestatic

Definition at line 55 of file device.c.

56{
57 WORD oldcw;
58
59#if defined(__i386__) && defined(__GNUC__)
60 __asm__ volatile ("fnstcw %0" : "=m" (oldcw));
61#elif defined(__i386__) && defined(_MSC_VER)
62 __asm fnstcw oldcw;
63#else
64 static BOOL warned = FALSE;
65 if(!warned)
66 {
67 FIXME("FPUPRESERVE not implemented for this platform / compiler\n");
68 warned = TRUE;
69 }
70 return 0;
71#endif
72
74
75 return oldcw;
76}
__asm__(".p2align 4, 0x90\n" ".seh_proc __seh2_global_filter_func\n" "__seh2_global_filter_func:\n" "\tsub %rbp, %rax\n" "\tpush %rbp\n" "\t.seh_pushreg %rbp\n" "\tsub $32, %rsp\n" "\t.seh_stackalloc 32\n" "\t.seh_endprologue\n" "\tsub %rax, %rdx\n" "\tmov %rdx, %rbp\n" "\tjmp *%r8\n" "__seh2_global_filter_func_exit:\n" "\t.p2align 4\n" "\tadd $32, %rsp\n" "\tpop %rbp\n" "\tret\n" "\t.seh_endproc")

Referenced by d3d_device7_ApplyStateBlock_FPUPreserve(), d3d_device7_BeginScene_FPUPreserve(), d3d_device7_BeginStateBlock_FPUPreserve(), d3d_device7_CaptureStateBlock_FPUPreserve(), d3d_device7_Clear_FPUPreserve(), d3d_device7_CreateStateBlock_FPUPreserve(), d3d_device7_DeleteStateBlock_FPUPreserve(), d3d_device7_DrawIndexedPrimitive_FPUPreserve(), d3d_device7_DrawIndexedPrimitiveStrided_FPUPreserve(), d3d_device7_DrawIndexedPrimitiveVB_FPUPreserve(), d3d_device7_DrawPrimitive_FPUPreserve(), d3d_device7_DrawPrimitiveStrided_FPUPreserve(), d3d_device7_DrawPrimitiveVB_FPUPreserve(), d3d_device7_EndScene_FPUPreserve(), d3d_device7_EndStateBlock_FPUPreserve(), d3d_device7_EnumTextureFormats_FPUPreserve(), d3d_device7_GetCaps_FPUPreserve(), d3d_device7_GetClipPlane_FPUPreserve(), d3d_device7_GetLight_FPUPreserve(), d3d_device7_GetLightEnable_FPUPreserve(), d3d_device7_GetMaterial_FPUPreserve(), d3d_device7_GetRenderState_FPUPreserve(), d3d_device7_GetTexture_FPUPreserve(), d3d_device7_GetTextureStageState_FPUPreserve(), d3d_device7_GetTransform_FPUPreserve(), d3d_device7_GetViewport_FPUPreserve(), d3d_device7_LightEnable_FPUPreserve(), d3d_device7_Load_FPUPreserve(), d3d_device7_MultiplyTransform_FPUPreserve(), d3d_device7_PreLoad_FPUPreserve(), d3d_device7_SetClipPlane_FPUPreserve(), d3d_device7_SetLight_FPUPreserve(), d3d_device7_SetMaterial_FPUPreserve(), d3d_device7_SetRenderState_FPUPreserve(), d3d_device7_SetRenderTarget_FPUPreserve(), d3d_device7_SetTexture_FPUPreserve(), d3d_device7_SetTextureStageState_FPUPreserve(), d3d_device7_SetTransform_FPUPreserve(), d3d_device7_SetViewport_FPUPreserve(), and d3d_device7_ValidateDevice_FPUPreserve().

◆ impl_from_IUnknown()

static struct d3d_device * impl_from_IUnknown ( IUnknown iface)
inlinestatic

Definition at line 78 of file device.c.

79{
80 return CONTAINING_RECORD(iface, struct d3d_device, IUnknown_inner);
81}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by d3d_device_inner_AddRef(), d3d_device_inner_QueryInterface(), and d3d_device_inner_Release().

◆ in_plane()

static DWORD in_plane ( UINT  idx,
struct wined3d_vec4  p,
D3DVECTOR  center,
D3DVALUE  radius,
BOOL  equality 
)
static

Definition at line 4509 of file device.c.

4510{
4511 float distance, norm;
4512
4513 norm = sqrtf(p.x * p.x + p.y * p.y + p.z * p.z);
4514 distance = (p.x * center.u1.x + p.y * center.u2.y + p.z * center.u3.z + p.w) / norm;
4515
4516 if (equality)
4517 {
4518 if (fabs(distance) <= radius)
4519 return D3DSTATUS_CLIPUNIONLEFT << idx;
4520 if (distance <= -radius)
4522 }
4523 else
4524 {
4525 if (fabs(distance) < radius)
4526 return D3DSTATUS_CLIPUNIONLEFT << idx;
4527 if (distance < -radius)
4529 }
4530 return 0;
4531}
_Tp _STLP_CALL norm(const complex< _Tp > &__z)
Definition: _complex.h:741
GLsizei GLsizei GLfloat distance
Definition: glext.h:11755
GLfloat GLfloat p
Definition: glext.h:8902
_Check_return_ _CRT_JIT_INTRINSIC double __cdecl fabs(_In_ double x)
Definition: fabs.c:17
#define sqrtf(x)
Definition: mymath.h:59

Referenced by compute_sphere_visibility().

◆ is_mip_level_subset()

static BOOL is_mip_level_subset ( struct ddraw_surface dest,
struct ddraw_surface src 
)
static

Definition at line 6011 of file device.c.

6012{
6013 struct ddraw_surface *src_level, *dest_level;
6015 DDSURFACEDESC2 ddsd;
6016 BOOL levelFound; /* at least one suitable sublevel in dest found */
6017
6018 /* To satisfy "destination is mip level subset of source" criteria (regular texture counts as 1 level),
6019 * 1) there must be at least one mip level in destination that matched dimensions of some mip level in source and
6020 * 2) there must be no destination levels that don't match any levels in source. Otherwise it's INVALIDPARAMS.
6021 */
6022 levelFound = FALSE;
6023
6024 src_level = src;
6025 dest_level = dest;
6026
6027 for (;src_level && dest_level;)
6028 {
6029 if (src_level->surface_desc.dwWidth == dest_level->surface_desc.dwWidth &&
6030 src_level->surface_desc.dwHeight == dest_level->surface_desc.dwHeight)
6031 {
6032 levelFound = TRUE;
6033
6036 IDirectDrawSurface7_GetAttachedSurface(&dest_level->IDirectDrawSurface7_iface, &ddsd.ddsCaps, &temp);
6037
6038 if (dest_level != dest) IDirectDrawSurface7_Release(&dest_level->IDirectDrawSurface7_iface);
6039
6041 }
6042
6045 IDirectDrawSurface7_GetAttachedSurface(&src_level->IDirectDrawSurface7_iface, &ddsd.ddsCaps, &temp);
6046
6047 if (src_level != src) IDirectDrawSurface7_Release(&src_level->IDirectDrawSurface7_iface);
6048
6050 }
6051
6052 if (src_level && src_level != src) IDirectDrawSurface7_Release(&src_level->IDirectDrawSurface7_iface);
6053 if (dest_level && dest_level != dest) IDirectDrawSurface7_Release(&dest_level->IDirectDrawSurface7_iface);
6054
6055 return !dest_level && levelFound;
6056}

Referenced by d3d_device7_Load().

◆ pack_strided_data()

static void pack_strided_data ( BYTE dst,
DWORD  count,
const D3DDRAWPRIMITIVESTRIDEDDATA src,
DWORD  fvf 
)
static

Definition at line 3965 of file device.c.

3966{
3967 DWORD i, tex, offset;
3968
3969 for (i = 0; i < count; i++)
3970 {
3971 /* The contents of the strided data are determined by the fvf,
3972 * not by the members set in src. So it's valid
3973 * to have diffuse.lpvData set to 0xdeadbeef if the diffuse flag is
3974 * not set in the fvf. */
3975 if (fvf & D3DFVF_POSITION_MASK)
3976 {
3977 offset = i * src->position.dwStride;
3978 if (fvf & D3DFVF_XYZRHW)
3979 {
3980 memcpy(dst, ((BYTE *)src->position.lpvData) + offset, 4 * sizeof(float));
3981 dst += 4 * sizeof(float);
3982 }
3983 else
3984 {
3985 memcpy(dst, ((BYTE *)src->position.lpvData) + offset, 3 * sizeof(float));
3986 dst += 3 * sizeof(float);
3987 }
3988 }
3989
3990 if (fvf & D3DFVF_NORMAL)
3991 {
3992 offset = i * src->normal.dwStride;
3993 memcpy(dst, ((BYTE *)src->normal.lpvData) + offset, 3 * sizeof(float));
3994 dst += 3 * sizeof(float);
3995 }
3996
3997 if (fvf & D3DFVF_DIFFUSE)
3998 {
3999 offset = i * src->diffuse.dwStride;
4000 memcpy(dst, ((BYTE *)src->diffuse.lpvData) + offset, sizeof(DWORD));
4001 dst += sizeof(DWORD);
4002 }
4003
4004 if (fvf & D3DFVF_SPECULAR)
4005 {
4006 offset = i * src->specular.dwStride;
4007 memcpy(dst, ((BYTE *)src->specular.lpvData) + offset, sizeof(DWORD));
4008 dst += sizeof(DWORD);
4009 }
4010
4011 for (tex = 0; tex < GET_TEXCOUNT_FROM_FVF(fvf); ++tex)
4012 {
4013 DWORD attrib_count = GET_TEXCOORD_SIZE_FROM_FVF(fvf, tex);
4014 offset = i * src->textureCoords[tex].dwStride;
4015 memcpy(dst, ((BYTE *)src->textureCoords[tex].lpvData) + offset, attrib_count * sizeof(float));
4016 dst += attrib_count * sizeof(float);
4017 }
4018 }
4019}
#define D3DFVF_DIFFUSE
Definition: d3d8types.h:122
#define D3DFVF_XYZRHW
Definition: d3d8types.h:114
#define D3DFVF_NORMAL
Definition: d3d8types.h:120
#define D3DFVF_SPECULAR
Definition: d3d8types.h:123
#define D3DFVF_POSITION_MASK
Definition: d3d8types.h:112
#define GET_TEXCOORD_SIZE_FROM_FVF(d3dvtVertexType, tex_num)
#define GET_TEXCOUNT_FROM_FVF(d3dvtVertexType)
GLintptr offset
Definition: glext.h:5920
static float(__cdecl *square_half_float)(float x
#define DWORD
Definition: nt_native.h:44

Referenced by d3d_device7_DrawIndexedPrimitiveStrided(), and d3d_device7_DrawPrimitiveStrided().

◆ prepare_clip_space_planes()

static void prepare_clip_space_planes ( struct d3d_device device,
struct wined3d_vec4 plane 
)
static

Definition at line 4533 of file device.c.

4534{
4535 D3DMATRIX m, temp;
4536
4537 /* We want the wined3d matrices since those include the legacy viewport
4538 * transformation. */
4540 wined3d_device_get_transform(device->wined3d_device,
4541 WINED3D_TS_WORLD, (struct wined3d_matrix *)&m);
4542
4543 wined3d_device_get_transform(device->wined3d_device,
4544 WINED3D_TS_VIEW, (struct wined3d_matrix *)&temp);
4545 multiply_matrix(&m, &temp, &m);
4546
4547 wined3d_device_get_transform(device->wined3d_device,
4549 multiply_matrix(&m, &temp, &m);
4551
4552 /* Left plane. */
4553 plane[0].x = m._14 + m._11;
4554 plane[0].y = m._24 + m._21;
4555 plane[0].z = m._34 + m._31;
4556 plane[0].w = m._44 + m._41;
4557
4558 /* Right plane. */
4559 plane[1].x = m._14 - m._11;
4560 plane[1].y = m._24 - m._21;
4561 plane[1].z = m._34 - m._31;
4562 plane[1].w = m._44 - m._41;
4563
4564 /* Top plane. */
4565 plane[2].x = m._14 - m._12;
4566 plane[2].y = m._24 - m._22;
4567 plane[2].z = m._34 - m._32;
4568 plane[2].w = m._44 - m._42;
4569
4570 /* Bottom plane. */
4571 plane[3].x = m._14 + m._12;
4572 plane[3].y = m._24 + m._22;
4573 plane[3].z = m._34 + m._32;
4574 plane[3].w = m._44 + m._42;
4575
4576 /* Front plane. */
4577 plane[4].x = m._13;
4578 plane[4].y = m._23;
4579 plane[4].z = m._33;
4580 plane[4].w = m._43;
4581
4582 /* Back plane. */
4583 plane[5].x = m._14 - m._13;
4584 plane[5].y = m._24 - m._23;
4585 plane[5].z = m._34 - m._33;
4586 plane[5].w = m._44 - m._43;
4587}
@ WINED3D_TS_WORLD
Definition: wined3d.h:658

Referenced by d3d_device3_ComputeSphereVisibility(), and d3d_device7_ComputeSphereVisibility().

◆ set_fpu_control_word()

static void set_fpu_control_word ( WORD  fpucw)
inlinestatic

Definition at line 46 of file device.c.

47{
48#if defined(__i386__) && defined(__GNUC__)
49 __asm__ volatile ("fldcw %0" : : "m" (fpucw));
50#elif defined(__i386__) && defined(_MSC_VER)
51 __asm fldcw fpucw;
52#endif
53}

Referenced by d3d_device7_ApplyStateBlock_FPUPreserve(), d3d_device7_BeginScene_FPUPreserve(), d3d_device7_BeginStateBlock_FPUPreserve(), d3d_device7_CaptureStateBlock_FPUPreserve(), d3d_device7_Clear_FPUPreserve(), d3d_device7_CreateStateBlock_FPUPreserve(), d3d_device7_DeleteStateBlock_FPUPreserve(), d3d_device7_DrawIndexedPrimitive_FPUPreserve(), d3d_device7_DrawIndexedPrimitiveStrided_FPUPreserve(), d3d_device7_DrawIndexedPrimitiveVB_FPUPreserve(), d3d_device7_DrawPrimitive_FPUPreserve(), d3d_device7_DrawPrimitiveStrided_FPUPreserve(), d3d_device7_DrawPrimitiveVB_FPUPreserve(), d3d_device7_EndScene_FPUPreserve(), d3d_device7_EndStateBlock_FPUPreserve(), d3d_device7_EnumTextureFormats_FPUPreserve(), d3d_device7_GetCaps_FPUPreserve(), d3d_device7_GetClipPlane_FPUPreserve(), d3d_device7_GetLight_FPUPreserve(), d3d_device7_GetLightEnable_FPUPreserve(), d3d_device7_GetMaterial_FPUPreserve(), d3d_device7_GetRenderState_FPUPreserve(), d3d_device7_GetTexture_FPUPreserve(), d3d_device7_GetTextureStageState_FPUPreserve(), d3d_device7_GetTransform_FPUPreserve(), d3d_device7_GetViewport_FPUPreserve(), d3d_device7_LightEnable_FPUPreserve(), d3d_device7_Load_FPUPreserve(), d3d_device7_MultiplyTransform_FPUPreserve(), d3d_device7_PreLoad_FPUPreserve(), d3d_device7_SetClipPlane_FPUPreserve(), d3d_device7_SetLight_FPUPreserve(), d3d_device7_SetMaterial_FPUPreserve(), d3d_device7_SetRenderState_FPUPreserve(), d3d_device7_SetRenderTarget_FPUPreserve(), d3d_device7_SetTexture_FPUPreserve(), d3d_device7_SetTextureStageState_FPUPreserve(), d3d_device7_SetTransform_FPUPreserve(), d3d_device7_SetViewport_FPUPreserve(), d3d_device7_ValidateDevice_FPUPreserve(), and d3d_fpu_setup().

◆ setup_lighting()

static void setup_lighting ( const struct d3d_device device,
DWORD  fvf,
DWORD  flags 
)
static

Definition at line 3576 of file device.c.

3577{
3578 BOOL enable = TRUE;
3579
3580 /* Ignore the D3DFVF_XYZRHW case here, wined3d takes care of that */
3581 if (!device->material || !(fvf & D3DFVF_NORMAL) || (flags & D3DDP_DONOTLIGHT))
3582 enable = FALSE;
3583
3585}
#define D3DDP_DONOTLIGHT
Definition: d3d.h:200
GLboolean enable
Definition: glext.h:11120
@ WINED3D_RS_LIGHTING
Definition: wined3d.h:324

Referenced by d3d_device3_DrawIndexedPrimitive(), d3d_device3_DrawIndexedPrimitiveStrided(), d3d_device3_DrawIndexedPrimitiveVB(), d3d_device3_DrawPrimitive(), d3d_device3_DrawPrimitiveStrided(), and d3d_device3_DrawPrimitiveVB().

◆ unsafe_impl_from_IDirect3DDevice()

struct d3d_device * unsafe_impl_from_IDirect3DDevice ( IDirect3DDevice *  iface)

Definition at line 6871 of file device.c.

6872{
6873 if (!iface) return NULL;
6874 assert(iface->lpVtbl == &d3d_device1_vtbl);
6875 return CONTAINING_RECORD(iface, struct d3d_device, IDirect3DDevice_iface);
6876}
#define assert(x)
Definition: debug.h:53

Referenced by d3d_material1_GetHandle(), and d3d_texture1_GetHandle().

◆ unsafe_impl_from_IDirect3DDevice2()

struct d3d_device * unsafe_impl_from_IDirect3DDevice2 ( IDirect3DDevice2 *  iface)

Definition at line 6864 of file device.c.

6865{
6866 if (!iface) return NULL;
6867 assert(iface->lpVtbl == &d3d_device2_vtbl);
6868 return CONTAINING_RECORD(iface, struct d3d_device, IDirect3DDevice2_iface);
6869}

Referenced by d3d_material2_GetHandle(), and d3d_texture2_GetHandle().

◆ unsafe_impl_from_IDirect3DDevice3()

struct d3d_device * unsafe_impl_from_IDirect3DDevice3 ( IDirect3DDevice3 *  iface)

Definition at line 6857 of file device.c.

6858{
6859 if (!iface) return NULL;
6860 assert(iface->lpVtbl == &d3d_device3_vtbl);
6861 return CONTAINING_RECORD(iface, struct d3d_device, IDirect3DDevice3_iface);
6862}

Referenced by d3d_material3_GetHandle(), and d3d_vertex_buffer7_ProcessVertices().

◆ unsafe_impl_from_IDirect3DDevice7()

struct d3d_device * unsafe_impl_from_IDirect3DDevice7 ( IDirect3DDevice7 *  iface)

Definition at line 6850 of file device.c.

6851{
6852 if (!iface) return NULL;
6853 assert((iface->lpVtbl == &d3d_device7_fpu_preserve_vtbl) || (iface->lpVtbl == &d3d_device7_fpu_setup_vtbl));
6854 return CONTAINING_RECORD(iface, struct d3d_device, IDirect3DDevice7_iface);
6855}

Referenced by d3d_vertex_buffer7_ProcessVertices().

◆ validate_surface_palette()

static BOOL validate_surface_palette ( struct ddraw_surface surface)
static

Definition at line 1798 of file device.c.

1799{
1801 || surface->palette;
1802}
static BOOL format_is_paletteindexed(const DDPIXELFORMAT *fmt)
DDPIXELFORMAT ddpfPixelFormat
Definition: ddraw.h:1185
struct ddraw_palette * palette

Referenced by d3d_device2_SetRenderTarget(), d3d_device3_SetRenderTarget(), d3d_device7_SetRenderTarget(), and d3d_device_create().

◆ WINE_DECLARE_DEBUG_CHANNEL()

WINE_DECLARE_DEBUG_CHANNEL ( winediag  )

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( ddraw  )

Variable Documentation

◆ d3d_device1_vtbl

const struct IDirect3DDeviceVtbl d3d_device1_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI d3d_device1_GetStats(IDirect3DDevice *iface, D3DSTATS *stats)
Definition: device.c:623
static HRESULT WINAPI d3d_device1_GetPickRecords(IDirect3DDevice *iface, DWORD *count, D3DPICKRECORD *records)
Definition: device.c:1010
static HRESULT WINAPI d3d_device1_CreateMatrix(IDirect3DDevice *iface, D3DMATRIXHANDLE *D3DMatHandle)
Definition: device.c:1273
static HRESULT WINAPI d3d_device1_CreateExecuteBuffer(IDirect3DDevice *iface, D3DEXECUTEBUFFERDESC *buffer_desc, IDirect3DExecuteBuffer **ExecuteBuffer, IUnknown *outer_unknown)
Definition: device.c:652
static HRESULT WINAPI d3d_device1_GetDirect3D(IDirect3DDevice *iface, IDirect3D **d3d)
Definition: device.c:1660
static HRESULT WINAPI d3d_device1_DeleteViewport(IDirect3DDevice *iface, IDirect3DViewport *viewport)
Definition: device.c:848
static HRESULT WINAPI d3d_device1_EnumTextureFormats(IDirect3DDevice *iface, LPD3DENUMTEXTUREFORMATSCALLBACK callback, void *context)
Definition: device.c:1247
static HRESULT WINAPI d3d_device1_NextViewport(IDirect3DDevice *iface, IDirect3DViewport *viewport, IDirect3DViewport **next, DWORD flags)
Definition: device.c:947
static HRESULT WINAPI d3d_device1_QueryInterface(IDirect3DDevice *iface, REFIID riid, void **out)
Definition: device.c:168
static HRESULT WINAPI d3d_device1_Execute(IDirect3DDevice *iface, IDirect3DExecuteBuffer *ExecuteBuffer, IDirect3DViewport *viewport, DWORD flags)
Definition: device.c:702
static ULONG WINAPI d3d_device1_Release(IDirect3DDevice *iface)
Definition: device.c:360
static HRESULT WINAPI d3d_device1_SwapTextureHandles(IDirect3DDevice *iface, IDirect3DTexture *tex1, IDirect3DTexture *tex2)
Definition: device.c:565
static HRESULT WINAPI d3d_device1_GetMatrix(IDirect3DDevice *iface, D3DMATRIXHANDLE D3DMatHandle, D3DMATRIX *D3DMatrix)
Definition: device.c:1386
static HRESULT WINAPI d3d_device1_Pick(IDirect3DDevice *iface, IDirect3DExecuteBuffer *buffer, IDirect3DViewport *viewport, DWORD flags, D3DRECT *rect)
Definition: device.c:985
static ULONG WINAPI d3d_device1_AddRef(IDirect3DDevice *iface)
Definition: device.c:214
static HRESULT WINAPI d3d_device1_AddViewport(IDirect3DDevice *iface, IDirect3DViewport *viewport)
Definition: device.c:772
static HRESULT WINAPI d3d_device1_GetCaps(IDirect3DDevice *iface, D3DDEVICEDESC *hw_desc, D3DDEVICEDESC *hel_desc)
Definition: device.c:519
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d_device1_EndScene(IDirect3DDevice *iface)
Definition: device.c:1589
static HRESULT WINAPI d3d_device1_SetMatrix(IDirect3DDevice *iface, D3DMATRIXHANDLE D3DMatHandle, D3DMATRIX *D3DMatrix)
Definition: device.c:1328
static HRESULT WINAPI d3d_device1_Initialize(IDirect3DDevice *iface, IDirect3D *d3d, GUID *guid, D3DDEVICEDESC *device_desc)
Definition: device.c:387
static HRESULT WINAPI d3d_device1_BeginScene(IDirect3DDevice *iface)
Definition: device.c:1516
static HRESULT WINAPI d3d_device1_DeleteMatrix(IDirect3DDevice *iface, D3DMATRIXHANDLE D3DMatHandle)
Definition: device.c:1428

Definition at line 6815 of file device.c.

Referenced by d3d_device_init(), and unsafe_impl_from_IDirect3DDevice().

◆ d3d_device2_vtbl

const struct IDirect3DDevice2Vtbl d3d_device2_vtbl
static

Definition at line 6776 of file device.c.

Referenced by d3d_device_init(), and unsafe_impl_from_IDirect3DDevice2().

◆ d3d_device3_vtbl

const struct IDirect3DDevice3Vtbl d3d_device3_vtbl
static

Definition at line 6728 of file device.c.

Referenced by d3d_device_init(), and unsafe_impl_from_IDirect3DDevice3().

◆ d3d_device7_fpu_preserve_vtbl

const struct IDirect3DDevice7Vtbl d3d_device7_fpu_preserve_vtbl
static

Definition at line 6673 of file device.c.

Referenced by d3d_device_init(), and unsafe_impl_from_IDirect3DDevice7().

◆ d3d_device7_fpu_setup_vtbl

const struct IDirect3DDevice7Vtbl d3d_device7_fpu_setup_vtbl
static

Definition at line 6618 of file device.c.

Referenced by d3d_device_init(), and unsafe_impl_from_IDirect3DDevice7().

◆ d3d_device_inner_vtbl

const struct IUnknownVtbl d3d_device_inner_vtbl
static
Initial value:
=
{
}
static ULONG WINAPI d3d_device_inner_Release(IUnknown *iface)
Definition: device.c:223
static HRESULT WINAPI d3d_device_inner_QueryInterface(IUnknown *iface, REFIID riid, void **out)
Definition: device.c:83
static ULONG WINAPI d3d_device_inner_AddRef(IUnknown *iface)
Definition: device.c:177

Definition at line 6843 of file device.c.

Referenced by d3d_device_init().

◆ IID_D3DDEVICE_WineD3D

const GUID IID_D3DDEVICE_WineD3D
Initial value:
= {
0xaef72d43,
0xb09a,
0x4b7b,
{ 0xb7,0x98,0xc6,0x8a,0x77,0x2d,0x72,0x2a }
}

Definition at line 39 of file device.c.

Referenced by d3d3_FindDevice(), d3d7_EnumZBufferFormats(), and ddraw_surface7_QueryInterface().

◆ tss_lookup

Initial value:
=
{
}
@ WINED3D_SAMP_MAX_ANISOTROPY
Definition: wined3d.h:545
@ WINED3D_SAMP_MIPMAP_LOD_BIAS
Definition: wined3d.h:543
@ WINED3D_SAMP_BORDER_COLOR
Definition: wined3d.h:539
@ WINED3D_SAMP_MAX_MIP_LEVEL
Definition: wined3d.h:544
@ WINED3D_TSS_BUMPENV_LOFFSET
Definition: wined3d.h:587
@ WINED3D_TSS_BUMPENV_MAT11
Definition: wined3d.h:584
@ WINED3D_TSS_INVALID
Definition: wined3d.h:593
@ WINED3D_TSS_BUMPENV_MAT10
Definition: wined3d.h:583
@ WINED3D_TSS_TEXCOORD_INDEX
Definition: wined3d.h:585
@ WINED3D_TSS_BUMPENV_MAT01
Definition: wined3d.h:582
@ WINED3D_TSS_BUMPENV_LSCALE
Definition: wined3d.h:586
@ WINED3D_TSS_BUMPENV_MAT00
Definition: wined3d.h:581
@ WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS
Definition: wined3d.h:588