ReactOS  0.4.14-dev-49-gfb4591c
device.c File Reference
#include "config.h"
#include <math.h>
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "d3d8_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 (d3d8)
 
static void STDMETHODCALLTYPE d3d8_null_wined3d_object_destroyed (void *parent)
 
D3DFORMAT d3dformat_from_wined3dformat (enum wined3d_format_id format)
 
enum wined3d_format_id wined3dformat_from_d3dformat (D3DFORMAT format)
 
unsigned int wined3dmapflags_from_d3dmapflags (unsigned int flags)
 
static UINT vertex_count_from_primitive_count (D3DPRIMITIVETYPE primitive_type, UINT primitive_count)
 
static D3DSWAPEFFECT d3dswapeffect_from_wined3dswapeffect (enum wined3d_swap_effect effect)
 
static void present_parameters_from_wined3d_swapchain_desc (D3DPRESENT_PARAMETERS *present_parameters, const struct wined3d_swapchain_desc *swapchain_desc)
 
static enum wined3d_swap_effect wined3dswapeffect_from_d3dswapeffect (D3DSWAPEFFECT effect)
 
static BOOL wined3d_swapchain_desc_from_present_parameters (struct wined3d_swapchain_desc *swapchain_desc, const D3DPRESENT_PARAMETERS *present_parameters)
 
void d3dcaps_from_wined3dcaps (D3DCAPS8 *caps, const WINED3DCAPS *wined3d_caps)
 
static DWORD d3d8_allocate_handle (struct d3d8_handle_table *t, void *object, enum d3d8_handle_type type)
 
static voidd3d8_free_handle (struct d3d8_handle_table *t, DWORD handle, enum d3d8_handle_type type)
 
static voidd3d8_get_object (struct d3d8_handle_table *t, DWORD handle, enum d3d8_handle_type type)
 
static HRESULT WINAPI d3d8_device_QueryInterface (IDirect3DDevice8 *iface, REFIID riid, void **out)
 
static ULONG WINAPI d3d8_device_AddRef (IDirect3DDevice8 *iface)
 
static ULONG WINAPI d3d8_device_Release (IDirect3DDevice8 *iface)
 
static HRESULT WINAPI d3d8_device_TestCooperativeLevel (IDirect3DDevice8 *iface)
 
static UINT WINAPI d3d8_device_GetAvailableTextureMem (IDirect3DDevice8 *iface)
 
static HRESULT WINAPI d3d8_device_ResourceManagerDiscardBytes (IDirect3DDevice8 *iface, DWORD byte_count)
 
static HRESULT WINAPI d3d8_device_GetDirect3D (IDirect3DDevice8 *iface, IDirect3D8 **d3d8)
 
static HRESULT WINAPI d3d8_device_GetDeviceCaps (IDirect3DDevice8 *iface, D3DCAPS8 *caps)
 
static HRESULT WINAPI d3d8_device_GetDisplayMode (IDirect3DDevice8 *iface, D3DDISPLAYMODE *mode)
 
static HRESULT WINAPI d3d8_device_GetCreationParameters (IDirect3DDevice8 *iface, D3DDEVICE_CREATION_PARAMETERS *parameters)
 
static HRESULT WINAPI d3d8_device_SetCursorProperties (IDirect3DDevice8 *iface, UINT hotspot_x, UINT hotspot_y, IDirect3DSurface8 *bitmap)
 
static void WINAPI d3d8_device_SetCursorPosition (IDirect3DDevice8 *iface, UINT x, UINT y, DWORD flags)
 
static BOOL WINAPI d3d8_device_ShowCursor (IDirect3DDevice8 *iface, BOOL show)
 
static HRESULT WINAPI d3d8_device_CreateAdditionalSwapChain (IDirect3DDevice8 *iface, D3DPRESENT_PARAMETERS *present_parameters, IDirect3DSwapChain8 **swapchain)
 
static HRESULT CDECL reset_enum_callback (struct wined3d_resource *resource)
 
static HRESULT WINAPI d3d8_device_Reset (IDirect3DDevice8 *iface, D3DPRESENT_PARAMETERS *present_parameters)
 
static HRESULT WINAPI d3d8_device_Present (IDirect3DDevice8 *iface, const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, const RGNDATA *dirty_region)
 
static HRESULT WINAPI d3d8_device_GetBackBuffer (IDirect3DDevice8 *iface, UINT backbuffer_idx, D3DBACKBUFFER_TYPE backbuffer_type, IDirect3DSurface8 **backbuffer)
 
static HRESULT WINAPI d3d8_device_GetRasterStatus (IDirect3DDevice8 *iface, D3DRASTER_STATUS *raster_status)
 
static void WINAPI d3d8_device_SetGammaRamp (IDirect3DDevice8 *iface, DWORD flags, const D3DGAMMARAMP *ramp)
 
static void WINAPI d3d8_device_GetGammaRamp (IDirect3DDevice8 *iface, D3DGAMMARAMP *ramp)
 
static HRESULT WINAPI d3d8_device_CreateTexture (IDirect3DDevice8 *iface, UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool, IDirect3DTexture8 **texture)
 
static HRESULT WINAPI d3d8_device_CreateVolumeTexture (IDirect3DDevice8 *iface, UINT width, UINT height, UINT depth, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool, IDirect3DVolumeTexture8 **texture)
 
static HRESULT WINAPI d3d8_device_CreateCubeTexture (IDirect3DDevice8 *iface, UINT edge_length, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool, IDirect3DCubeTexture8 **texture)
 
static HRESULT WINAPI d3d8_device_CreateVertexBuffer (IDirect3DDevice8 *iface, UINT size, DWORD usage, DWORD fvf, D3DPOOL pool, IDirect3DVertexBuffer8 **buffer)
 
static HRESULT WINAPI d3d8_device_CreateIndexBuffer (IDirect3DDevice8 *iface, UINT size, DWORD usage, D3DFORMAT format, D3DPOOL pool, IDirect3DIndexBuffer8 **buffer)
 
static HRESULT d3d8_device_create_surface (struct d3d8_device *device, UINT width, UINT height, D3DFORMAT format, DWORD flags, IDirect3DSurface8 **surface, UINT usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality)
 
static HRESULT WINAPI d3d8_device_CreateRenderTarget (IDirect3DDevice8 *iface, UINT width, UINT height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multisample_type, BOOL lockable, IDirect3DSurface8 **surface)
 
static HRESULT WINAPI d3d8_device_CreateDepthStencilSurface (IDirect3DDevice8 *iface, UINT width, UINT height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multisample_type, IDirect3DSurface8 **surface)
 
static HRESULT WINAPI d3d8_device_CreateImageSurface (IDirect3DDevice8 *iface, UINT width, UINT height, D3DFORMAT format, IDirect3DSurface8 **surface)
 
static HRESULT WINAPI d3d8_device_CopyRects (IDirect3DDevice8 *iface, IDirect3DSurface8 *src_surface, const RECT *src_rects, UINT rect_count, IDirect3DSurface8 *dst_surface, const POINT *dst_points)
 
static HRESULT WINAPI d3d8_device_UpdateTexture (IDirect3DDevice8 *iface, IDirect3DBaseTexture8 *src_texture, IDirect3DBaseTexture8 *dst_texture)
 
static HRESULT WINAPI d3d8_device_GetFrontBuffer (IDirect3DDevice8 *iface, IDirect3DSurface8 *dst_surface)
 
static HRESULT WINAPI d3d8_device_SetRenderTarget (IDirect3DDevice8 *iface, IDirect3DSurface8 *render_target, IDirect3DSurface8 *depth_stencil)
 
static HRESULT WINAPI d3d8_device_GetRenderTarget (IDirect3DDevice8 *iface, IDirect3DSurface8 **render_target)
 
static HRESULT WINAPI d3d8_device_GetDepthStencilSurface (IDirect3DDevice8 *iface, IDirect3DSurface8 **depth_stencil)
 
static HRESULT WINAPI d3d8_device_BeginScene (IDirect3DDevice8 *iface)
 
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d8_device_EndScene (IDirect3DDevice8 *iface)
 
static HRESULT WINAPI d3d8_device_Clear (IDirect3DDevice8 *iface, DWORD rect_count, const D3DRECT *rects, DWORD flags, D3DCOLOR color, float z, DWORD stencil)
 
static HRESULT WINAPI d3d8_device_SetTransform (IDirect3DDevice8 *iface, D3DTRANSFORMSTATETYPE state, const D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d8_device_GetTransform (IDirect3DDevice8 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d8_device_MultiplyTransform (IDirect3DDevice8 *iface, D3DTRANSFORMSTATETYPE state, const D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d8_device_SetViewport (IDirect3DDevice8 *iface, const D3DVIEWPORT8 *viewport)
 
static HRESULT WINAPI d3d8_device_GetViewport (IDirect3DDevice8 *iface, D3DVIEWPORT8 *viewport)
 
static HRESULT WINAPI d3d8_device_SetMaterial (IDirect3DDevice8 *iface, const D3DMATERIAL8 *material)
 
static HRESULT WINAPI d3d8_device_GetMaterial (IDirect3DDevice8 *iface, D3DMATERIAL8 *material)
 
static HRESULT WINAPI d3d8_device_SetLight (IDirect3DDevice8 *iface, DWORD index, const D3DLIGHT8 *light)
 
static HRESULT WINAPI d3d8_device_GetLight (IDirect3DDevice8 *iface, DWORD index, D3DLIGHT8 *light)
 
static HRESULT WINAPI d3d8_device_LightEnable (IDirect3DDevice8 *iface, DWORD index, BOOL enable)
 
static HRESULT WINAPI d3d8_device_GetLightEnable (IDirect3DDevice8 *iface, DWORD index, BOOL *enable)
 
static HRESULT WINAPI d3d8_device_SetClipPlane (IDirect3DDevice8 *iface, DWORD index, const float *plane)
 
static HRESULT WINAPI d3d8_device_GetClipPlane (IDirect3DDevice8 *iface, DWORD index, float *plane)
 
static HRESULT WINAPI d3d8_device_SetRenderState (IDirect3DDevice8 *iface, D3DRENDERSTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d8_device_GetRenderState (IDirect3DDevice8 *iface, D3DRENDERSTATETYPE state, DWORD *value)
 
static HRESULT WINAPI d3d8_device_BeginStateBlock (IDirect3DDevice8 *iface)
 
static HRESULT WINAPI d3d8_device_EndStateBlock (IDirect3DDevice8 *iface, DWORD *token)
 
static HRESULT WINAPI d3d8_device_ApplyStateBlock (IDirect3DDevice8 *iface, DWORD token)
 
static HRESULT WINAPI d3d8_device_CaptureStateBlock (IDirect3DDevice8 *iface, DWORD token)
 
static HRESULT WINAPI d3d8_device_DeleteStateBlock (IDirect3DDevice8 *iface, DWORD token)
 
static HRESULT WINAPI d3d8_device_CreateStateBlock (IDirect3DDevice8 *iface, D3DSTATEBLOCKTYPE type, DWORD *handle)
 
static HRESULT WINAPI d3d8_device_SetClipStatus (IDirect3DDevice8 *iface, const D3DCLIPSTATUS8 *clip_status)
 
static HRESULT WINAPI d3d8_device_GetClipStatus (IDirect3DDevice8 *iface, D3DCLIPSTATUS8 *clip_status)
 
static HRESULT WINAPI d3d8_device_GetTexture (IDirect3DDevice8 *iface, DWORD stage, IDirect3DBaseTexture8 **texture)
 
static HRESULT WINAPI d3d8_device_SetTexture (IDirect3DDevice8 *iface, DWORD stage, IDirect3DBaseTexture8 *texture)
 
static HRESULT WINAPI d3d8_device_GetTextureStageState (IDirect3DDevice8 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE Type, DWORD *value)
 
static HRESULT WINAPI d3d8_device_SetTextureStageState (IDirect3DDevice8 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE type, DWORD value)
 
static HRESULT WINAPI d3d8_device_ValidateDevice (IDirect3DDevice8 *iface, DWORD *pass_count)
 
static HRESULT WINAPI d3d8_device_GetInfo (IDirect3DDevice8 *iface, DWORD info_id, void *info, DWORD info_size)
 
static HRESULT WINAPI d3d8_device_SetPaletteEntries (IDirect3DDevice8 *iface, UINT palette_idx, const PALETTEENTRY *entries)
 
static HRESULT WINAPI d3d8_device_GetPaletteEntries (IDirect3DDevice8 *iface, UINT palette_idx, PALETTEENTRY *entries)
 
static HRESULT WINAPI d3d8_device_SetCurrentTexturePalette (IDirect3DDevice8 *iface, UINT palette_idx)
 
static HRESULT WINAPI d3d8_device_GetCurrentTexturePalette (IDirect3DDevice8 *iface, UINT *palette_idx)
 
static HRESULT WINAPI d3d8_device_DrawPrimitive (IDirect3DDevice8 *iface, D3DPRIMITIVETYPE primitive_type, UINT start_vertex, UINT primitive_count)
 
static HRESULT WINAPI d3d8_device_DrawIndexedPrimitive (IDirect3DDevice8 *iface, D3DPRIMITIVETYPE primitive_type, UINT min_vertex_idx, UINT vertex_count, UINT start_idx, UINT primitive_count)
 
static HRESULT d3d8_device_prepare_vertex_buffer (struct d3d8_device *device, UINT min_size)
 
static HRESULT WINAPI d3d8_device_DrawPrimitiveUP (IDirect3DDevice8 *iface, D3DPRIMITIVETYPE primitive_type, UINT primitive_count, const void *data, UINT stride)
 
static HRESULT d3d8_device_prepare_index_buffer (struct d3d8_device *device, UINT min_size)
 
static HRESULT WINAPI d3d8_device_DrawIndexedPrimitiveUP (IDirect3DDevice8 *iface, D3DPRIMITIVETYPE primitive_type, UINT min_vertex_idx, UINT vertex_count, UINT primitive_count, const void *index_data, D3DFORMAT index_format, const void *vertex_data, UINT vertex_stride)
 
static HRESULT WINAPI d3d8_device_ProcessVertices (IDirect3DDevice8 *iface, UINT src_start_idx, UINT dst_idx, UINT vertex_count, IDirect3DVertexBuffer8 *dst_buffer, DWORD flags)
 
static HRESULT WINAPI d3d8_device_CreateVertexShader (IDirect3DDevice8 *iface, const DWORD *declaration, const DWORD *byte_code, DWORD *shader, DWORD usage)
 
static struct d3d8_vertex_declarationd3d8_device_get_fvf_declaration (struct d3d8_device *device, DWORD fvf)
 
static HRESULT WINAPI d3d8_device_SetVertexShader (IDirect3DDevice8 *iface, DWORD shader)
 
static HRESULT WINAPI d3d8_device_GetVertexShader (IDirect3DDevice8 *iface, DWORD *shader)
 
static HRESULT WINAPI d3d8_device_DeleteVertexShader (IDirect3DDevice8 *iface, DWORD shader)
 
static HRESULT WINAPI d3d8_device_SetVertexShaderConstant (IDirect3DDevice8 *iface, DWORD start_register, const void *data, DWORD count)
 
static HRESULT WINAPI d3d8_device_GetVertexShaderConstant (IDirect3DDevice8 *iface, DWORD start_register, void *data, DWORD count)
 
static HRESULT WINAPI d3d8_device_GetVertexShaderDeclaration (IDirect3DDevice8 *iface, DWORD shader, void *data, DWORD *data_size)
 
static HRESULT WINAPI d3d8_device_GetVertexShaderFunction (IDirect3DDevice8 *iface, DWORD shader, void *data, DWORD *data_size)
 
static HRESULT WINAPI d3d8_device_SetIndices (IDirect3DDevice8 *iface, IDirect3DIndexBuffer8 *buffer, UINT base_vertex_idx)
 
static HRESULT WINAPI d3d8_device_GetIndices (IDirect3DDevice8 *iface, IDirect3DIndexBuffer8 **buffer, UINT *base_vertex_index)
 
static HRESULT WINAPI d3d8_device_CreatePixelShader (IDirect3DDevice8 *iface, const DWORD *byte_code, DWORD *shader)
 
static HRESULT WINAPI d3d8_device_SetPixelShader (IDirect3DDevice8 *iface, DWORD shader)
 
static HRESULT WINAPI d3d8_device_GetPixelShader (IDirect3DDevice8 *iface, DWORD *shader)
 
static HRESULT WINAPI d3d8_device_DeletePixelShader (IDirect3DDevice8 *iface, DWORD shader)
 
static HRESULT WINAPI d3d8_device_SetPixelShaderConstant (IDirect3DDevice8 *iface, DWORD start_register, const void *data, DWORD count)
 
static HRESULT WINAPI d3d8_device_GetPixelShaderConstant (IDirect3DDevice8 *iface, DWORD start_register, void *data, DWORD count)
 
static HRESULT WINAPI d3d8_device_GetPixelShaderFunction (IDirect3DDevice8 *iface, DWORD shader, void *data, DWORD *data_size)
 
static HRESULT WINAPI d3d8_device_DrawRectPatch (IDirect3DDevice8 *iface, UINT handle, const float *segment_count, const D3DRECTPATCH_INFO *patch_info)
 
static HRESULT WINAPI d3d8_device_DrawTriPatch (IDirect3DDevice8 *iface, UINT handle, const float *segment_count, const D3DTRIPATCH_INFO *patch_info)
 
static HRESULT WINAPI d3d8_device_DeletePatch (IDirect3DDevice8 *iface, UINT handle)
 
static HRESULT WINAPI d3d8_device_SetStreamSource (IDirect3DDevice8 *iface, UINT stream_idx, IDirect3DVertexBuffer8 *buffer, UINT stride)
 
static HRESULT WINAPI d3d8_device_GetStreamSource (IDirect3DDevice8 *iface, UINT stream_idx, IDirect3DVertexBuffer8 **buffer, UINT *stride)
 
static struct d3d8_devicedevice_from_device_parent (struct wined3d_device_parent *device_parent)
 
static void CDECL device_parent_wined3d_device_created (struct wined3d_device_parent *device_parent, struct wined3d_device *device)
 
static void CDECL device_parent_mode_changed (struct wined3d_device_parent *device_parent)
 
static void CDECL device_parent_activate (struct wined3d_device_parent *device_parent, BOOL activate)
 
static HRESULT CDECL device_parent_surface_created (struct wined3d_device_parent *device_parent, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, void **parent, const struct wined3d_parent_ops **parent_ops)
 
static HRESULT CDECL device_parent_volume_created (struct wined3d_device_parent *device_parent, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, void **parent, const struct wined3d_parent_ops **parent_ops)
 
static HRESULT CDECL device_parent_create_swapchain_texture (struct wined3d_device_parent *device_parent, void *container_parent, const struct wined3d_resource_desc *desc, DWORD texture_flags, struct wined3d_texture **texture)
 
static HRESULT CDECL device_parent_create_swapchain (struct wined3d_device_parent *device_parent, struct wined3d_swapchain_desc *desc, struct wined3d_swapchain **swapchain)
 
static void setup_fpu (void)
 
HRESULT device_init (struct d3d8_device *device, struct d3d8 *parent, struct wined3d *wined3d, UINT adapter, D3DDEVTYPE device_type, HWND focus_window, DWORD flags, D3DPRESENT_PARAMETERS *parameters)
 

Variables

static const struct wined3d_parent_ops d3d8_null_wined3d_parent_ops
 
static const struct tss_lookup tss_lookup []
 
static const struct IDirect3DDevice8Vtbl d3d8_device_vtbl
 
static const struct wined3d_device_parent_ops d3d8_wined3d_device_parent_ops
 

Function Documentation

◆ d3d8_allocate_handle()

static DWORD d3d8_allocate_handle ( struct d3d8_handle_table t,
void object,
enum d3d8_handle_type  type 
)
static

Definition at line 361 of file device.c.

362 {
363  struct d3d8_handle_entry *entry;
364 
365  if (t->free_entries)
366  {
367  DWORD index = t->free_entries - t->entries;
368  /* Use a free handle */
369  entry = t->free_entries;
370  if (entry->type != D3D8_HANDLE_FREE)
371  {
372  ERR("Handle %u(%p) is in the free list, but has type %#x.\n", index, entry, entry->type);
373  return D3D8_INVALID_HANDLE;
374  }
375  t->free_entries = entry->object;
376  entry->object = object;
377  entry->type = type;
378 
379  return index;
380  }
381 
382  if (!(t->entry_count < t->table_size))
383  {
384  /* Grow the table */
385  UINT new_size = t->table_size + (t->table_size >> 1);
386  struct d3d8_handle_entry *new_entries;
387 
388  if (!(new_entries = heap_realloc(t->entries, new_size * sizeof(*t->entries))))
389  {
390  ERR("Failed to grow the handle table.\n");
391  return D3D8_INVALID_HANDLE;
392  }
393  t->entries = new_entries;
394  t->table_size = new_size;
395  }
396 
397  entry = &t->entries[t->entry_count];
398  entry->object = object;
399  entry->type = type;
400 
401  return t->entry_count++;
402 }
GLdouble GLdouble t
Definition: gl.h:2047
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:70
GLuint index
Definition: glext.h:6031
unsigned long DWORD
Definition: ntddk_ex.h:95
#define index(s, c)
Definition: various.h:29
Definition: d3d8_private.h:71
uint32_t entry
Definition: isohybrid.c:63
#define ERR(fmt,...)
Definition: debug.h:109
unsigned int UINT
Definition: ndis.h:50
#define D3D8_INVALID_HANDLE
Definition: d3d8_private.h:61
void * object
Definition: jmemsys.h:48

Referenced by d3d8_device_CreatePixelShader(), d3d8_device_CreateStateBlock(), d3d8_device_CreateVertexShader(), and d3d8_device_EndStateBlock().

◆ d3d8_device_AddRef()

static ULONG WINAPI d3d8_device_AddRef ( IDirect3DDevice8 *  iface)
static

Definition at line 469 of file device.c.

470 {
473 
474  TRACE("%p increasing refcount to %u.\n", iface, ref);
475 
476  return ref;
477 }
Definition: send.c:47
Definition: devices.h:37
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1

◆ d3d8_device_ApplyStateBlock()

static HRESULT WINAPI d3d8_device_ApplyStateBlock ( IDirect3DDevice8 *  iface,
DWORD  token 
)
static

Definition at line 1783 of file device.c.

1784 {
1786  struct wined3d_stateblock *stateblock;
1787 
1788  TRACE("iface %p, token %#x.\n", iface, token);
1789 
1790  if (!token)
1791  return D3D_OK;
1792 
1794  stateblock = d3d8_get_object(&device->handle_table, token - 1, D3D8_HANDLE_SB);
1795  if (!stateblock)
1796  {
1797  WARN("Invalid handle (%#x) passed.\n", token);
1799  return D3DERR_INVALIDCALL;
1800  }
1801  wined3d_stateblock_apply(stateblock);
1803 
1804  return D3D_OK;
1805 }
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
Definition: devices.h:37
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 token
Definition: glfuncs.h:210
#define TRACE(s)
Definition: solgame.cpp:4
void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock)
Definition: stateblock.c:965
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define D3D_OK
Definition: d3d.h:106
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
static void * d3d8_get_object(struct d3d8_handle_table *t, DWORD handle, enum d3d8_handle_type type)
Definition: device.c:430

◆ d3d8_device_BeginScene()

static HRESULT WINAPI d3d8_device_BeginScene ( IDirect3DDevice8 *  iface)
static

Definition at line 1429 of file device.c.

1430 {
1432  HRESULT hr;
1433 
1434  TRACE("iface %p.\n", iface);
1435 
1437  hr = wined3d_device_begin_scene(device->wined3d_device);
1439 
1440  return hr;
1441 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
HRESULT CDECL wined3d_device_begin_scene(struct wined3d_device *device)
Definition: device.c:3602
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_BeginStateBlock()

static HRESULT WINAPI d3d8_device_BeginStateBlock ( IDirect3DDevice8 *  iface)
static

Definition at line 1731 of file device.c.

1732 {
1734  HRESULT hr;
1735 
1736  TRACE("iface %p.\n", iface);
1737 
1739  hr = wined3d_device_begin_stateblock(device->wined3d_device);
1741 
1742  return hr;
1743 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT CDECL wined3d_device_begin_stateblock(struct wined3d_device *device)
Definition: device.c:3555
LONG HRESULT
Definition: typedefs.h:77
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_CaptureStateBlock()

static HRESULT WINAPI d3d8_device_CaptureStateBlock ( IDirect3DDevice8 *  iface,
DWORD  token 
)
static

Definition at line 1807 of file device.c.

1808 {
1810  struct wined3d_stateblock *stateblock;
1811 
1812  TRACE("iface %p, token %#x.\n", iface, token);
1813 
1815  stateblock = d3d8_get_object(&device->handle_table, token - 1, D3D8_HANDLE_SB);
1816  if (!stateblock)
1817  {
1818  WARN("Invalid handle (%#x) passed.\n", token);
1820  return D3DERR_INVALIDCALL;
1821  }
1822  wined3d_stateblock_capture(stateblock);
1824 
1825  return D3D_OK;
1826 }
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
Definition: devices.h:37
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 token
Definition: glfuncs.h:210
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define D3D_OK
Definition: d3d.h:106
void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock)
Definition: stateblock.c:684
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
static void * d3d8_get_object(struct d3d8_handle_table *t, DWORD handle, enum d3d8_handle_type type)
Definition: device.c:430

◆ d3d8_device_Clear()

static HRESULT WINAPI d3d8_device_Clear ( IDirect3DDevice8 *  iface,
DWORD  rect_count,
const D3DRECT rects,
DWORD  flags,
D3DCOLOR  color,
float  z,
DWORD  stencil 
)
static

Definition at line 1457 of file device.c.

1459 {
1460  const struct wined3d_color c =
1461  {
1462  ((color >> 16) & 0xff) / 255.0f,
1463  ((color >> 8) & 0xff) / 255.0f,
1464  (color & 0xff) / 255.0f,
1465  ((color >> 24) & 0xff) / 255.0f,
1466  };
1468  HRESULT hr;
1469 
1470  TRACE("iface %p, rect_count %u, rects %p, flags %#x, color 0x%08x, z %.8e, stencil %u.\n",
1471  iface, rect_count, rects, flags, color, z, stencil);
1472 
1473  if (rect_count && !rects)
1474  {
1475  WARN("count %u with NULL rects.\n", rect_count);
1476  rect_count = 0;
1477  }
1478 
1480  hr = wined3d_device_clear(device->wined3d_device, rect_count, (const RECT *)rects, flags, &c, z, stencil);
1482 
1483  return hr;
1484 }
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
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
GLint GLfloat GLint stencil
Definition: glext.h:6260
GLuint color
Definition: glext.h:6243
Definition: devices.h:37
GLdouble GLdouble z
Definition: glext.h:5874
GLfloat f
Definition: glext.h:7540
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
const GLubyte * c
Definition: glext.h:8905
GLbitfield flags
Definition: glext.h:7161
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_CopyRects()

static HRESULT WINAPI d3d8_device_CopyRects ( IDirect3DDevice8 *  iface,
IDirect3DSurface8 *  src_surface,
const RECT src_rects,
UINT  rect_count,
IDirect3DSurface8 *  dst_surface,
const POINT dst_points 
)
static

Definition at line 1163 of file device.c.

1166 {
1167  struct d3d8_surface *src = unsafe_impl_from_IDirect3DSurface8(src_surface);
1168  struct d3d8_surface *dst = unsafe_impl_from_IDirect3DSurface8(dst_surface);
1169  enum wined3d_format_id src_format, dst_format;
1170  struct wined3d_sub_resource_desc wined3d_desc;
1171  UINT src_w, src_h;
1172 
1173  TRACE("iface %p, src_surface %p, src_rects %p, rect_count %u, dst_surface %p, dst_points %p.\n",
1174  iface, src_surface, src_rects, rect_count, dst_surface, dst_points);
1175 
1176  /* Check that the source texture is in WINED3D_POOL_SYSTEM_MEM and the
1177  * destination texture is in WINED3D_POOL_DEFAULT. */
1178 
1180  wined3d_texture_get_sub_resource_desc(src->wined3d_texture, src->sub_resource_idx, &wined3d_desc);
1181  if (wined3d_desc.usage & WINED3DUSAGE_DEPTHSTENCIL)
1182  {
1183  WARN("Source %p is a depth stencil surface, returning D3DERR_INVALIDCALL.\n", src_surface);
1185  return D3DERR_INVALIDCALL;
1186  }
1187  src_format = wined3d_desc.format;
1188  src_w = wined3d_desc.width;
1189  src_h = wined3d_desc.height;
1190 
1191  wined3d_texture_get_sub_resource_desc(dst->wined3d_texture, dst->sub_resource_idx, &wined3d_desc);
1192  if (wined3d_desc.usage & WINED3DUSAGE_DEPTHSTENCIL)
1193  {
1194  WARN("Destination %p is a depth stencil surface, returning D3DERR_INVALIDCALL.\n", dst_surface);
1196  return D3DERR_INVALIDCALL;
1197  }
1198  dst_format = wined3d_desc.format;
1199 
1200  /* Check that the source and destination formats match */
1201  if (src_format != dst_format)
1202  {
1203  WARN("Source %p format must match the destination %p format, returning D3DERR_INVALIDCALL.\n",
1204  src_surface, dst_surface);
1206  return D3DERR_INVALIDCALL;
1207  }
1208 
1209  /* Quick if complete copy ... */
1210  if (!rect_count && !src_rects && !dst_points)
1211  {
1212  RECT rect = {0, 0, src_w, src_h};
1213  wined3d_texture_blt(dst->wined3d_texture, dst->sub_resource_idx, &rect,
1214  src->wined3d_texture, src->sub_resource_idx, &rect, 0, NULL, WINED3D_TEXF_POINT);
1215  }
1216  else
1217  {
1218  unsigned int i;
1219  /* Copy rect by rect */
1220  if (src_rects && dst_points)
1221  {
1222  for (i = 0; i < rect_count; ++i)
1223  {
1224  UINT w = src_rects[i].right - src_rects[i].left;
1225  UINT h = src_rects[i].bottom - src_rects[i].top;
1226  RECT dst_rect = {dst_points[i].x, dst_points[i].y,
1227  dst_points[i].x + w, dst_points[i].y + h};
1228 
1229  wined3d_texture_blt(dst->wined3d_texture, dst->sub_resource_idx, &dst_rect,
1230  src->wined3d_texture, src->sub_resource_idx, &src_rects[i], 0, NULL, WINED3D_TEXF_POINT);
1231  }
1232  }
1233  else
1234  {
1235  for (i = 0; i < rect_count; ++i)
1236  {
1237  UINT w = src_rects[i].right - src_rects[i].left;
1238  UINT h = src_rects[i].bottom - src_rects[i].top;
1239  RECT dst_rect = {0, 0, w, h};
1240 
1241  wined3d_texture_blt(dst->wined3d_texture, dst->sub_resource_idx, &dst_rect,
1242  src->wined3d_texture, src->sub_resource_idx, &src_rects[i], 0, NULL, WINED3D_TEXF_POINT);
1243  }
1244  }
1245  }
1247 
1248  return WINED3D_OK;
1249 }
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
long y
Definition: polytest.cpp:48
static const char * dst_format
Definition: dib.c:1133
long x
Definition: polytest.cpp:48
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
LONG top
Definition: windef.h:292
#define D3DERR_INVALIDCALL
HRESULT CDECL wined3d_texture_get_sub_resource_desc(const struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_sub_resource_desc *desc)
Definition: texture.c:3480
#define WINED3DUSAGE_DEPTHSTENCIL
Definition: wined3d.h:900
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
& rect
Definition: startmenu.cpp:1413
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
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
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
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
#define WINED3D_OK
Definition: wined3d.h:37
GLenum src
Definition: glext.h:6340
wined3d_format_id
Definition: wined3d.h:105
struct d3d8_surface * unsafe_impl_from_IDirect3DSurface8(IDirect3DSurface8 *iface) DECLSPEC_HIDDEN
Definition: surface.c:402
GLenum GLenum dst
Definition: glext.h:6340
unsigned int UINT
Definition: ndis.h:50
LONG bottom
Definition: windef.h:294
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_create_surface()

static HRESULT d3d8_device_create_surface ( struct d3d8_device device,
UINT  width,
UINT  height,
D3DFORMAT  format,
DWORD  flags,
IDirect3DSurface8 **  surface,
UINT  usage,
D3DPOOL  pool,
D3DMULTISAMPLE_TYPE  multisample_type,
DWORD  multisample_quality 
)
static

Definition at line 1059 of file device.c.

1062 {
1063  struct wined3d_resource_desc desc;
1064  struct d3d8_surface *surface_impl;
1065  struct wined3d_texture *texture;
1066  HRESULT hr;
1067 
1068  TRACE("device %p, width %u, height %u, format %#x, flags %#x, surface %p, "
1069  "usage %#x, pool %#x, multisample_type %#x, multisample_quality %u.\n",
1070  device, width, height, format, flags, surface,
1071  usage, pool, multisample_type, multisample_quality);
1072 
1073  desc.resource_type = WINED3D_RTYPE_TEXTURE_2D;
1075  desc.multisample_type = multisample_type;
1076  desc.multisample_quality = multisample_quality;
1077  desc.usage = usage & WINED3DUSAGE_MASK;
1078  if (pool == D3DPOOL_SCRATCH)
1079  desc.usage |= WINED3DUSAGE_SCRATCH;
1082  desc.width = width;
1083  desc.height = height;
1084  desc.depth = 1;
1085  desc.size = 0;
1086 
1088 
1089  if (FAILED(hr = wined3d_texture_create(device->wined3d_device, &desc,
1091  {
1093  WARN("Failed to create texture, hr %#x.\n", hr);
1094  return hr;
1095  }
1096 
1098  surface_impl->parent_device = &device->IDirect3DDevice8_iface;
1099  *surface = &surface_impl->IDirect3DSurface8_iface;
1100  IDirect3DSurface8_AddRef(*surface);
1102 
1104 
1105  return D3D_OK;
1106 }
GLint GLint GLsizei width
Definition: gl.h:1546
HRESULT hr
Definition: shlfolder.c:183
IDirect3DDevice8 * parent_device
Definition: d3d8_private.h:182
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define WINED3D_RESOURCE_ACCESS_MAP_W
Definition: wined3d.h:58
enum wined3d_format_id wined3dformat_from_d3dformat(D3DFORMAT format)
Definition: device.c:94
#define IDirect3DSurface8_AddRef(p)
Definition: d3d8.h:309
#define WINED3DUSAGE_MASK
Definition: wined3d.h:913
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
IDirect3DSurface8 IDirect3DSurface8_iface
Definition: d3d8_private.h:176
Definition: devices.h:37
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
smooth NULL
Definition: ftsmooth.c:416
static const struct wined3d_parent_ops d3d8_null_wined3d_parent_ops
Definition: device.c:39
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:77
#define WINED3D_RESOURCE_ACCESS_MAP_R
Definition: wined3d.h:57
GLbitfield flags
Definition: glext.h:7161
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
void *CDECL wined3d_texture_get_sub_resource_parent(struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: texture.c:3449
#define D3D_OK
Definition: d3d.h:106
#define WINED3DUSAGE_SCRATCH
Definition: wined3d.h:915
ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture)
Definition: texture.c:1023
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct wined3d_resource_desc *desc, UINT layer_count, UINT level_count, DWORD flags, const struct wined3d_sub_resource_data *data, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture)
Definition: texture.c:3511
static unsigned int wined3daccess_from_d3dpool(D3DPOOL pool, unsigned int usage)
Definition: d3d8_private.h:301

Referenced by d3d8_device_CreateDepthStencilSurface(), d3d8_device_CreateImageSurface(), and d3d8_device_CreateRenderTarget().

◆ d3d8_device_CreateAdditionalSwapChain()

static HRESULT WINAPI d3d8_device_CreateAdditionalSwapChain ( IDirect3DDevice8 *  iface,
D3DPRESENT_PARAMETERS present_parameters,
IDirect3DSwapChain8 **  swapchain 
)
static

Definition at line 695 of file device.c.

697 {
700  struct d3d8_swapchain *object;
701  UINT i, count;
702  HRESULT hr;
703 
704  TRACE("iface %p, present_parameters %p, swapchain %p.\n",
705  iface, present_parameters, swapchain);
706 
707  if (!present_parameters->Windowed)
708  {
709  WARN("Trying to create an additional fullscreen swapchain, returning D3DERR_INVALIDCALL.\n");
710  return D3DERR_INVALIDCALL;
711  }
712 
715  for (i = 0; i < count; ++i)
716  {
718 
721 
722  if (!desc.windowed)
723  {
725  WARN("Trying to create an additional swapchain in fullscreen mode, returning D3DERR_INVALIDCALL.\n");
726  return D3DERR_INVALIDCALL;
727  }
728  }
730 
731  if (!wined3d_swapchain_desc_from_present_parameters(&desc, present_parameters))
732  return D3DERR_INVALIDCALL;
733  if (SUCCEEDED(hr = d3d8_swapchain_create(device, &desc, &object)))
734  *swapchain = &object->IDirect3DSwapChain8_iface;
736 
737  return hr;
738 }
UINT CDECL wined3d_device_get_swapchain_count(const struct wined3d_device *device)
Definition: device.c:526
static BOOL wined3d_swapchain_desc_from_present_parameters(struct wined3d_swapchain_desc *swapchain_desc, const D3DPRESENT_PARAMETERS *present_parameters)
Definition: device.c:248
HRESULT hr
Definition: shlfolder.c:183
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
struct wined3d_swapchain *CDECL wined3d_device_get_swapchain(const struct wined3d_device *device, UINT swapchain_idx)
Definition: device.c:533
static void present_parameters_from_wined3d_swapchain_desc(D3DPRESENT_PARAMETERS *present_parameters, const struct wined3d_swapchain_desc *swapchain_desc)
Definition: device.c:211
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
Definition: devices.h:37
HRESULT d3d8_swapchain_create(struct d3d8_device *device, struct wined3d_swapchain_desc *desc, struct d3d8_swapchain **swapchain) DECLSPEC_HIDDEN
Definition: swapchain.c:194
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
void CDECL wined3d_swapchain_get_desc(const struct wined3d_swapchain *swapchain, struct wined3d_swapchain_desc *desc)
Definition: swapchain.c:271
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
unsigned int UINT
Definition: ndis.h:50
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
void * object
Definition: jmemsys.h:48
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ d3d8_device_CreateCubeTexture()

static HRESULT WINAPI d3d8_device_CreateCubeTexture ( IDirect3DDevice8 *  iface,
UINT  edge_length,
UINT  levels,
DWORD  usage,
D3DFORMAT  format,
D3DPOOL  pool,
IDirect3DCubeTexture8 **  texture 
)
static

Definition at line 974 of file device.c.

976 {
978  struct d3d8_texture *object;
979  HRESULT hr;
980 
981  TRACE("iface %p, edge_length %u, levels %u, usage %#x, format %#x, pool %#x, texture %p.\n",
982  iface, edge_length, levels, usage, format, pool, texture);
983 
984  if (!format)
985  return D3DERR_INVALIDCALL;
986 
987  *texture = NULL;
988  if (!(object = heap_alloc_zero(sizeof(*object))))
990 
991  hr = cubetexture_init(object, device, edge_length, levels, usage, format, pool);
992  if (FAILED(hr))
993  {
994  WARN("Failed to initialize cube texture, hr %#x.\n", hr);
995  heap_free(object);
996  return hr;
997  }
998 
999  TRACE("Created cube texture %p.\n", object);
1000  *texture = (IDirect3DCubeTexture8 *)&object->IDirect3DBaseTexture8_iface;
1001 
1002  return hr;
1003 }
HRESULT hr
Definition: shlfolder.c:183
GLsizei levels
Definition: glext.h:7884
#define WARN(fmt,...)
Definition: debug.h:111
#define D3DERR_INVALIDCALL
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
HRESULT cubetexture_init(struct d3d8_texture *texture, struct d3d8_device *device, UINT edge_length, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN
Definition: texture.c:1142
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:77
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define D3DERR_OUTOFVIDEOMEMORY
Definition: d3d8.h:85
void * object
Definition: jmemsys.h:48
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ d3d8_device_CreateDepthStencilSurface()

static HRESULT WINAPI d3d8_device_CreateDepthStencilSurface ( IDirect3DDevice8 *  iface,
UINT  width,
UINT  height,
D3DFORMAT  format,
D3DMULTISAMPLE_TYPE  multisample_type,
IDirect3DSurface8 **  surface 
)
static

Definition at line 1129 of file device.c.

1132 {
1134 
1135  TRACE("iface %p, width %u, height %u, format %#x, multisample_type %#x, surface %p.\n",
1136  iface, width, height, format, multisample_type, surface);
1137 
1138  if (!format)
1139  return D3DERR_INVALIDCALL;
1140 
1141  *surface = NULL;
1142 
1143  /* TODO: Verify that Discard is false */
1145  surface, D3DUSAGE_DEPTHSTENCIL, D3DPOOL_DEFAULT, multisample_type, 0);
1146 }
GLint GLint GLsizei width
Definition: gl.h:1546
#define D3DERR_INVALIDCALL
static HRESULT d3d8_device_create_surface(struct d3d8_device *device, UINT width, UINT height, D3DFORMAT format, DWORD flags, IDirect3DSurface8 **surface, UINT usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality)
Definition: device.c:1059
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define D3DUSAGE_DEPTHSTENCIL
Definition: d3d8types.h:92
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define WINED3D_TEXTURE_CREATE_MAPPABLE
Definition: wined3d.h:1558

◆ d3d8_device_CreateImageSurface()

static HRESULT WINAPI d3d8_device_CreateImageSurface ( IDirect3DDevice8 *  iface,
UINT  width,
UINT  height,
D3DFORMAT  format,
IDirect3DSurface8 **  surface 
)
static

Definition at line 1149 of file device.c.

1151 {
1153 
1154  TRACE("iface %p, width %u, height %u, format %#x, surface %p.\n",
1155  iface, width, height, format, surface);
1156 
1157  *surface = NULL;
1158 
1160  surface, 0, D3DPOOL_SYSTEMMEM, D3DMULTISAMPLE_NONE, 0);
1161 }
GLint GLint GLsizei width
Definition: gl.h:1546
static HRESULT d3d8_device_create_surface(struct d3d8_device *device, UINT width, UINT height, D3DFORMAT format, DWORD flags, IDirect3DSurface8 **surface, UINT usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality)
Definition: device.c:1059
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define WINED3D_TEXTURE_CREATE_MAPPABLE
Definition: wined3d.h:1558

◆ d3d8_device_CreateIndexBuffer()

static HRESULT WINAPI d3d8_device_CreateIndexBuffer ( IDirect3DDevice8 *  iface,
UINT  size,
DWORD  usage,
D3DFORMAT  format,
D3DPOOL  pool,
IDirect3DIndexBuffer8 **  buffer 
)
static

Definition at line 1032 of file device.c.

1034 {
1036  struct d3d8_indexbuffer *object;
1037  HRESULT hr;
1038 
1039  TRACE("iface %p, size %u, usage %#x, format %#x, pool %#x, buffer %p.\n",
1040  iface, size, usage, format, pool, buffer);
1041 
1042  if (!(object = heap_alloc_zero(sizeof(*object))))
1043  return D3DERR_OUTOFVIDEOMEMORY;
1044 
1045  hr = indexbuffer_init(object, device, size, usage, format, pool);
1046  if (FAILED(hr))
1047  {
1048  WARN("Failed to initialize index buffer, hr %#x.\n", hr);
1049  heap_free(object);
1050  return hr;
1051  }
1052 
1053  TRACE("Created index buffer %p.\n", object);
1054  *buffer = &object->IDirect3DIndexBuffer8_iface;
1055 
1056  return D3D_OK;
1057 }
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
GLuint buffer
Definition: glext.h:5915
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
Definition: devices.h:37
HRESULT indexbuffer_init(struct d3d8_indexbuffer *buffer, struct d3d8_device *device, UINT size, DWORD usage, D3DFORMAT format, D3DPOOL pool)
Definition: buffer.c:570
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
LONG HRESULT
Definition: typedefs.h:77
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define D3DERR_OUTOFVIDEOMEMORY
Definition: d3d8.h:85
#define D3D_OK
Definition: d3d.h:106
void * object
Definition: jmemsys.h:48
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ d3d8_device_CreatePixelShader()

static HRESULT WINAPI d3d8_device_CreatePixelShader ( IDirect3DDevice8 *  iface,
const DWORD byte_code,
DWORD shader 
)
static

Definition at line 2775 of file device.c.

2777 {
2779  struct d3d8_pixel_shader *object;
2780  DWORD shader_handle;
2781  DWORD handle;
2782  HRESULT hr;
2783 
2784  TRACE("iface %p, byte_code %p, shader %p.\n", iface, byte_code, shader);
2785 
2786  if (!shader)
2787  return D3DERR_INVALIDCALL;
2788 
2789  if (!(object = heap_alloc_zero(sizeof(*object))))
2790  return E_OUTOFMEMORY;
2791 
2793  handle = d3d8_allocate_handle(&device->handle_table, object, D3D8_HANDLE_PS);
2795  if (handle == D3D8_INVALID_HANDLE)
2796  {
2797  ERR("Failed to allocate pixel shader handle.\n");
2798  heap_free(object);
2799  return E_OUTOFMEMORY;
2800  }
2801 
2802  shader_handle = handle + VS_HIGHESTFIXEDFXF + 1;
2803 
2804  hr = d3d8_pixel_shader_init(object, device, byte_code, shader_handle);
2805  if (FAILED(hr))
2806  {
2807  WARN("Failed to initialize pixel shader, hr %#x.\n", hr);
2809  d3d8_free_handle(&device->handle_table, handle, D3D8_HANDLE_PS);
2811  heap_free(object);
2812  *shader = 0;
2813  return hr;
2814  }
2815 
2816  TRACE("Created pixel shader %p (handle %#x).\n", object, shader_handle);
2817  *shader = shader_handle;
2818 
2819  return D3D_OK;
2820 }
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
Definition: devices.h:37
static DWORD d3d8_allocate_handle(struct d3d8_handle_table *t, void *object, enum d3d8_handle_type type)
Definition: device.c:361
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
static void * d3d8_free_handle(struct d3d8_handle_table *t, DWORD handle, enum d3d8_handle_type type)
Definition: device.c:404
#define ERR(fmt,...)
Definition: debug.h:109
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define D3D_OK
Definition: d3d.h:106
#define VS_HIGHESTFIXEDFXF
Definition: d3d8_private.h:43
HRESULT d3d8_pixel_shader_init(struct d3d8_pixel_shader *shader, struct d3d8_device *device, const DWORD *byte_code, DWORD shader_handle) DECLSPEC_HIDDEN
Definition: shader.c:162
#define D3D8_INVALID_HANDLE
Definition: d3d8_private.h:61
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
void * object
Definition: jmemsys.h:48
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ d3d8_device_CreateRenderTarget()

static HRESULT WINAPI d3d8_device_CreateRenderTarget ( IDirect3DDevice8 *  iface,
UINT  width,
UINT  height,
D3DFORMAT  format,
D3DMULTISAMPLE_TYPE  multisample_type,
BOOL  lockable,
IDirect3DSurface8 **  surface 
)
static

Definition at line 1108 of file device.c.

1111 {
1113  DWORD flags = 0;
1114 
1115  TRACE("iface %p, width %u, height %u, format %#x, multisample_type %#x, lockable %#x, surface %p.\n",
1116  iface, width, height, format, multisample_type, lockable, surface);
1117 
1118  if (!format)
1119  return D3DERR_INVALIDCALL;
1120 
1121  *surface = NULL;
1122  if (lockable)
1124 
1126  D3DUSAGE_RENDERTARGET, D3DPOOL_DEFAULT, multisample_type, 0);
1127 }
GLint GLint GLsizei width
Definition: gl.h:1546
#define D3DERR_INVALIDCALL
static HRESULT d3d8_device_create_surface(struct d3d8_device *device, UINT width, UINT height, D3DFORMAT format, DWORD flags, IDirect3DSurface8 **surface, UINT usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality)
Definition: device.c:1059
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define D3DUSAGE_RENDERTARGET
Definition: d3d8types.h:91
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define WINED3D_TEXTURE_CREATE_MAPPABLE
Definition: wined3d.h:1558

◆ d3d8_device_CreateStateBlock()

static HRESULT WINAPI d3d8_device_CreateStateBlock ( IDirect3DDevice8 *  iface,
D3DSTATEBLOCKTYPE  type,
DWORD handle 
)
static

Definition at line 1854 of file device.c.

1856 {
1858  struct wined3d_stateblock *stateblock;
1859  HRESULT hr;
1860 
1861  TRACE("iface %p, type %#x, handle %p.\n", iface, type, handle);
1862 
1863  if (type != D3DSBT_ALL
1864  && type != D3DSBT_PIXELSTATE
1865  && type != D3DSBT_VERTEXSTATE)
1866  {
1867  WARN("Unexpected stateblock type, returning D3DERR_INVALIDCALL\n");
1868  return D3DERR_INVALIDCALL;
1869  }
1870 
1872  hr = wined3d_stateblock_create(device->wined3d_device, (enum wined3d_stateblock_type)type, &stateblock);
1873  if (FAILED(hr))
1874  {
1876  ERR("Failed to create the state block, hr %#x\n", hr);
1877  return hr;
1878  }
1879 
1880  *handle = d3d8_allocate_handle(&device->handle_table, stateblock, D3D8_HANDLE_SB);
1882 
1883  if (*handle == D3D8_INVALID_HANDLE)
1884  {
1885  ERR("Failed to allocate a handle.\n");
1887  wined3d_stateblock_decref(stateblock);
1889  return E_FAIL;
1890  }
1891  ++*handle;
1892 
1893  TRACE("Returning %#x (%p).\n", *handle, stateblock);
1894 
1895  return hr;
1896 }
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
HRESULT CDECL wined3d_stateblock_create(struct wined3d_device *device, enum wined3d_stateblock_type type, struct wined3d_stateblock **stateblock)
Definition: stateblock.c:1372
#define E_FAIL
Definition: ddrawi.h:102
Definition: devices.h:37
static DWORD d3d8_allocate_handle(struct d3d8_handle_table *t, void *object, enum d3d8_handle_type type)
Definition: device.c:361
wined3d_stateblock_type
Definition: wined3d.h:765
#define TRACE(s)
Definition: solgame.cpp:4
ULONG CDECL wined3d_stateblock_decref(struct wined3d_stateblock *stateblock)
Definition: stateblock.c:552
LONG HRESULT
Definition: typedefs.h:77
#define ERR(fmt,...)
Definition: debug.h:109
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define D3D8_INVALID_HANDLE
Definition: d3d8_private.h:61
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_CreateTexture()

static HRESULT WINAPI d3d8_device_CreateTexture ( IDirect3DDevice8 *  iface,
UINT  width,
UINT  height,
UINT  levels,
DWORD  usage,
D3DFORMAT  format,
D3DPOOL  pool,
IDirect3DTexture8 **  texture 
)
static

Definition at line 910 of file device.c.

913 {
915  struct d3d8_texture *object;
916  HRESULT hr;
917 
918  TRACE("iface %p, width %u, height %u, levels %u, usage %#x, format %#x, pool %#x, texture %p.\n",
919  iface, width, height, levels, usage, format, pool, texture);
920 
921  if (!format)
922  return D3DERR_INVALIDCALL;
923 
924  *texture = NULL;
925  if (!(object = heap_alloc_zero(sizeof(*object))))
927 
929  if (FAILED(hr))
930  {
931  WARN("Failed to initialize texture, hr %#x.\n", hr);
932  heap_free(object);
933  return hr;
934  }
935 
936  TRACE("Created texture %p.\n", object);
937  *texture = (IDirect3DTexture8 *)&object->IDirect3DBaseTexture8_iface;
938 
939  return D3D_OK;
940 }
HRESULT texture_init(struct d3d8_texture *texture, struct d3d8_device *device, UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN
Definition: texture.c:1094
GLint GLint GLsizei width
Definition: gl.h:1546
HRESULT hr
Definition: shlfolder.c:183
GLsizei levels
Definition: glext.h:7884
#define WARN(fmt,...)
Definition: debug.h:111
#define D3DERR_INVALIDCALL
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:77
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define D3DERR_OUTOFVIDEOMEMORY
Definition: d3d8.h:85
#define D3D_OK
Definition: d3d.h:106
void * object
Definition: jmemsys.h:48
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ d3d8_device_CreateVertexBuffer()

static HRESULT WINAPI d3d8_device_CreateVertexBuffer ( IDirect3DDevice8 *  iface,
UINT  size,
DWORD  usage,
DWORD  fvf,
D3DPOOL  pool,
IDirect3DVertexBuffer8 **  buffer 
)
static

Definition at line 1005 of file device.c.

1007 {
1009  struct d3d8_vertexbuffer *object;
1010  HRESULT hr;
1011 
1012  TRACE("iface %p, size %u, usage %#x, fvf %#x, pool %#x, buffer %p.\n",
1013  iface, size, usage, fvf, pool, buffer);
1014 
1015  if (!(object = heap_alloc_zero(sizeof(*object))))
1016  return D3DERR_OUTOFVIDEOMEMORY;
1017 
1018  hr = vertexbuffer_init(object, device, size, usage, fvf, pool);
1019  if (FAILED(hr))
1020  {
1021  WARN("Failed to initialize vertex buffer, hr %#x.\n", hr);
1022  heap_free(object);
1023  return hr;
1024  }
1025 
1026  TRACE("Created vertex buffer %p.\n", object);
1027  *buffer = &object->IDirect3DVertexBuffer8_iface;
1028 
1029  return D3D_OK;
1030 }
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
GLuint buffer
Definition: glext.h:5915
Definition: devices.h:37
HRESULT vertexbuffer_init(struct d3d8_vertexbuffer *buffer, struct d3d8_device *device, UINT size, DWORD usage, DWORD fvf, D3DPOOL pool)
Definition: buffer.c:273
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
LONG HRESULT
Definition: typedefs.h:77
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define D3DERR_OUTOFVIDEOMEMORY
Definition: d3d8.h:85
#define D3D_OK
Definition: d3d.h:106
void * object
Definition: jmemsys.h:48
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ d3d8_device_CreateVertexShader()

static HRESULT WINAPI d3d8_device_CreateVertexShader ( IDirect3DDevice8 *  iface,
const DWORD declaration,
const DWORD byte_code,
DWORD shader,
DWORD  usage 
)
static

Definition at line 2401 of file device.c.

2403 {
2405  struct d3d8_vertex_shader *object;
2406  DWORD shader_handle;
2407  DWORD handle;
2408  HRESULT hr;
2409 
2410  TRACE("iface %p, declaration %p, byte_code %p, shader %p, usage %#x.\n",
2411  iface, declaration, byte_code, shader, usage);
2412 
2413  if (!(object = heap_alloc_zero(sizeof(*object))))
2414  {
2415  *shader = 0;
2416  return E_OUTOFMEMORY;
2417  }
2418 
2420  handle = d3d8_allocate_handle(&device->handle_table, object, D3D8_HANDLE_VS);
2422  if (handle == D3D8_INVALID_HANDLE)
2423  {
2424  ERR("Failed to allocate vertex shader handle.\n");
2425  heap_free(object);
2426  *shader = 0;
2427  return E_OUTOFMEMORY;
2428  }
2429 
2430  shader_handle = handle + VS_HIGHESTFIXEDFXF + 1;
2431 
2432  hr = d3d8_vertex_shader_init(object, device, declaration, byte_code, shader_handle, usage);
2433  if (FAILED(hr))
2434  {
2435  WARN("Failed to initialize vertex shader, hr %#x.\n", hr);
2437  d3d8_free_handle(&device->handle_table, handle, D3D8_HANDLE_VS);
2439  heap_free(object);
2440  *shader = 0;
2441  return hr;
2442  }
2443 
2444  TRACE("Created vertex shader %p (handle %#x).\n", object, shader_handle);
2445  *shader = shader_handle;
2446 
2447  return D3D_OK;
2448 }
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
Definition: devices.h:37
static DWORD d3d8_allocate_handle(struct d3d8_handle_table *t, void *object, enum d3d8_handle_type type)
Definition: device.c:361
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT d3d8_vertex_shader_init(struct d3d8_vertex_shader *shader, struct d3d8_device *device, const DWORD *declaration, const DWORD *byte_code, DWORD shader_handle, DWORD usage) DECLSPEC_HIDDEN
Definition: shader.c:79
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
static void * d3d8_free_handle(struct d3d8_handle_table *t, DWORD handle, enum d3d8_handle_type type)
Definition: device.c:404
#define ERR(fmt,...)
Definition: debug.h:109
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define D3D_OK
Definition: d3d.h:106
#define VS_HIGHESTFIXEDFXF
Definition: d3d8_private.h:43
#define D3D8_INVALID_HANDLE
Definition: d3d8_private.h:61
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
void * object
Definition: jmemsys.h:48
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ d3d8_device_CreateVolumeTexture()

static HRESULT WINAPI d3d8_device_CreateVolumeTexture ( IDirect3DDevice8 *  iface,
UINT  width,
UINT  height,
UINT  depth,
UINT  levels,
DWORD  usage,
D3DFORMAT  format,
D3DPOOL  pool,
IDirect3DVolumeTexture8 **  texture 
)
static

Definition at line 942 of file device.c.

945 {
947  struct d3d8_texture *object;
948  HRESULT hr;
949 
950  TRACE("iface %p, width %u, height %u, depth %u, levels %u, usage %#x, format %#x, pool %#x, texture %p.\n",
951  iface, width, height, depth, levels, usage, format, pool, texture);
952 
953  if (!format)
954  return D3DERR_INVALIDCALL;
955 
956  *texture = NULL;
957  if (!(object = heap_alloc_zero(sizeof(*object))))
959 
961  if (FAILED(hr))
962  {
963  WARN("Failed to initialize volume texture, hr %#x.\n", hr);
964  heap_free(object);
965  return hr;
966  }
967 
968  TRACE("Created volume texture %p.\n", object);
969  *texture = (IDirect3DVolumeTexture8 *)&object->IDirect3DBaseTexture8_iface;
970 
971  return D3D_OK;
972 }
GLint GLint GLsizei width
Definition: gl.h:1546
HRESULT hr
Definition: shlfolder.c:183
GLsizei levels
Definition: glext.h:7884
#define WARN(fmt,...)
Definition: debug.h:111
#define D3DERR_INVALIDCALL
HRESULT volumetexture_init(struct d3d8_texture *texture, struct d3d8_device *device, UINT width, UINT height, UINT depth, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN
Definition: texture.c:1190
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:77
GLint GLint GLsizei GLsizei GLsizei depth
Definition: gl.h:1546
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define D3DERR_OUTOFVIDEOMEMORY
Definition: d3d8.h:85
#define D3D_OK
Definition: d3d.h:106
void * object
Definition: jmemsys.h:48
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ d3d8_device_DeletePatch()

static HRESULT WINAPI d3d8_device_DeletePatch ( IDirect3DDevice8 *  iface,
UINT  handle 
)
static

Definition at line 2979 of file device.c.

2980 {
2981  FIXME("iface %p, handle %#x unimplemented.\n", iface, handle);
2982  return D3DERR_INVALIDCALL;
2983 }
#define D3DERR_INVALIDCALL
#define FIXME(fmt,...)
Definition: debug.h:110

◆ d3d8_device_DeletePixelShader()

static HRESULT WINAPI d3d8_device_DeletePixelShader ( IDirect3DDevice8 *  iface,
DWORD  shader 
)
static

Definition at line 2880 of file device.c.

2881 {
2883  struct d3d8_pixel_shader *shader_impl;
2884 
2885  TRACE("iface %p, shader %#x.\n", iface, shader);
2886 
2888 
2889  if (!(shader_impl = d3d8_free_handle(&device->handle_table, shader - (VS_HIGHESTFIXEDFXF + 1), D3D8_HANDLE_PS)))
2890  {
2891  WARN("Invalid handle (%#x) passed.\n", shader);
2893  return D3DERR_INVALIDCALL;
2894  }
2895 
2896  if (wined3d_device_get_pixel_shader(device->wined3d_device) == shader_impl->wined3d_shader)
2898 
2900 
2901  d3d8_pixel_shader_destroy(shader_impl);
2902 
2903  return D3D_OK;
2904 }
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
Definition: devices.h:37
void d3d8_pixel_shader_destroy(struct d3d8_pixel_shader *shader) DECLSPEC_HIDDEN
Definition: shader.c:148
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
struct wined3d_shader * wined3d_shader
Definition: d3d8_private.h:267
static void * d3d8_free_handle(struct d3d8_handle_table *t, DWORD handle, enum d3d8_handle_type type)
Definition: device.c:404
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define D3D_OK
Definition: d3d.h:106
#define VS_HIGHESTFIXEDFXF
Definition: d3d8_private.h:43
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
#define IDirect3DDevice8_SetPixelShader(p, a)
Definition: d3d8.h:1035
struct wined3d_shader *CDECL wined3d_device_get_pixel_shader(const struct wined3d_device *device)
Definition: device.c:2530

◆ d3d8_device_DeleteStateBlock()

static HRESULT WINAPI d3d8_device_DeleteStateBlock ( IDirect3DDevice8 *  iface,
DWORD  token 
)
static

Definition at line 1828 of file device.c.

1829 {
1831  struct wined3d_stateblock *stateblock;
1832 
1833  TRACE("iface %p, token %#x.\n", iface, token);
1834 
1836  stateblock = d3d8_free_handle(&device->handle_table, token - 1, D3D8_HANDLE_SB);
1837 
1838  if (!stateblock)
1839  {
1840  WARN("Invalid handle (%#x) passed.\n", token);
1842  return D3DERR_INVALIDCALL;
1843  }
1844 
1845  if (wined3d_stateblock_decref(stateblock))
1846  {
1847  ERR("Stateblock %p has references left, this shouldn't happen.\n", stateblock);
1848  }
1850 
1851  return D3D_OK;
1852 }
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
Definition: devices.h:37
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 token
Definition: glfuncs.h:210
#define TRACE(s)
Definition: solgame.cpp:4
ULONG CDECL wined3d_stateblock_decref(struct wined3d_stateblock *stateblock)
Definition: stateblock.c:552
static void * d3d8_free_handle(struct d3d8_handle_table *t, DWORD handle, enum d3d8_handle_type type)
Definition: device.c:404
#define ERR(fmt,...)
Definition: debug.h:109
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define D3D_OK
Definition: d3d.h:106
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_DeleteVertexShader()

static HRESULT WINAPI d3d8_device_DeleteVertexShader ( IDirect3DDevice8 *  iface,
DWORD  shader 
)
static

Definition at line 2578 of file device.c.

2579 {
2581  struct d3d8_vertex_shader *shader_impl;
2582 
2583  TRACE("iface %p, shader %#x.\n", iface, shader);
2584 
2586  if (!(shader_impl = d3d8_free_handle(&device->handle_table, shader - (VS_HIGHESTFIXEDFXF + 1), D3D8_HANDLE_VS)))
2587  {
2588  WARN("Invalid handle (%#x) passed.\n", shader);
2590 
2591  return D3DERR_INVALIDCALL;
2592  }
2593 
2594  if (shader_impl->wined3d_shader
2595  && wined3d_device_get_vertex_shader(device->wined3d_device) == shader_impl->wined3d_shader)
2597 
2599 
2600  d3d8_vertex_shader_destroy(shader_impl);
2601 
2602  return D3D_OK;
2603 }
#define IDirect3DDevice8_SetVertexShader(p, a)
Definition: d3d8.h:1023
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
void d3d8_vertex_shader_destroy(struct d3d8_vertex_shader *shader) DECLSPEC_HIDDEN
Definition: shader.c:32
Definition: devices.h:37
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
struct wined3d_shader * wined3d_shader
Definition: d3d8_private.h:255
static void * d3d8_free_handle(struct d3d8_handle_table *t, DWORD handle, enum d3d8_handle_type type)
Definition: device.c:404
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define D3D_OK
Definition: d3d.h:106
struct wined3d_shader *CDECL wined3d_device_get_vertex_shader(const struct wined3d_device *device)
Definition: device.c:2207
#define VS_HIGHESTFIXEDFXF
Definition: d3d8_private.h:43
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_DrawIndexedPrimitive()

static HRESULT WINAPI d3d8_device_DrawIndexedPrimitive ( IDirect3DDevice8 *  iface,
D3DPRIMITIVETYPE  primitive_type,
UINT  min_vertex_idx,
UINT  vertex_count,
UINT  start_idx,
UINT  primitive_count 
)
static

Definition at line 2139 of file device.c.

2142 {
2144  HRESULT hr;
2145 
2146  TRACE("iface %p, primitive_type %#x, min_vertex_idx %u, vertex_count %u, start_idx %u, primitive_count %u.\n",
2147  iface, primitive_type, min_vertex_idx, vertex_count, start_idx, primitive_count);
2148 
2150  wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0);
2151  hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, start_idx,
2152  vertex_count_from_primitive_count(primitive_type, primitive_count));
2154 
2155  return hr;
2156 }
HRESULT hr
Definition: shlfolder.c:183
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_primitive_type(struct wined3d_device *device, enum wined3d_primitive_type primitive_type, unsigned int patch_vertex_count)
Definition: device.c:3717
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
int vertex_count
Definition: d3drm.c:2807
static UINT vertex_count_from_primitive_count(D3DPRIMITIVETYPE primitive_type, UINT primitive_count)
Definition: device.c:167
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_DrawIndexedPrimitiveUP()

static HRESULT WINAPI d3d8_device_DrawIndexedPrimitiveUP ( IDirect3DDevice8 *  iface,
D3DPRIMITIVETYPE  primitive_type,
UINT  min_vertex_idx,
UINT  vertex_count,
UINT  primitive_count,
const void index_data,
D3DFORMAT  index_format,
const void vertex_data,
UINT  vertex_stride 
)
static

Definition at line 2290 of file device.c.

2294 {
2295  UINT idx_count = vertex_count_from_primitive_count(primitive_type, primitive_count);
2297  UINT idx_fmt_size = index_format == D3DFMT_INDEX16 ? 2 : 4;
2298  UINT vtx_size = vertex_count * vertex_stride;
2299  UINT idx_size = idx_count * idx_fmt_size;
2301  struct wined3d_box wined3d_box = {0};
2302  struct wined3d_resource *ib, *vb;
2303  UINT vb_pos, ib_pos, align;
2304  HRESULT hr;
2305 
2306  TRACE("iface %p, primitive_type %#x, min_vertex_idx %u, vertex_count %u, primitive_count %u, "
2307  "index_data %p, index_format %#x, vertex_data %p, vertex_stride %u.\n",
2308  iface, primitive_type, min_vertex_idx, vertex_count, primitive_count,
2309  index_data, index_format, vertex_data, vertex_stride);
2310 
2311  if (!primitive_count)
2312  {
2313  WARN("primitive_count is 0, returning D3D_OK\n");
2314  return D3D_OK;
2315  }
2316 
2318 
2320  if (FAILED(hr))
2321  goto done;
2322 
2323  vb_pos = device->vertex_buffer_pos;
2324  align = vb_pos % vertex_stride;
2325  if (align) align = vertex_stride - align;
2326  if (vb_pos + vtx_size + align > device->vertex_buffer_size)
2327  vb_pos = 0;
2328  else
2329  vb_pos += align;
2330 
2331  wined3d_box.left = vb_pos;
2332  wined3d_box.right = vb_pos + vtx_size;
2333  vb = wined3d_buffer_get_resource(device->vertex_buffer);
2336  goto done;
2337  memcpy(wined3d_map_desc.data, (char *)vertex_data + min_vertex_idx * vertex_stride, vtx_size);
2338  wined3d_resource_unmap(vb, 0);
2339  device->vertex_buffer_pos = vb_pos + vtx_size;
2340 
2342  if (FAILED(hr))
2343  goto done;
2344 
2345  ib_pos = device->index_buffer_pos;
2346  align = ib_pos % idx_fmt_size;
2347  if (align) align = idx_fmt_size - align;
2348  if (ib_pos + idx_size + align > device->index_buffer_size)
2349  ib_pos = 0;
2350  else
2351  ib_pos += align;
2352 
2353  wined3d_box.left = ib_pos;
2354  wined3d_box.right = ib_pos + idx_size;
2355  ib = wined3d_buffer_get_resource(device->index_buffer);
2358  goto done;
2359  memcpy(wined3d_map_desc.data, index_data, idx_size);
2360  wined3d_resource_unmap(ib, 0);
2361  device->index_buffer_pos = ib_pos + idx_size;
2362 
2363  hr = wined3d_device_set_stream_source(device->wined3d_device, 0, device->vertex_buffer, 0, vertex_stride);
2364  if (FAILED(hr))
2365  goto done;
2366 
2367  wined3d_device_set_index_buffer(device->wined3d_device, device->index_buffer,
2368  wined3dformat_from_d3dformat(index_format), 0);
2369  wined3d_device_set_base_vertex_index(device->wined3d_device, vb_pos / vertex_stride - min_vertex_idx);
2370 
2371  wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0);
2372  hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / idx_fmt_size, idx_count);
2373 
2374  wined3d_device_set_stream_source(device->wined3d_device, 0, NULL, 0, 0);
2376  wined3d_device_set_base_vertex_index(device->wined3d_device, 0);
2377 
2378 done:
2380  return hr;
2381 }
UINT left
Definition: wined3d.h:1839
HRESULT hr
Definition: shlfolder.c:183
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_primitive_type(struct wined3d_device *device, enum wined3d_primitive_type primitive_type, unsigned int patch_vertex_count)
Definition: device.c:3717
HRESULT CDECL wined3d_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx)
Definition: resource.c:382
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
enum wined3d_format_id wined3dformat_from_d3dformat(D3DFORMAT format)
Definition: device.c:94
int align(int length, int align)
Definition: dsound8.c:36
int vertex_count
Definition: d3drm.c:2807
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
static UINT vertex_count_from_primitive_count(D3DPRIMITIVETYPE primitive_type, UINT primitive_count)
Definition: device.c:167
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
Definition: devices.h:37
static HRESULT d3d8_device_prepare_index_buffer(struct d3d8_device *device, UINT min_size)
Definition: device.c:2254
smooth NULL
Definition: ftsmooth.c:416
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
UINT right
Definition: wined3d.h:1841
#define WINED3D_MAP_DISCARD
Definition: wined3d.h:935
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define WINED3D_MAP_WRITE
Definition: wined3d.h:938
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
void CDECL wined3d_device_set_base_vertex_index(struct wined3d_device *device, INT base_index)
Definition: device.c:1917
#define WINED3D_MAP_NOOVERWRITE
Definition: wined3d.h:934
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define D3D_OK
Definition: d3d.h:106
struct wined3d_resource *CDECL wined3d_buffer_get_resource(struct wined3d_buffer *buffer)
Definition: buffer.c:995
unsigned int UINT
Definition: ndis.h:50
static HRESULT d3d8_device_prepare_vertex_buffer(struct d3d8_device *device, UINT min_size)
Definition: device.c:2159
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_DrawPrimitive()

static HRESULT WINAPI d3d8_device_DrawPrimitive ( IDirect3DDevice8 *  iface,
D3DPRIMITIVETYPE  primitive_type,
UINT  start_vertex,
UINT  primitive_count 
)
static

Definition at line 2121 of file device.c.

2123 {
2125  HRESULT hr;
2126 
2127  TRACE("iface %p, primitive_type %#x, start_vertex %u, primitive_count %u.\n",
2128  iface, primitive_type, start_vertex, primitive_count);
2129 
2131  wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0);
2132  hr = wined3d_device_draw_primitive(device->wined3d_device, start_vertex,
2133  vertex_count_from_primitive_count(primitive_type, primitive_count));
2135 
2136  return hr;
2137 }
HRESULT hr
Definition: shlfolder.c:183
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
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
static UINT vertex_count_from_primitive_count(D3DPRIMITIVETYPE primitive_type, UINT primitive_count)
Definition: device.c:167
Definition: devices.h:37
HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT start_vertex, UINT vertex_count)
Definition: device.c:3740
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_DrawPrimitiveUP()

static HRESULT WINAPI d3d8_device_DrawPrimitiveUP ( IDirect3DDevice8 *  iface,
D3DPRIMITIVETYPE  primitive_type,
UINT  primitive_count,
const void data,
UINT  stride 
)
static

Definition at line 2195 of file device.c.

2198 {
2200  HRESULT hr;
2201  UINT vtx_count = vertex_count_from_primitive_count(primitive_type, primitive_count);
2203  struct wined3d_box wined3d_box = {0};
2204  UINT size = vtx_count * stride;
2205  struct wined3d_resource *vb;
2206  UINT vb_pos, align;
2207 
2208  TRACE("iface %p, primitive_type %#x, primitive_count %u, data %p, stride %u.\n",
2209  iface, primitive_type, primitive_count, data, stride);
2210 
2211  if (!primitive_count)
2212  {
2213  WARN("primitive_count is 0, returning D3D_OK\n");
2214  return D3D_OK;
2215  }
2216 
2219  if (FAILED(hr))
2220  goto done;
2221 
2222  vb_pos = device->vertex_buffer_pos;
2223  align = vb_pos % stride;
2224  if (align) align = stride - align;
2225  if (vb_pos + size + align > device->vertex_buffer_size)
2226  vb_pos = 0;
2227  else
2228  vb_pos += align;
2229 
2230  wined3d_box.left = vb_pos;
2231  wined3d_box.right = vb_pos + size;
2232  vb = wined3d_buffer_get_resource(device->vertex_buffer);
2235  goto done;
2237  wined3d_resource_unmap(vb, 0);
2238  device->vertex_buffer_pos = vb_pos + size;
2239 
2240  hr = wined3d_device_set_stream_source(device->wined3d_device, 0, device->vertex_buffer, 0, stride);
2241  if (FAILED(hr))
2242  goto done;
2243 
2244  wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0);
2245  hr = wined3d_device_draw_primitive(device->wined3d_device, vb_pos / stride, vtx_count);
2246  wined3d_device_set_stream_source(device->wined3d_device, 0, NULL, 0, 0);
2247 
2248 done:
2250  return hr;
2251 }
UINT left
Definition: wined3d.h:1839
HRESULT hr
Definition: shlfolder.c:183
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_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx)
Definition: resource.c:382
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
int align(int length, int align)
Definition: dsound8.c:36
static UINT vertex_count_from_primitive_count(D3DPRIMITIVETYPE primitive_type, UINT primitive_count)
Definition: device.c:167
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
Definition: devices.h:37
HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT start_vertex, UINT vertex_count)
Definition: device.c:3740
smooth NULL
Definition: ftsmooth.c:416
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
UINT right
Definition: wined3d.h:1841
#define WINED3D_MAP_DISCARD
Definition: wined3d.h:935
#define TRACE(s)
Definition: solgame.cpp:4
GLsizei stride
Definition: glext.h:5848
GLsizeiptr size
Definition: glext.h:5919
LONG HRESULT
Definition: typedefs.h:77
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define WINED3D_MAP_WRITE
Definition: wined3d.h:938
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define WINED3D_MAP_NOOVERWRITE
Definition: wined3d.h:934
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define D3D_OK
Definition: d3d.h:106
struct wined3d_resource *CDECL wined3d_buffer_get_resource(struct wined3d_buffer *buffer)
Definition: buffer.c:995
unsigned int UINT
Definition: ndis.h:50
static HRESULT d3d8_device_prepare_vertex_buffer(struct d3d8_device *device, UINT min_size)
Definition: device.c:2159
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_DrawRectPatch()

static HRESULT WINAPI d3d8_device_DrawRectPatch ( IDirect3DDevice8 *  iface,
UINT  handle,
const float *  segment_count,
const D3DRECTPATCH_INFO patch_info 
)
static

Definition at line 2963 of file device.c.

2965 {
2966  FIXME("iface %p, handle %#x, segment_count %p, patch_info %p unimplemented.\n",
2967  iface, handle, segment_count, patch_info);
2968  return D3D_OK;
2969 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define D3D_OK
Definition: d3d.h:106

◆ d3d8_device_DrawTriPatch()

static HRESULT WINAPI d3d8_device_DrawTriPatch ( IDirect3DDevice8 *  iface,
UINT  handle,
const float *  segment_count,
const D3DTRIPATCH_INFO patch_info 
)
static

Definition at line 2971 of file device.c.

2973 {
2974  FIXME("iface %p, handle %#x, segment_count %p, patch_info %p unimplemented.\n",
2975  iface, handle, segment_count, patch_info);
2976  return D3D_OK;
2977 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define D3D_OK
Definition: d3d.h:106

◆ d3d8_device_EndScene()

static HRESULT WINAPI DECLSPEC_HOTPATCH d3d8_device_EndScene ( IDirect3DDevice8 *  iface)
static

Definition at line 1443 of file device.c.

1444 {
1446  HRESULT hr;
1447 
1448  TRACE("iface %p.\n", iface);
1449 
1451  hr = wined3d_device_end_scene(device->wined3d_device);
1453 
1454  return hr;
1455 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device)
Definition: device.c:3617

◆ d3d8_device_EndStateBlock()

static HRESULT WINAPI d3d8_device_EndStateBlock ( IDirect3DDevice8 *  iface,
DWORD token 
)
static

Definition at line 1745 of file device.c.

1746 {
1748  struct wined3d_stateblock *stateblock;
1749  HRESULT hr;
1750 
1751  TRACE("iface %p, token %p.\n", iface, token);
1752 
1753  /* Tell wineD3D to endstateblock before anything else (in case we run out
1754  * of memory later and cause locking problems)
1755  */
1757  hr = wined3d_device_end_stateblock(device->wined3d_device, &stateblock);
1758  if (FAILED(hr))
1759  {
1760  WARN("Failed to end the state block, %#x.\n", hr);
1762  return hr;
1763  }
1764 
1765  *token = d3d8_allocate_handle(&device->handle_table, stateblock, D3D8_HANDLE_SB);
1767 
1768  if (*token == D3D8_INVALID_HANDLE)
1769  {
1770  ERR("Failed to create a handle\n");
1772  wined3d_stateblock_decref(stateblock);
1774  return E_FAIL;
1775  }
1776  ++*token;
1777 
1778  TRACE("Returning %#x (%p).\n", *token, stateblock);
1779 
1780  return hr;
1781 }
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
HRESULT CDECL wined3d_device_end_stateblock(struct wined3d_device *device, struct wined3d_stateblock **stateblock)
Definition: device.c:3577
#define E_FAIL
Definition: ddrawi.h:102
Definition: devices.h:37
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 token
Definition: glfuncs.h:210
static DWORD d3d8_allocate_handle(struct d3d8_handle_table *t, void *object, enum d3d8_handle_type type)
Definition: device.c:361
#define TRACE(s)
Definition: solgame.cpp:4
ULONG CDECL wined3d_stateblock_decref(struct wined3d_stateblock *stateblock)
Definition: stateblock.c:552
LONG HRESULT
Definition: typedefs.h:77
#define ERR(fmt,...)
Definition: debug.h:109
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define D3D8_INVALID_HANDLE
Definition: d3d8_private.h:61
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_get_fvf_declaration()

static struct d3d8_vertex_declaration* d3d8_device_get_fvf_declaration ( struct d3d8_device device,
DWORD  fvf 
)
static

Definition at line 2450 of file device.c.

2451 {
2452  struct d3d8_vertex_declaration *d3d8_declaration;
2453  struct FvfToDecl *convertedDecls = device->decls;
2454  int p, low, high; /* deliberately signed */
2455  HRESULT hr;
2456 
2457  TRACE("Searching for declaration for fvf %08x... ", fvf);
2458 
2459  low = 0;
2460  high = device->numConvertedDecls - 1;
2461  while (low <= high)
2462  {
2463  p = (low + high) >> 1;
2464  TRACE("%d ", p);
2465 
2466  if (convertedDecls[p].fvf == fvf)
2467  {
2468  TRACE("found %p\n", convertedDecls[p].declaration);
2469  return convertedDecls[p].declaration;
2470  }
2471 
2472  if (convertedDecls[p].fvf < fvf)
2473  low = p + 1;
2474  else
2475  high = p - 1;
2476  }
2477  TRACE("not found. Creating and inserting at position %d.\n", low);
2478 
2479  if (!(d3d8_declaration = heap_alloc(sizeof(*d3d8_declaration))))
2480  return NULL;
2481 
2482  if (FAILED(hr = d3d8_vertex_declaration_init_fvf(d3d8_declaration, device, fvf)))
2483  {
2484  WARN("Failed to initialize vertex declaration, hr %#x.\n", hr);
2485  heap_free(d3d8_declaration);
2486  return NULL;
2487  }
2488 
2489  if (device->declArraySize == device->numConvertedDecls)
2490  {
2491  UINT grow = device->declArraySize / 2;
2492 
2493  if (!(convertedDecls = heap_realloc(convertedDecls,
2494  sizeof(*convertedDecls) * (device->numConvertedDecls + grow))))
2495  {
2496  d3d8_vertex_declaration_destroy(d3d8_declaration);
2497  return NULL;
2498  }
2499  device->decls = convertedDecls;
2500  device->declArraySize += grow;
2501  }
2502 
2503  memmove(convertedDecls + low + 1, convertedDecls + low,
2504  sizeof(*convertedDecls) * (device->numConvertedDecls - low));
2505  convertedDecls[low].declaration = d3d8_declaration;
2506  convertedDecls[low].fvf = fvf;
2507  ++device->numConvertedDecls;
2508 
2509  TRACE("Returning %p. %u decls in array.\n", d3d8_declaration, device->numConvertedDecls);
2510 
2511  return d3d8_declaration;
2512 }
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
HRESULT d3d8_vertex_declaration_init_fvf(struct d3d8_vertex_declaration *declaration, struct d3d8_device *device, DWORD fvf) DECLSPEC_HIDDEN
void d3d8_vertex_declaration_destroy(struct d3d8_vertex_declaration *declaration) DECLSPEC_HIDDEN
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:70
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
unsigned int UINT
Definition: ndis.h:50
struct d3d8_vertex_declaration * declaration
Definition: d3d8_private.h:88
GLfloat GLfloat p
Definition: glext.h:8902
DWORD fvf
Definition: d3d8_private.h:87
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by d3d8_device_SetVertexShader().

◆ d3d8_device_GetAvailableTextureMem()

static UINT WINAPI d3d8_device_GetAvailableTextureMem ( IDirect3DDevice8 *  iface)
static

Definition at line 546 of file device.c.

547 {
549  UINT ret;
550 
551  TRACE("iface %p.\n", iface);
552 
556 
557  return ret;
558 }
UINT CDECL wined3d_device_get_available_texture_mem(const struct wined3d_device *device)
Definition: device.c:1298
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
int ret
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
unsigned int UINT
Definition: ndis.h:50
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_GetBackBuffer()

static HRESULT WINAPI d3d8_device_GetBackBuffer ( IDirect3DDevice8 *  iface,
UINT  backbuffer_idx,
D3DBACKBUFFER_TYPE  backbuffer_type,
IDirect3DSurface8 **  backbuffer 
)
static

Definition at line 840 of file device.c.

842 {
846  struct d3d8_surface *surface_impl;
847 
848  TRACE("iface %p, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.\n",
849  iface, backbuffer_idx, backbuffer_type, backbuffer);
850 
851  /* backbuffer_type is ignored by native. */
852 
853  /* No need to check for backbuffer == NULL, Windows crashes in that case. */
855 
856  wined3d_swapchain = device->implicit_swapchain->wined3d_swapchain;
858  {
860  *backbuffer = NULL;
861  return D3DERR_INVALIDCALL;
862  }
863 
865  *backbuffer = &surface_impl->IDirect3DSurface8_iface;
866  IDirect3DSurface8_AddRef(*backbuffer);
867 
869  return D3D_OK;
870 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
#define IDirect3DSurface8_AddRef(p)
Definition: d3d8.h:309
IDirect3DSurface8 IDirect3DSurface8_iface
Definition: d3d8_private.h:176
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
void *CDECL wined3d_texture_get_sub_resource_parent(struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: texture.c:3449
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define D3D_OK
Definition: d3d.h:106
struct wined3d_texture *CDECL wined3d_swapchain_get_back_buffer(const struct wined3d_swapchain *swapchain, UINT back_buffer_idx)
Definition: swapchain.c:215
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_GetClipPlane()

static HRESULT WINAPI d3d8_device_GetClipPlane ( IDirect3DDevice8 *  iface,
DWORD  index,
float *  plane 
)
static

Definition at line 1673 of file device.c.

1674 {
1676  HRESULT hr;
1677 
1678  TRACE("iface %p, index %u, plane %p.\n", iface, index, plane);
1679 
1681  hr = wined3d_device_get_clip_plane(device->wined3d_device, index, (struct wined3d_vec4 *)plane);
1683 
1684  return hr;
1685 }
HRESULT CDECL wined3d_device_get_clip_plane(const struct wined3d_device *device, UINT plane_idx, struct wined3d_vec4 *plane)
Definition: device.c:1811
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
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
Definition: devices.h:37
GLuint index
Definition: glext.h:6031
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_GetClipStatus()

static HRESULT WINAPI d3d8_device_GetClipStatus ( IDirect3DDevice8 *  iface,
D3DCLIPSTATUS8 clip_status 
)
static

Definition at line 1913 of file device.c.

1914 {
1916  HRESULT hr;
1917 
1918  TRACE("iface %p, clip_status %p.\n", iface, clip_status);
1919 
1921  hr = wined3d_device_get_clip_status(device->wined3d_device, (struct wined3d_clip_status *)clip_status);
1923 
1924  return hr;
1925 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
Definition: devices.h:37
HRESULT CDECL wined3d_device_get_clip_status(const struct wined3d_device *device, struct wined3d_clip_status *clip_status)
Definition: device.c:1838
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_GetCreationParameters()

static HRESULT WINAPI d3d8_device_GetCreationParameters ( IDirect3DDevice8 *  iface,
D3DDEVICE_CREATION_PARAMETERS parameters 
)
static

Definition at line 631 of file device.c.

633 {
635 
636  TRACE("iface %p, parameters %p.\n", iface, parameters);
637 
640  (struct wined3d_device_creation_parameters *)parameters);
642 
643  return D3D_OK;
644 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
void CDECL wined3d_device_get_creation_parameters(const struct wined3d_device *device, struct wined3d_device_creation_parameters *parameters)
Definition: device.c:5042
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define D3D_OK
Definition: d3d.h:106
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_GetCurrentTexturePalette()

static HRESULT WINAPI d3d8_device_GetCurrentTexturePalette ( IDirect3DDevice8 *  iface,
UINT palette_idx 
)
static

Definition at line 2114 of file device.c.

2115 {
2116  FIXME("iface %p, palette_idx %p unimplemented.\n", iface, palette_idx);
2117 
2118  return D3DERR_INVALIDCALL;
2119 }
#define D3DERR_INVALIDCALL
#define FIXME(fmt,...)
Definition: debug.h:110

◆ d3d8_device_GetDepthStencilSurface()

static HRESULT WINAPI d3d8_device_GetDepthStencilSurface ( IDirect3DDevice8 *  iface,
IDirect3DSurface8 **  depth_stencil 
)
static

Definition at line 1398 of file device.c.

1399 {
1401  struct wined3d_rendertarget_view *wined3d_dsv;
1402  struct d3d8_surface *surface_impl;
1403  HRESULT hr = D3D_OK;
1404 
1405  TRACE("iface %p, depth_stencil %p.\n", iface, depth_stencil);
1406 
1407  if (!depth_stencil)
1408  return D3DERR_INVALIDCALL;
1409 
1411  if ((wined3d_dsv = wined3d_device_get_depth_stencil_view(device->wined3d_device)))
1412  {
1413  /* We want the sub resource parent here, since the view itself may be
1414  * internal to wined3d and may not have a parent. */
1415  surface_impl = wined3d_rendertarget_view_get_sub_resource_parent(wined3d_dsv);
1416  *depth_stencil = &surface_impl->IDirect3DSurface8_iface;
1417  IDirect3DSurface8_AddRef(*depth_stencil);
1418  }
1419  else
1420  {
1421  hr = D3DERR_NOTFOUND;
1422  *depth_stencil = NULL;
1423  }
1425 
1426  return hr;
1427 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
struct wined3d_rendertarget_view *CDECL wined3d_device_get_depth_stencil_view(const struct wined3d_device *device)
Definition: device.c:4461
#define D3DERR_NOTFOUND
Definition: d3d8.h:80
#define IDirect3DSurface8_AddRef(p)
Definition: d3d8.h:309
IDirect3DSurface8 IDirect3DSurface8_iface
Definition: d3d8_private.h:176
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
void *CDECL wined3d_rendertarget_view_get_sub_resource_parent(const struct wined3d_rendertarget_view *view)
Definition: view.c:376
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define D3D_OK
Definition: d3d.h:106
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_GetDeviceCaps()

static HRESULT WINAPI d3d8_device_GetDeviceCaps ( IDirect3DDevice8 *  iface,
D3DCAPS8 caps 
)
static

Definition at line 588 of file device.c.

589 {
591  WINED3DCAPS wined3d_caps;
592  HRESULT hr;
593 
594  TRACE("iface %p, caps %p.\n", iface, caps);
595 
596  if (!caps)
597  return D3DERR_INVALIDCALL;
598 
600  hr = wined3d_device_get_device_caps(device->wined3d_device, &wined3d_caps);
602 
603  d3dcaps_from_wined3dcaps(caps, &wined3d_caps);
604 
605  return hr;
606 }
HRESULT hr
Definition: shlfolder.c:183
HRESULT CDECL wined3d_device_get_device_caps(const struct wined3d_device *device, WINED3DCAPS *caps)
Definition: device.c:3526
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
void d3dcaps_from_wined3dcaps(D3DCAPS8 *caps, const WINED3DCAPS *wined3d_caps)
Definition: device.c:290
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_GetDirect3D()

static HRESULT WINAPI d3d8_device_GetDirect3D ( IDirect3DDevice8 *  iface,
IDirect3D8 **  d3d8 
)
static

Definition at line 576 of file device.c.

577 {
579 
580  TRACE("iface %p, d3d8 %p.\n", iface, d3d8);
581 
582  if (!d3d8)
583  return D3DERR_INVALIDCALL;
584 
585  return IDirect3D8_QueryInterface(device->d3d_parent, &IID_IDirect3D8, (void **)d3d8);
586 }
#define D3DERR_INVALIDCALL
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
#define IDirect3D8_QueryInterface(p, a, b)
Definition: d3d8.h:159
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132

◆ d3d8_device_GetDisplayMode()

static HRESULT WINAPI d3d8_device_GetDisplayMode ( IDirect3DDevice8 *  iface,
D3DDISPLAYMODE mode 
)
static

Definition at line 608 of file device.c.

609 {
611  struct wined3d_display_mode wined3d_mode;
612  HRESULT hr;
613 
614  TRACE("iface %p, mode %p.\n", iface, mode);
615 
617  hr = wined3d_device_get_display_mode(device->wined3d_device, 0, &wined3d_mode, NULL);
619 
620  if (SUCCEEDED(hr))
621  {
622  mode->Width = wined3d_mode.width;
623  mode->Height = wined3d_mode.height;
624  mode->RefreshRate = wined3d_mode.refresh_rate;
625  mode->Format = d3dformat_from_wined3dformat(wined3d_mode.format_id);
626  }
627 
628  return hr;
629 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
HRESULT CDECL wined3d_device_get_display_mode(const struct wined3d_device *device, UINT swapchain_idx, struct wined3d_display_mode *mode, enum wined3d_display_rotation *rotation)
Definition: device.c:3541
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
GLenum mode
Definition: glext.h:6217
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
D3DFORMAT d3dformat_from_wined3dformat(enum wined3d_format_id format)
Definition: device.c:44
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ d3d8_device_GetFrontBuffer()

static HRESULT WINAPI d3d8_device_GetFrontBuffer ( IDirect3DDevice8 *  iface,
IDirect3DSurface8 *  dst_surface 
)
static

Definition at line 1271 of file device.c.

1272 {
1274  struct d3d8_surface *dst_impl = unsafe_impl_from_IDirect3DSurface8(dst_surface);
1275  HRESULT hr;
1276 
1277  TRACE("iface %p, dst_surface %p.\n", iface, dst_surface);
1278 
1279  if (!dst_surface)
1280  {
1281  WARN("Invalid destination surface passed.\n");
1282  return D3DERR_INVALIDCALL;
1283  }
1284 
1286  hr = wined3d_swapchain_get_front_buffer_data(device->implicit_swapchain->wined3d_swapchain,
1287  dst_impl->wined3d_texture, dst_impl->sub_resource_idx);
1289 
1290  return hr;
1291 }
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
Definition: devices.h:37
unsigned int sub_resource_idx
Definition: d3d8_private.h:179
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
struct wined3d_texture * wined3d_texture
Definition: d3d8_private.h:178
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
struct d3d8_surface * unsafe_impl_from_IDirect3DSurface8(IDirect3DSurface8 *iface) DECLSPEC_HIDDEN
Definition: surface.c:402
HRESULT CDECL wined3d_swapchain_get_front_buffer_data(const struct wined3d_swapchain *swapchain, struct wined3d_texture *dst_texture, unsigned int sub_resource_idx)
Definition: swapchain.c:194
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_GetGammaRamp()

static void WINAPI d3d8_device_GetGammaRamp ( IDirect3DDevice8 *  iface,
D3DGAMMARAMP ramp 
)
static

Definition at line 898 of file device.c.

899 {
901 
902  TRACE("iface %p, ramp %p.\n", iface, ramp);
903 
904  /* Note: D3DGAMMARAMP is compatible with struct wined3d_gamma_ramp. */
906  wined3d_device_get_gamma_ramp(device->wined3d_device, 0, (struct wined3d_gamma_ramp *)ramp);
908 }
void CDECL wined3d_device_get_gamma_ramp(const struct wined3d_device *device, UINT swapchain_idx, struct wined3d_gamma_ramp *ramp)
Definition: device.c:5069
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
static const BYTE ramp[17]
Definition: dib.c:2709
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_GetIndices()

static HRESULT WINAPI d3d8_device_GetIndices ( IDirect3DDevice8 *  iface,
IDirect3DIndexBuffer8 **  buffer,
UINT base_vertex_index 
)
static

Definition at line 2744 of file device.c.

2746 {
2750  struct d3d8_indexbuffer *buffer_impl;
2751 
2752  TRACE("iface %p, buffer %p, base_vertex_index %p.\n", iface, buffer, base_vertex_index);
2753 
2754  if (!buffer)
2755  return D3DERR_INVALIDCALL;
2756 
2757  /* The case from UINT to INT is safe because d3d8 will never set negative values */
2759  *base_vertex_index = wined3d_device_get_base_vertex_index(device->wined3d_device);
2761  {
2763  *buffer = &buffer_impl->IDirect3DIndexBuffer8_iface;
2765  }
2766  else
2767  {
2768  *buffer = NULL;
2769  }
2771 
2772  return D3D_OK;
2773 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
GLuint buffer
Definition: glext.h:5915
IDirect3DIndexBuffer8 IDirect3DIndexBuffer8_iface
Definition: d3d8_private.h:210
void *CDECL wined3d_buffer_get_parent(const struct wined3d_buffer *buffer)
Definition: buffer.c:807
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
struct wined3d_buffer *CDECL wined3d_device_get_index_buffer(const struct wined3d_device *device, enum wined3d_format_id *format, unsigned int *offset)
Definition: device.c:1906
wined3d_format_id
Definition: wined3d.h:105
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define D3D_OK
Definition: d3d.h:106
#define IDirect3DIndexBuffer8_AddRef(p)
Definition: d3d8.h:481
INT CDECL wined3d_device_get_base_vertex_index(const struct wined3d_device *device)
Definition: device.c:1924
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_GetInfo()

static HRESULT WINAPI d3d8_device_GetInfo ( IDirect3DDevice8 *  iface,
DWORD  info_id,
void info,
DWORD  info_size 
)
static

Definition at line 2080 of file device.c.

2082 {
2083  FIXME("iface %p, info_id %#x, info %p, info_size %u stub!\n", iface, info_id, info, info_size);
2084 
2085  return D3D_OK;
2086 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define D3D_OK
Definition: d3d.h:106

◆ d3d8_device_GetLight()

static HRESULT WINAPI d3d8_device_GetLight ( IDirect3DDevice8 *  iface,
DWORD  index,
D3DLIGHT8 light 
)
static

Definition at line 1616 of file device.c.

1617 {
1619  HRESULT hr;
1620 
1621  TRACE("iface %p, index %u, light %p.\n", iface, index, light);
1622 
1623  /* Note: D3DLIGHT8 is compatible with struct wined3d_light. */
1625  hr = wined3d_device_get_light(device->wined3d_device, index, (struct wined3d_light *)light);
1627 
1628  return hr;
1629 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
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
Definition: devices.h:37
GLuint index
Definition: glext.h:6031
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
HRESULT CDECL wined3d_device_get_light(const struct wined3d_device *device, UINT light_idx, struct wined3d_light *light)
Definition: device.c:1724
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_GetLightEnable()

static HRESULT WINAPI d3d8_device_GetLightEnable ( IDirect3DDevice8 *  iface,
DWORD  index,
BOOL enable 
)
static

Definition at line 1645 of file device.c.

1646 {
1648  HRESULT hr;
1649 
1650  TRACE("iface %p, index %u, enable %p.\n", iface, index, enable);
1651 
1653  hr = wined3d_device_get_light_enable(device->wined3d_device, index, enable);
1655 
1656  return hr;
1657 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
Definition: devices.h:37
GLuint index
Definition: glext.h:6031
HRESULT CDECL wined3d_device_get_light_enable(const struct wined3d_device *device, UINT light_idx, BOOL *enable)
Definition: device.c:1767
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
GLboolean enable
Definition: glext.h:11120
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_GetMaterial()

static HRESULT WINAPI d3d8_device_GetMaterial ( IDirect3DDevice8 *  iface,
D3DMATERIAL8 material 
)
static

Definition at line 1587 of file device.c.

1588 {
1590 
1591  TRACE("iface %p, material %p.\n", iface, material);
1592 
1593  /* Note: D3DMATERIAL8 is compatible with struct wined3d_material. */
1595  wined3d_device_get_material(device->wined3d_device, (struct wined3d_material *)material);
1597 
1598  return D3D_OK;
1599 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define D3D_OK
Definition: d3d.h:106
void CDECL wined3d_device_get_material(const struct wined3d_device *device, struct wined3d_material *material)
Definition: device.c:1861
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_GetPaletteEntries()

static HRESULT WINAPI d3d8_device_GetPaletteEntries ( IDirect3DDevice8 *  iface,
UINT  palette_idx,
PALETTEENTRY entries 
)
static

Definition at line 2099 of file device.c.

2101 {
2102  FIXME("iface %p, palette_idx %u, entries %p unimplemented.\n", iface, palette_idx, entries);
2103 
2104  return D3DERR_INVALIDCALL;
2105 }
#define D3DERR_INVALIDCALL
#define FIXME(fmt,...)
Definition: debug.h:110

◆ d3d8_device_GetPixelShader()

static HRESULT WINAPI d3d8_device_GetPixelShader ( IDirect3DDevice8 *  iface,
DWORD shader 
)
static

Definition at line 2852 of file device.c.

2853 {
2855  struct wined3d_shader *object;
2856 
2857  TRACE("iface %p, shader %p.\n", iface, shader);
2858 
2859  if (!shader)
2860  return D3DERR_INVALIDCALL;
2861 
2863  if ((object = wined3d_device_get_pixel_shader(device->wined3d_device)))
2864  {
2865  struct d3d8_pixel_shader *d3d8_shader;
2866  d3d8_shader = wined3d_shader_get_parent(object);
2867  *shader = d3d8_shader->handle;
2868  }
2869  else
2870  {
2871  *shader = 0;
2872  }
2874 
2875  TRACE("Returning %#x.\n", *shader);
2876 
2877  return D3D_OK;
2878 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
Definition: devices.h:37
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define D3D_OK
Definition: d3d.h:106
void *CDECL wined3d_shader_get_parent(const struct wined3d_shader *shader)
Definition: shader.c:3379
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
void * object
Definition: jmemsys.h:48
struct wined3d_shader *CDECL wined3d_device_get_pixel_shader(const struct wined3d_device *device)
Definition: device.c:2530

◆ d3d8_device_GetPixelShaderConstant()

static HRESULT WINAPI d3d8_device_GetPixelShaderConstant ( IDirect3DDevice8 *  iface,
DWORD  start_register,
void data,
DWORD  count 
)
static

Definition at line 2922 of file device.c.

2924 {
2926  HRESULT hr;
2927 
2928  TRACE("iface %p, start_register %u, data %p, count %u.\n",
2929  iface, start_register, data, count);
2930 
2932  hr = wined3d_device_get_ps_consts_f(device->wined3d_device, start_register, count, data);
2934 
2935  return hr;
2936 }
HRESULT hr
Definition: shlfolder.c:183
GLuint GLuint GLsizei count
Definition: gl.h:1545
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
HRESULT CDECL wined3d_device_get_ps_consts_f(const struct wined3d_device *device, unsigned int start_idx, unsigned int count, struct wined3d_vec4 *constants)
Definition: device.c:2708

◆ d3d8_device_GetPixelShaderFunction()

static HRESULT WINAPI d3d8_device_GetPixelShaderFunction ( IDirect3DDevice8 *  iface,
DWORD  shader,
void data,
DWORD data_size 
)
static

Definition at line 2938 of file device.c.

2940 {
2942  struct d3d8_pixel_shader *shader_impl = NULL;
2943  HRESULT hr;
2944 
2945  TRACE("iface %p, shader %#x, data %p, data_size %p.\n",
2946  iface, shader, data, data_size);
2947 
2949  if (!(shader_impl = d3d8_get_object(&device->handle_table, shader - (VS_HIGHESTFIXEDFXF + 1), D3D8_HANDLE_PS)))
2950  {
2951  WARN("Invalid handle (%#x) passed.\n", shader);
2953 
2954  return D3DERR_INVALIDCALL;
2955  }
2956 
2957  hr = wined3d_shader_get_byte_code(shader_impl->wined3d_shader, data, data_size);
2959 
2960  return hr;
2961 }
HRESULT CDECL wined3d_shader_get_byte_code(const struct wined3d_shader *shader, void *byte_code, UINT *byte_code_size)
Definition: shader.c:3386
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
struct wined3d_shader * wined3d_shader
Definition: d3d8_private.h:267
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define VS_HIGHESTFIXEDFXF
Definition: d3d8_private.h:43
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
static void * d3d8_get_object(struct d3d8_handle_table *t, DWORD handle, enum d3d8_handle_type type)
Definition: device.c:430

◆ d3d8_device_GetRasterStatus()

static HRESULT WINAPI d3d8_device_GetRasterStatus ( IDirect3DDevice8 *  iface,
D3DRASTER_STATUS raster_status 
)
static

Definition at line 872 of file device.c.

873 {
875  HRESULT hr;
876 
877  TRACE("iface %p, raster_status %p.\n", iface, raster_status);
878 
880  hr = wined3d_device_get_raster_status(device->wined3d_device, 0, (struct wined3d_raster_status *)raster_status);
882 
883  return hr;
884 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
HRESULT CDECL wined3d_device_get_raster_status(const struct wined3d_device *device, UINT swapchain_idx, struct wined3d_raster_status *raster_status)
Definition: device.c:3981
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_GetRenderState()

static HRESULT WINAPI d3d8_device_GetRenderState ( IDirect3DDevice8 *  iface,
D3DRENDERSTATETYPE  state,
DWORD value 
)
static

Definition at line 1709 of file device.c.

1711 {
1713 
1714  TRACE("iface %p, state %#x, value %p.\n", iface, state, value);
1715 
1717  switch (state)
1718  {
1719  case D3DRS_ZBIAS:
1721  break;
1722 
1723  default:
1724  *value = wined3d_device_get_render_state(device->wined3d_device, state);
1725  }
1727 
1728  return D3D_OK;
1729 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
static int state
Definition: maze.c:121
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define D3D_OK
Definition: d3d.h:106
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
DWORD CDECL wined3d_device_get_render_state(const struct wined3d_device *device, enum wined3d_render_state state)
Definition: device.c:2064

◆ d3d8_device_GetRenderTarget()

static HRESULT WINAPI d3d8_device_GetRenderTarget ( IDirect3DDevice8 *  iface,
IDirect3DSurface8 **  render_target 
)
static

Definition at line 1365 of file device.c.

1366 {
1368  struct wined3d_rendertarget_view *wined3d_rtv;
1369  struct d3d8_surface *surface_impl;
1370  HRESULT hr;
1371 
1372  TRACE("iface %p, render_target %p.\n", iface, render_target);
1373 
1374  if (!render_target)
1375  return D3DERR_INVALIDCALL;
1376 
1378  if ((wined3d_rtv = wined3d_device_get_rendertarget_view(device->wined3d_device, 0)))
1379  {
1380  /* We want the sub resource parent here, since the view itself may be
1381  * internal to wined3d and may not have a parent. */
1383  *render_target = &surface_impl->IDirect3DSurface8_iface;
1384  IDirect3DSurface8_AddRef(*render_target);
1385  hr = D3D_OK;
1386  }
1387  else
1388  {
1389  ERR("Failed to get wined3d render target.\n");
1390  *render_target = NULL;
1391  hr = D3DERR_NOTFOUND;
1392  }
1394 
1395  return hr;
1396 }
HRESULT hr
Definition: shlfolder.c:183
struct wined3d_rendertarget_view *CDECL wined3d_device_get_rendertarget_view(const struct wined3d_device *device, unsigned int view_idx)
Definition: device.c:4447
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
#define D3DERR_NOTFOUND
Definition: d3d8.h:80
#define IDirect3DSurface8_AddRef(p)
Definition: d3d8.h:309
IDirect3DSurface8 IDirect3DSurface8_iface
Definition: d3d8_private.h:176
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
void *CDECL wined3d_rendertarget_view_get_sub_resource_parent(const struct wined3d_rendertarget_view *view)
Definition: view.c:376
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define ERR(fmt,...)
Definition: debug.h:109
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
struct wined3d_rendertarget_view * wined3d_rtv
Definition: d3d8_private.h:181
#define D3D_OK
Definition: d3d.h:106
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_GetStreamSource()

static HRESULT WINAPI d3d8_device_GetStreamSource ( IDirect3DDevice8 *  iface,
UINT  stream_idx,
IDirect3DVertexBuffer8 **  buffer,
UINT stride 
)
static

Definition at line 3003 of file device.c.

3005 {
3007  struct d3d8_vertexbuffer *buffer_impl;
3009  HRESULT hr;
3010 
3011  TRACE("iface %p, stream_idx %u, buffer %p, stride %p.\n",
3012  iface, stream_idx, buffer, stride);
3013 
3014  if (!buffer)
3015  return D3DERR_INVALIDCALL;
3016 
3018  hr = wined3d_device_get_stream_source(device->wined3d_device, stream_idx, &wined3d_buffer, 0, stride);
3019  if (SUCCEEDED(hr) && wined3d_buffer)
3020  {
3022  *buffer = &buffer_impl->IDirect3DVertexBuffer8_iface;
3024  }
3025  else
3026  {
3027  if (FAILED(hr))
3028  ERR("Failed to get wined3d stream source, hr %#x.\n", hr);
3029  *buffer = NULL;
3030  }
3032 
3033  return hr;
3034 }
HRESULT CDECL wined3d_device_get_stream_source(const struct wined3d_device *device, UINT stream_idx, struct wined3d_buffer **buffer, UINT *offset, UINT *stride)
Definition: device.c:1428
#define IDirect3DVertexBuffer8_AddRef(p)
Definition: d3d8.h:417
HRESULT hr
Definition: shlfolder.c:183
IDirect3DVertexBuffer8 IDirect3DVertexBuffer8_iface
Definition: d3d8_private.h:197
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
GLuint buffer
Definition: glext.h:5915
void *CDECL wined3d_buffer_get_parent(const struct wined3d_buffer *buffer)
Definition: buffer.c:807
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
GLsizei stride
Definition: glext.h:5848
LONG HRESULT
Definition: typedefs.h:77
#define ERR(fmt,...)
Definition: debug.h:109
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ d3d8_device_GetTexture()

static HRESULT WINAPI d3d8_device_GetTexture ( IDirect3DDevice8 *  iface,
DWORD  stage,
IDirect3DBaseTexture8 **  texture 
)
static

Definition at line 1927 of file device.c.

1928 {
1931  struct d3d8_texture *texture_impl;
1932 
1933  TRACE("iface %p, stage %u, texture %p.\n", iface, stage, texture);
1934 
1935  if (!texture)
1936  return D3DERR_INVALIDCALL;
1937 
1939  if ((wined3d_texture = wined3d_device_get_texture(device->wined3d_device, stage)))
1940  {
1942  *texture = &texture_impl->IDirect3DBaseTexture8_iface;
1944  }
1945  else
1946  {
1947  *texture = NULL;
1948  }
1950 
1951  return D3D_OK;
1952 }
void *CDECL wined3d_texture_get_parent(const struct wined3d_texture *texture)
Definition: texture.c:1121
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
IDirect3DBaseTexture8 IDirect3DBaseTexture8_iface
Definition: d3d8_private.h:223
#define IDirect3DBaseTexture8_AddRef(p)
Definition: d3d8.h:545
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define D3D_OK
Definition: d3d.h:106
struct wined3d_texture *CDECL wined3d_device_get_texture(const struct wined3d_device *device, UINT stage)
Definition: device.c:3510
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_GetTextureStageState()

static HRESULT WINAPI d3d8_device_GetTextureStageState ( IDirect3DDevice8 *  iface,
DWORD  stage,
D3DTEXTURESTAGESTATETYPE  Type,
DWORD value 
)
static

Definition at line 2014 of file device.c.

2016 {
2018  const struct tss_lookup *l;
2019 
2020  TRACE("iface %p, stage %u, state %#x, value %p.\n", iface, stage, Type, value);
2021 
2022  if (Type >= sizeof(tss_lookup) / sizeof(*tss_lookup))
2023  {
2024  WARN("Invalid Type %#x passed.\n", Type);
2025  return D3D_OK;
2026  }
2027 
2028  l = &tss_lookup[Type];
2029 
2031  if (l->sampler_state)
2032  *value = wined3d_device_get_sampler_state(device->wined3d_device, stage, l->u.sampler_state);
2033  else
2034  *value = wined3d_device_get_texture_stage_state(device->wined3d_device, stage, l->u.texture_state);
2036 
2037  return D3D_OK;
2038 }
DWORD CDECL wined3d_device_get_sampler_state(const struct wined3d_device *device, UINT sampler_idx, enum wined3d_sampler_state state)
Definition: device.c:2108
Type
Definition: Type.h:6
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
Definition: devices.h:37
r l[0]
Definition: byte_order.h:167
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define D3D_OK
Definition: d3d.h:106
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
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_GetTransform()

static HRESULT WINAPI d3d8_device_GetTransform ( IDirect3DDevice8 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX matrix 
)
static

Definition at line 1501 of file device.c.

1503 {
1505 
1506  TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
1507 
1508  /* Note: D3DMATRIX is compatible with struct wined3d_matrix. */
1510  wined3d_device_get_transform(device->wined3d_device, state, (struct wined3d_matrix *)matrix);
1512 
1513  return D3D_OK;
1514 }
void CDECL wined3d_device_get_transform(const struct wined3d_device *device, enum wined3d_transform_state state, struct wined3d_matrix *matrix)
Definition: device.c:1540
GLuint GLenum matrix
Definition: glext.h:9407
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
static int state
Definition: maze.c:121
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define D3D_OK
Definition: d3d.h:106
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_GetVertexShader()

static HRESULT WINAPI d3d8_device_GetVertexShader ( IDirect3DDevice8 *  iface,
DWORD shader 
)
static

Definition at line 2553 of file device.c.

2554 {
2556  struct wined3d_vertex_declaration *wined3d_declaration;
2557  struct d3d8_vertex_declaration *d3d8_declaration;
2558 
2559  TRACE("iface %p, shader %p.\n", iface, shader);
2560 
2562  if ((wined3d_declaration = wined3d_device_get_vertex_declaration(device->wined3d_device)))
2563  {
2564  d3d8_declaration = wined3d_vertex_declaration_get_parent(wined3d_declaration);
2565  *shader = d3d8_declaration->shader_handle;
2566  }
2567  else
2568  {
2569  *shader = 0;
2570  }
2572 
2573  TRACE("Returning %#x.\n", *shader);
2574 
2575  return D3D_OK;
2576 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
Definition: devices.h:37
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
struct wined3d_vertex_declaration *CDECL wined3d_device_get_vertex_declaration(const struct wined3d_device *device)
Definition: device.c:2179
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define D3D_OK
Definition: d3d.h:106
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
void *CDECL wined3d_vertex_declaration_get_parent(const struct wined3d_vertex_declaration *declaration)

◆ d3d8_device_GetVertexShaderConstant()

static HRESULT WINAPI d3d8_device_GetVertexShaderConstant ( IDirect3DDevice8 *  iface,
DWORD  start_register,
void data,
DWORD  count 
)
static

Definition at line 2628 of file device.c.

2630 {
2632  HRESULT hr;
2633 
2634  TRACE("iface %p, start_register %u, data %p, count %u.\n",
2635  iface, start_register, data, count);
2636 
2637  if (start_register + count > D3D8_MAX_VERTEX_SHADER_CONSTANTF)
2638  {
2639  WARN("Trying to access %u constants, but d3d8 only supports %u\n",
2640  start_register + count, D3D8_MAX_VERTEX_SHADER_CONSTANTF);
2641  return D3DERR_INVALIDCALL;
2642  }
2643 
2645  hr = wined3d_device_get_vs_consts_f(device->wined3d_device, start_register, count, data);
2647 
2648  return hr;
2649 }
HRESULT hr
Definition: shlfolder.c:183
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define D3D8_MAX_VERTEX_SHADER_CONSTANTF
Definition: d3d8_private.h:262
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
HRESULT CDECL wined3d_device_get_vs_consts_f(const struct wined3d_device *device, unsigned int start_idx, unsigned int count, struct wined3d_vec4 *constants)
Definition: device.c:2492

◆ d3d8_device_GetVertexShaderDeclaration()

static HRESULT WINAPI d3d8_device_GetVertexShaderDeclaration ( IDirect3DDevice8 *  iface,
DWORD  shader,
void data,
DWORD data_size 
)
static

Definition at line 2651 of file device.c.

2653 {
2656  struct d3d8_vertex_shader *shader_impl;
2657 
2658  TRACE("iface %p, shader %#x, data %p, data_size %p.\n",
2659  iface, shader, data, data_size);
2660 
2662  shader_impl = d3d8_get_object(&device->handle_table, shader - (VS_HIGHESTFIXEDFXF + 1), D3D8_HANDLE_VS);
2664 
2665  if (!shader_impl)
2666  {
2667  WARN("Invalid handle (%#x) passed.\n", shader);
2668  return D3DERR_INVALIDCALL;
2669  }
2670  declaration = shader_impl->vertex_declaration;
2671 
2672  if (!data)
2673  {
2674  *data_size = declaration->elements_size;
2675  return D3D_OK;
2676  }
2677 
2678  /* MSDN claims that if *data_size is smaller than the required size
2679  * we should write the required size and return D3DERR_MOREDATA.
2680  * That's not actually true. */
2681  if (*data_size < declaration->elements_size)
2682  return D3DERR_INVALIDCALL;
2683 
2684  memcpy(data, declaration->elements, declaration->elements_size);
2685 
2686  return D3D_OK;
2687 }
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
Definition: devices.h:37
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define D3D_OK
Definition: d3d.h:106
#define VS_HIGHESTFIXEDFXF
Definition: d3d8_private.h:43
struct d3d8_vertex_declaration * vertex_declaration
Definition: d3d8_private.h:254
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
static void * d3d8_get_object(struct d3d8_handle_table *t, DWORD handle, enum d3d8_handle_type type)
Definition: device.c:430

◆ d3d8_device_GetVertexShaderFunction()

static HRESULT WINAPI d3d8_device_GetVertexShaderFunction ( IDirect3DDevice8 *  iface,
DWORD  shader,
void data,
DWORD data_size 
)
static

Definition at line 2689 of file device.c.

2691 {
2693  struct d3d8_vertex_shader *shader_impl = NULL;
2694  HRESULT hr;
2695 
2696  TRACE("iface %p, shader %#x, data %p, data_size %p.\n",
2697  iface, shader, data, data_size);
2698 
2700  if (!(shader_impl = d3d8_get_object(&device->handle_table, shader - (VS_HIGHESTFIXEDFXF + 1), D3D8_HANDLE_VS)))
2701  {
2702  WARN("Invalid handle (%#x) passed.\n", shader);
2704 
2705  return D3DERR_INVALIDCALL;
2706  }
2707 
2708  if (!shader_impl->wined3d_shader)
2709  {
2711  *data_size = 0;
2712  return D3D_OK;
2713  }
2714 
2715  hr = wined3d_shader_get_byte_code(shader_impl->wined3d_shader, data, data_size);
2717 
2718  return hr;
2719 }
HRESULT CDECL wined3d_shader_get_byte_code(const struct wined3d_shader *shader, void *byte_code, UINT *byte_code_size)
Definition: shader.c:3386
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
struct wined3d_shader * wined3d_shader
Definition: d3d8_private.h:255
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define D3D_OK
Definition: d3d.h:106
#define VS_HIGHESTFIXEDFXF
Definition: d3d8_private.h:43
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
static void * d3d8_get_object(struct d3d8_handle_table *t, DWORD handle, enum d3d8_handle_type type)
Definition: device.c:430

◆ d3d8_device_GetViewport()

static HRESULT WINAPI d3d8_device_GetViewport ( IDirect3DDevice8 *  iface,
D3DVIEWPORT8 viewport 
)
static

Definition at line 1552 of file device.c.

1553 {
1556 
1557  TRACE("iface %p, viewport %p.\n", iface, viewport);
1558 
1562 
1563  viewport->X = wined3d_viewport.x;
1564  viewport->Y = wined3d_viewport.y;
1565  viewport->Width = wined3d_viewport.width;
1566  viewport->Height = wined3d_viewport.height;
1567  viewport->MinZ = wined3d_viewport.min_z;
1568  viewport->MaxZ = wined3d_viewport.max_z;
1569 
1570  return D3D_OK;
1571 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
void CDECL wined3d_device_get_viewport(const struct wined3d_device *device, struct wined3d_viewport *viewport)
Definition: device.c:1950
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
#define D3D_OK
Definition: d3d.h:106
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_device_LightEnable()

static HRESULT WINAPI d3d8_device_LightEnable ( IDirect3DDevice8 *  iface,
DWORD  index,
BOOL  enable 
)
static

Definition at line 1631 of file device.c.

1632 {
1634  HRESULT hr;
1635 
1636  TRACE("iface %p, index %u, enable %#x.\n", iface, index, enable);
1637 
1639  hr = wined3d_device_set_light_enable(device->wined3d_device, index, enable);
1641 
1642  return hr;
1643 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
Definition: devices.h:37
GLuint index
Definition: glext.h:6031
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
GLboolean enable
Definition: glext.h:11120
void WINAPI wined3d_mutex_unlock(void)
Definition: