ReactOS  0.4.13-dev-551-gf37fb1f
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, DWORD presentation_interval)
 
static enum wined3d_swap_effect wined3dswapeffect_from_d3dswapeffect (D3DSWAPEFFECT effect)
 
static enum wined3d_swap_interval wined3dswapinterval_from_d3d (DWORD interval)
 
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_texture_sub_resource_created (struct wined3d_device_parent *device_parent, enum wined3d_resource_type type, 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 444 of file device.c.

445 {
446  struct d3d8_handle_entry *entry;
447 
448  if (t->free_entries)
449  {
450  DWORD index = t->free_entries - t->entries;
451  /* Use a free handle */
452  entry = t->free_entries;
453  if (entry->type != D3D8_HANDLE_FREE)
454  {
455  ERR("Handle %u(%p) is in the free list, but has type %#x.\n", index, entry, entry->type);
456  return D3D8_INVALID_HANDLE;
457  }
458  t->free_entries = entry->object;
459  entry->object = object;
460  entry->type = type;
461 
462  return index;
463  }
464 
465  if (!(t->entry_count < t->table_size))
466  {
467  /* Grow the table */
468  UINT new_size = t->table_size + (t->table_size >> 1);
469  struct d3d8_handle_entry *new_entries;
470 
471  if (!(new_entries = heap_realloc(t->entries, new_size * sizeof(*t->entries))))
472  {
473  ERR("Failed to grow the handle table.\n");
474  return D3D8_INVALID_HANDLE;
475  }
476  t->entries = new_entries;
477  t->table_size = new_size;
478  }
479 
480  entry = &t->entries[t->entry_count];
481  entry->object = object;
482  entry->type = type;
483 
484  return t->entry_count++;
485 }
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 552 of file device.c.

553 {
556 
557  TRACE("%p increasing refcount to %u.\n", iface, ref);
558 
559  return ref;
560 }
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 1890 of file device.c.

1891 {
1893  struct wined3d_stateblock *stateblock;
1894 
1895  TRACE("iface %p, token %#x.\n", iface, token);
1896 
1897  if (!token)
1898  return D3D_OK;
1899 
1901  stateblock = d3d8_get_object(&device->handle_table, token - 1, D3D8_HANDLE_SB);
1902  if (!stateblock)
1903  {
1904  WARN("Invalid handle (%#x) passed.\n", token);
1906  return D3DERR_INVALIDCALL;
1907  }
1908  wined3d_stateblock_apply(stateblock);
1910 
1911  return D3D_OK;
1912 }
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#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:977
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:365
static void * d3d8_get_object(struct d3d8_handle_table *t, DWORD handle, enum d3d8_handle_type type)
Definition: device.c:513

◆ d3d8_device_BeginScene()

static HRESULT WINAPI d3d8_device_BeginScene ( IDirect3DDevice8 *  iface)
static

Definition at line 1517 of file device.c.

1518 {
1520  HRESULT hr;
1521 
1522  TRACE("iface %p.\n", iface);
1523 
1525  hr = wined3d_device_begin_scene(device->wined3d_device);
1527 
1528  return hr;
1529 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
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:3659
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d8_device_BeginStateBlock()

static HRESULT WINAPI d3d8_device_BeginStateBlock ( IDirect3DDevice8 *  iface)
static

Definition at line 1838 of file device.c.

1839 {
1841  HRESULT hr;
1842 
1843  TRACE("iface %p.\n", iface);
1844 
1846  hr = wined3d_device_begin_stateblock(device->wined3d_device);
1848 
1849  return hr;
1850 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT CDECL wined3d_device_begin_stateblock(struct wined3d_device *device)
Definition: device.c:3612
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:365

◆ d3d8_device_CaptureStateBlock()

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

Definition at line 1914 of file device.c.

1915 {
1917  struct wined3d_stateblock *stateblock;
1918 
1919  TRACE("iface %p, token %#x.\n", iface, token);
1920 
1922  stateblock = d3d8_get_object(&device->handle_table, token - 1, D3D8_HANDLE_SB);
1923  if (!stateblock)
1924  {
1925  WARN("Invalid handle (%#x) passed.\n", token);
1927  return D3DERR_INVALIDCALL;
1928  }
1929  wined3d_stateblock_capture(stateblock);
1931 
1932  return D3D_OK;
1933 }
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#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:683
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365
static void * d3d8_get_object(struct d3d8_handle_table *t, DWORD handle, enum d3d8_handle_type type)
Definition: device.c:513

◆ 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 1545 of file device.c.

1547 {
1548  const struct wined3d_color c =
1549  {
1550  ((color >> 16) & 0xff) / 255.0f,
1551  ((color >> 8) & 0xff) / 255.0f,
1552  (color & 0xff) / 255.0f,
1553  ((color >> 24) & 0xff) / 255.0f,
1554  };
1556  HRESULT hr;
1557 
1558  TRACE("iface %p, rect_count %u, rects %p, flags %#x, color 0x%08x, z %.8e, stencil %u.\n",
1559  iface, rect_count, rects, flags, color, z, stencil);
1560 
1561  if (rect_count && !rects)
1562  {
1563  WARN("count %u with NULL rects.\n", rect_count);
1564  rect_count = 0;
1565  }
1566 
1568  hr = wined3d_device_clear(device->wined3d_device, rect_count, (const RECT *)rects, flags, &c, z, stencil);
1570 
1571  return hr;
1572 }
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
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:3690
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:365

◆ 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 1251 of file device.c.

1254 {
1255  struct d3d8_surface *src = unsafe_impl_from_IDirect3DSurface8(src_surface);
1256  struct d3d8_surface *dst = unsafe_impl_from_IDirect3DSurface8(dst_surface);
1257  enum wined3d_format_id src_format, dst_format;
1258  struct wined3d_sub_resource_desc wined3d_desc;
1259  UINT src_w, src_h;
1260 
1261  TRACE("iface %p, src_surface %p, src_rects %p, rect_count %u, dst_surface %p, dst_points %p.\n",
1262  iface, src_surface, src_rects, rect_count, dst_surface, dst_points);
1263 
1264  /* Check that the source texture is in WINED3D_POOL_SYSTEM_MEM and the
1265  * destination texture is in WINED3D_POOL_DEFAULT. */
1266 
1268  wined3d_texture_get_sub_resource_desc(src->wined3d_texture, src->sub_resource_idx, &wined3d_desc);
1269  if (wined3d_desc.usage & WINED3DUSAGE_DEPTHSTENCIL)
1270  {
1271  WARN("Source %p is a depth stencil surface, returning D3DERR_INVALIDCALL.\n", src_surface);
1273  return D3DERR_INVALIDCALL;
1274  }
1275  src_format = wined3d_desc.format;
1276  src_w = wined3d_desc.width;
1277  src_h = wined3d_desc.height;
1278 
1279  wined3d_texture_get_sub_resource_desc(dst->wined3d_texture, dst->sub_resource_idx, &wined3d_desc);
1280  if (wined3d_desc.usage & WINED3DUSAGE_DEPTHSTENCIL)
1281  {
1282  WARN("Destination %p is a depth stencil surface, returning D3DERR_INVALIDCALL.\n", dst_surface);
1284  return D3DERR_INVALIDCALL;
1285  }
1286  dst_format = wined3d_desc.format;
1287 
1288  /* Check that the source and destination formats match */
1289  if (src_format != dst_format)
1290  {
1291  WARN("Source %p format must match the destination %p format, returning D3DERR_INVALIDCALL.\n",
1292  src_surface, dst_surface);
1294  return D3DERR_INVALIDCALL;
1295  }
1296 
1297  /* Quick if complete copy ... */
1298  if (!rect_count && !src_rects && !dst_points)
1299  {
1300  RECT rect = {0, 0, src_w, src_h};
1301  wined3d_texture_blt(dst->wined3d_texture, dst->sub_resource_idx, &rect,
1302  src->wined3d_texture, src->sub_resource_idx, &rect, 0, NULL, WINED3D_TEXF_POINT);
1303  }
1304  else
1305  {
1306  unsigned int i;
1307  /* Copy rect by rect */
1308  if (src_rects && dst_points)
1309  {
1310  for (i = 0; i < rect_count; ++i)
1311  {
1312  UINT w = src_rects[i].right - src_rects[i].left;
1313  UINT h = src_rects[i].bottom - src_rects[i].top;
1314  RECT dst_rect = {dst_points[i].x, dst_points[i].y,
1315  dst_points[i].x + w, dst_points[i].y + h};
1316 
1317  wined3d_texture_blt(dst->wined3d_texture, dst->sub_resource_idx, &dst_rect,
1318  src->wined3d_texture, src->sub_resource_idx, &src_rects[i], 0, NULL, WINED3D_TEXF_POINT);
1319  }
1320  }
1321  else
1322  {
1323  for (i = 0; i < rect_count; ++i)
1324  {
1325  UINT w = src_rects[i].right - src_rects[i].left;
1326  UINT h = src_rects[i].bottom - src_rects[i].top;
1327  RECT dst_rect = {0, 0, w, h};
1328 
1329  wined3d_texture_blt(dst->wined3d_texture, dst->sub_resource_idx, &dst_rect,
1330  src->wined3d_texture, src->sub_resource_idx, &src_rects[i], 0, NULL, WINED3D_TEXF_POINT);
1331  }
1332  }
1333  }
1335 
1336  return WINED3D_OK;
1337 }
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:360
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:3295
#define WINED3DUSAGE_DEPTHSTENCIL
Definition: wined3d.h:909
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:3087
#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:365

◆ 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 1147 of file device.c.

1150 {
1151  struct wined3d_resource_desc desc;
1152  struct d3d8_surface *surface_impl;
1153  struct wined3d_texture *texture;
1154  HRESULT hr;
1155 
1156  TRACE("device %p, width %u, height %u, format %#x, flags %#x, surface %p, "
1157  "usage %#x, pool %#x, multisample_type %#x, multisample_quality %u.\n",
1158  device, width, height, format, flags, surface,
1159  usage, pool, multisample_type, multisample_quality);
1160 
1161  desc.resource_type = WINED3D_RTYPE_TEXTURE_2D;
1163  desc.multisample_type = multisample_type;
1164  desc.multisample_quality = multisample_quality;
1165  desc.usage = usage & WINED3DUSAGE_MASK;
1166  if (pool == D3DPOOL_SCRATCH)
1167  desc.usage |= WINED3DUSAGE_SCRATCH;
1170  desc.width = width;
1171  desc.height = height;
1172  desc.depth = 1;
1173  desc.size = 0;
1174 
1176 
1177  if (FAILED(hr = wined3d_texture_create(device->wined3d_device, &desc,
1179  {
1181  WARN("Failed to create texture, hr %#x.\n", hr);
1182  return hr;
1183  }
1184 
1186  surface_impl->parent_device = &device->IDirect3DDevice8_iface;
1187  *surface = &surface_impl->IDirect3DSurface8_iface;
1188  IDirect3DSurface8_AddRef(*surface);
1190 
1192 
1193  return D3D_OK;
1194 }
GLint GLint GLsizei width
Definition: gl.h:1546
HRESULT hr
Definition: shlfolder.c:183
IDirect3DDevice8 * parent_device
Definition: d3d8_private.h:183
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#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:922
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
IDirect3DSurface8 IDirect3DSurface8_iface
Definition: d3d8_private.h:177
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:3264
#define D3D_OK
Definition: d3d.h:106
#define WINED3DUSAGE_SCRATCH
Definition: wined3d.h:924
ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture)
Definition: texture.c:1219
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365
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:3326
static unsigned int wined3daccess_from_d3dpool(D3DPOOL pool, unsigned int usage)
Definition: d3d8_private.h:302

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 778 of file device.c.

780 {
783  struct d3d8_swapchain *object;
784  unsigned int swap_interval;
785  unsigned int i, count;
786  HRESULT hr;
787 
788  TRACE("iface %p, present_parameters %p, swapchain %p.\n",
789  iface, present_parameters, swapchain);
790 
791  if (!present_parameters->Windowed)
792  {
793  WARN("Trying to create an additional fullscreen swapchain, returning D3DERR_INVALIDCALL.\n");
794  return D3DERR_INVALIDCALL;
795  }
796 
799  for (i = 0; i < count; ++i)
800  {
802 
805 
806  if (!desc.windowed)
807  {
809  WARN("Trying to create an additional swapchain in fullscreen mode, returning D3DERR_INVALIDCALL.\n");
810  return D3DERR_INVALIDCALL;
811  }
812  }
814 
815  if (!wined3d_swapchain_desc_from_present_parameters(&desc, present_parameters))
816  return D3DERR_INVALIDCALL;
819  *swapchain = &object->IDirect3DSwapChain8_iface;
821  &desc, present_parameters->FullScreen_PresentationInterval);
822 
823  return hr;
824 }
UINT CDECL wined3d_device_get_swapchain_count(const struct wined3d_device *device)
Definition: device.c:531
static BOOL wined3d_swapchain_desc_from_present_parameters(struct wined3d_swapchain_desc *swapchain_desc, const D3DPRESENT_PARAMETERS *present_parameters)
Definition: device.c:269
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:360
#define D3DERR_INVALIDCALL
struct wined3d_swapchain *CDECL wined3d_device_get_swapchain(const struct wined3d_device *device, UINT swapchain_idx)
Definition: device.c:538
unsigned int swap_interval
Definition: d3d8_private.h:169
HRESULT d3d8_swapchain_create(struct d3d8_device *device, struct wined3d_swapchain_desc *desc, unsigned int swap_interval, struct d3d8_swapchain **swapchain) DECLSPEC_HIDDEN
Definition: swapchain.c:195
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
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
static enum wined3d_swap_interval wined3dswapinterval_from_d3d(DWORD interval)
Definition: device.c:248
#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:267
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
UINT FullScreen_PresentationInterval
Definition: d3d8types.h:1136
static void present_parameters_from_wined3d_swapchain_desc(D3DPRESENT_PARAMETERS *present_parameters, const struct wined3d_swapchain_desc *swapchain_desc, DWORD presentation_interval)
Definition: device.c:211
unsigned int swap_interval
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365
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 1062 of file device.c.

1064 {
1066  struct d3d8_texture *object;
1067  HRESULT hr;
1068 
1069  TRACE("iface %p, edge_length %u, levels %u, usage %#x, format %#x, pool %#x, texture %p.\n",
1070  iface, edge_length, levels, usage, format, pool, texture);
1071 
1072  if (!format)
1073  return D3DERR_INVALIDCALL;
1074 
1075  *texture = NULL;
1076  if (!(object = heap_alloc_zero(sizeof(*object))))
1077  return D3DERR_OUTOFVIDEOMEMORY;
1078 
1079  hr = cubetexture_init(object, device, edge_length, levels, usage, format, pool);
1080  if (FAILED(hr))
1081  {
1082  WARN("Failed to initialize cube texture, hr %#x.\n", hr);
1083  heap_free(object);
1084  return hr;
1085  }
1086 
1087  TRACE("Created cube texture %p.\n", object);
1088  *texture = (IDirect3DCubeTexture8 *)&object->IDirect3DBaseTexture8_iface;
1089 
1090  return hr;
1091 }
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 1217 of file device.c.

1220 {
1222 
1223  TRACE("iface %p, width %u, height %u, format %#x, multisample_type %#x, surface %p.\n",
1224  iface, width, height, format, multisample_type, surface);
1225 
1226  if (!format)
1227  return D3DERR_INVALIDCALL;
1228 
1229  *surface = NULL;
1230 
1231  /* TODO: Verify that Discard is false */
1233  surface, D3DUSAGE_DEPTHSTENCIL, D3DPOOL_DEFAULT, multisample_type, 0);
1234 }
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:1147
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 1237 of file device.c.

1239 {
1241 
1242  TRACE("iface %p, width %u, height %u, format %#x, surface %p.\n",
1243  iface, width, height, format, surface);
1244 
1245  *surface = NULL;
1246 
1248  surface, 0, D3DPOOL_SYSTEMMEM, D3DMULTISAMPLE_NONE, 0);
1249 }
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:1147
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 1120 of file device.c.

1122 {
1124  struct d3d8_indexbuffer *object;
1125  HRESULT hr;
1126 
1127  TRACE("iface %p, size %u, usage %#x, format %#x, pool %#x, buffer %p.\n",
1128  iface, size, usage, format, pool, buffer);
1129 
1130  if (!(object = heap_alloc_zero(sizeof(*object))))
1131  return D3DERR_OUTOFVIDEOMEMORY;
1132 
1133  hr = indexbuffer_init(object, device, size, usage, format, pool);
1134  if (FAILED(hr))
1135  {
1136  WARN("Failed to initialize index buffer, hr %#x.\n", hr);
1137  heap_free(object);
1138  return hr;
1139  }
1140 
1141  TRACE("Created index buffer %p.\n", object);
1142  *buffer = &object->IDirect3DIndexBuffer8_iface;
1143 
1144  return D3D_OK;
1145 }
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 2884 of file device.c.

2886 {
2888  struct d3d8_pixel_shader *object;
2889  DWORD shader_handle;
2890  DWORD handle;
2891  HRESULT hr;
2892 
2893  TRACE("iface %p, byte_code %p, shader %p.\n", iface, byte_code, shader);
2894 
2895  if (!shader)
2896  return D3DERR_INVALIDCALL;
2897 
2898  if (!(object = heap_alloc_zero(sizeof(*object))))
2899  return E_OUTOFMEMORY;
2900 
2902  handle = d3d8_allocate_handle(&device->handle_table, object, D3D8_HANDLE_PS);
2904  if (handle == D3D8_INVALID_HANDLE)
2905  {
2906  ERR("Failed to allocate pixel shader handle.\n");
2907  heap_free(object);
2908  return E_OUTOFMEMORY;
2909  }
2910 
2911  shader_handle = handle + VS_HIGHESTFIXEDFXF + 1;
2912 
2913  hr = d3d8_pixel_shader_init(object, device, byte_code, shader_handle);
2914  if (FAILED(hr))
2915  {
2916  WARN("Failed to initialize pixel shader, hr %#x.\n", hr);
2918  d3d8_free_handle(&device->handle_table, handle, D3D8_HANDLE_PS);
2920  heap_free(object);
2921  *shader = 0;
2922  return hr;
2923  }
2924 
2925  TRACE("Created pixel shader %p (handle %#x).\n", object, shader_handle);
2926  *shader = shader_handle;
2927 
2928  return D3D_OK;
2929 }
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:360
#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:444
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:487
#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:365
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 1196 of file device.c.

1199 {
1201  DWORD flags = 0;
1202 
1203  TRACE("iface %p, width %u, height %u, format %#x, multisample_type %#x, lockable %#x, surface %p.\n",
1204  iface, width, height, format, multisample_type, lockable, surface);
1205 
1206  if (!format)
1207  return D3DERR_INVALIDCALL;
1208 
1209  *surface = NULL;
1210  if (lockable)
1212 
1214  D3DUSAGE_RENDERTARGET, D3DPOOL_DEFAULT, multisample_type, 0);
1215 }
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:1147
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 1961 of file device.c.

1963 {
1965  struct wined3d_stateblock *stateblock;
1966  HRESULT hr;
1967 
1968  TRACE("iface %p, type %#x, handle %p.\n", iface, type, handle);
1969 
1970  if (type != D3DSBT_ALL
1971  && type != D3DSBT_PIXELSTATE
1972  && type != D3DSBT_VERTEXSTATE)
1973  {
1974  WARN("Unexpected stateblock type, returning D3DERR_INVALIDCALL\n");
1975  return D3DERR_INVALIDCALL;
1976  }
1977 
1979  hr = wined3d_stateblock_create(device->wined3d_device, (enum wined3d_stateblock_type)type, &stateblock);
1980  if (FAILED(hr))
1981  {
1983  ERR("Failed to create the state block, hr %#x\n", hr);
1984  return hr;
1985  }
1986 
1987  *handle = d3d8_allocate_handle(&device->handle_table, stateblock, D3D8_HANDLE_SB);
1989 
1990  if (*handle == D3D8_INVALID_HANDLE)
1991  {
1992  ERR("Failed to allocate a handle.\n");
1994  wined3d_stateblock_decref(stateblock);
1996  return E_FAIL;
1997  }
1998  ++*handle;
1999 
2000  TRACE("Returning %#x (%p).\n", *handle, stateblock);
2001 
2002  return hr;
2003 }
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:360
#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:1384
#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:444
wined3d_stateblock_type
Definition: wined3d.h:774
#define TRACE(s)
Definition: solgame.cpp:4
ULONG CDECL wined3d_stateblock_decref(struct wined3d_stateblock *stateblock)
Definition: stateblock.c:551
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:365

◆ 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 998 of file device.c.

1001 {
1003  struct d3d8_texture *object;
1004  HRESULT hr;
1005 
1006  TRACE("iface %p, width %u, height %u, levels %u, usage %#x, format %#x, pool %#x, texture %p.\n",
1007  iface, width, height, levels, usage, format, pool, texture);
1008 
1009  if (!format)
1010  return D3DERR_INVALIDCALL;
1011 
1012  *texture = NULL;
1013  if (!(object = heap_alloc_zero(sizeof(*object))))
1014  return D3DERR_OUTOFVIDEOMEMORY;
1015 
1017  if (FAILED(hr))
1018  {
1019  WARN("Failed to initialize texture, hr %#x.\n", hr);
1020  heap_free(object);
1021  return hr;
1022  }
1023 
1024  TRACE("Created texture %p.\n", object);
1025  *texture = (IDirect3DTexture8 *)&object->IDirect3DBaseTexture8_iface;
1026 
1027  return D3D_OK;
1028 }
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 1093 of file device.c.

1095 {
1097  struct d3d8_vertexbuffer *object;
1098  HRESULT hr;
1099 
1100  TRACE("iface %p, size %u, usage %#x, fvf %#x, pool %#x, buffer %p.\n",
1101  iface, size, usage, fvf, pool, buffer);
1102 
1103  if (!(object = heap_alloc_zero(sizeof(*object))))
1104  return D3DERR_OUTOFVIDEOMEMORY;
1105 
1106  hr = vertexbuffer_init(object, device, size, usage, fvf, pool);
1107  if (FAILED(hr))
1108  {
1109  WARN("Failed to initialize vertex buffer, hr %#x.\n", hr);
1110  heap_free(object);
1111  return hr;
1112  }
1113 
1114  TRACE("Created vertex buffer %p.\n", object);
1115  *buffer = &object->IDirect3DVertexBuffer8_iface;
1116 
1117  return D3D_OK;
1118 }
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 2510 of file device.c.

2512 {
2514  struct d3d8_vertex_shader *object;
2515  DWORD shader_handle;
2516  DWORD handle;
2517  HRESULT hr;
2518 
2519  TRACE("iface %p, declaration %p, byte_code %p, shader %p, usage %#x.\n",
2520  iface, declaration, byte_code, shader, usage);
2521 
2522  if (!(object = heap_alloc_zero(sizeof(*object))))
2523  {
2524  *shader = 0;
2525  return E_OUTOFMEMORY;
2526  }
2527 
2529  handle = d3d8_allocate_handle(&device->handle_table, object, D3D8_HANDLE_VS);
2531  if (handle == D3D8_INVALID_HANDLE)
2532  {
2533  ERR("Failed to allocate vertex shader handle.\n");
2534  heap_free(object);
2535  *shader = 0;
2536  return E_OUTOFMEMORY;
2537  }
2538 
2539  shader_handle = handle + VS_HIGHESTFIXEDFXF + 1;
2540 
2541  hr = d3d8_vertex_shader_init(object, device, declaration, byte_code, shader_handle, usage);
2542  if (FAILED(hr))
2543  {
2544  WARN("Failed to initialize vertex shader, hr %#x.\n", hr);
2546  d3d8_free_handle(&device->handle_table, handle, D3D8_HANDLE_VS);
2548  heap_free(object);
2549  *shader = 0;
2550  return hr;
2551  }
2552 
2553  TRACE("Created vertex shader %p (handle %#x).\n", object, shader_handle);
2554  *shader = shader_handle;
2555 
2556  return D3D_OK;
2557 }
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:360
#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:444
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:487
#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:365
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 1030 of file device.c.

1033 {
1035  struct d3d8_texture *object;
1036  HRESULT hr;
1037 
1038  TRACE("iface %p, width %u, height %u, depth %u, levels %u, usage %#x, format %#x, pool %#x, texture %p.\n",
1039  iface, width, height, depth, levels, usage, format, pool, texture);
1040 
1041  if (!format)
1042  return D3DERR_INVALIDCALL;
1043 
1044  *texture = NULL;
1045  if (!(object = heap_alloc_zero(sizeof(*object))))
1046  return D3DERR_OUTOFVIDEOMEMORY;
1047 
1049  if (FAILED(hr))
1050  {
1051  WARN("Failed to initialize volume texture, hr %#x.\n", hr);
1052  heap_free(object);
1053  return hr;
1054  }
1055 
1056  TRACE("Created volume texture %p.\n", object);
1057  *texture = (IDirect3DVolumeTexture8 *)&object->IDirect3DBaseTexture8_iface;
1058 
1059  return D3D_OK;
1060 }
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 3088 of file device.c.

3089 {
3090  FIXME("iface %p, handle %#x unimplemented.\n", iface, handle);
3091  return D3DERR_INVALIDCALL;
3092 }
#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 2989 of file device.c.

2990 {
2992  struct d3d8_pixel_shader *shader_impl;
2993 
2994  TRACE("iface %p, shader %#x.\n", iface, shader);
2995 
2997 
2998  if (!(shader_impl = d3d8_free_handle(&device->handle_table, shader - (VS_HIGHESTFIXEDFXF + 1), D3D8_HANDLE_PS)))
2999  {
3000  WARN("Invalid handle (%#x) passed.\n", shader);
3002  return D3DERR_INVALIDCALL;
3003  }
3004 
3005  if (wined3d_device_get_pixel_shader(device->wined3d_device) == shader_impl->wined3d_shader)
3007 
3009 
3010  d3d8_pixel_shader_destroy(shader_impl);
3011 
3012  return D3D_OK;
3013 }
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#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:268
static void * d3d8_free_handle(struct d3d8_handle_table *t, DWORD handle, enum d3d8_handle_type type)
Definition: device.c:487
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:365
#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:2570

◆ d3d8_device_DeleteStateBlock()

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

Definition at line 1935 of file device.c.

1936 {
1938  struct wined3d_stateblock *stateblock;
1939 
1940  TRACE("iface %p, token %#x.\n", iface, token);
1941 
1943  stateblock = d3d8_free_handle(&device->handle_table, token - 1, D3D8_HANDLE_SB);
1944 
1945  if (!stateblock)
1946  {
1947  WARN("Invalid handle (%#x) passed.\n", token);
1949  return D3DERR_INVALIDCALL;
1950  }
1951 
1952  if (wined3d_stateblock_decref(stateblock))
1953  {
1954  ERR("Stateblock %p has references left, this shouldn't happen.\n", stateblock);
1955  }
1957 
1958  return D3D_OK;
1959 }
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#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:551
static void * d3d8_free_handle(struct d3d8_handle_table *t, DWORD handle, enum d3d8_handle_type type)
Definition: device.c:487
#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:365

◆ d3d8_device_DeleteVertexShader()

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

Definition at line 2687 of file device.c.

2688 {
2690  struct d3d8_vertex_shader *shader_impl;
2691 
2692  TRACE("iface %p, shader %#x.\n", iface, shader);
2693 
2695  if (!(shader_impl = d3d8_free_handle(&device->handle_table, shader - (VS_HIGHESTFIXEDFXF + 1), D3D8_HANDLE_VS)))
2696  {
2697  WARN("Invalid handle (%#x) passed.\n", shader);
2699 
2700  return D3DERR_INVALIDCALL;
2701  }
2702 
2703  if (shader_impl->wined3d_shader
2704  && wined3d_device_get_vertex_shader(device->wined3d_device) == shader_impl->wined3d_shader)
2706 
2708 
2709  d3d8_vertex_shader_destroy(shader_impl);
2710 
2711  return D3D_OK;
2712 }
#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:360
#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:256
static void * d3d8_free_handle(struct d3d8_handle_table *t, DWORD handle, enum d3d8_handle_type type)
Definition: device.c:487
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:2247
#define VS_HIGHESTFIXEDFXF
Definition: d3d8_private.h:43
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ 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 2248 of file device.c.

2251 {
2253  HRESULT hr;
2254 
2255  TRACE("iface %p, primitive_type %#x, min_vertex_idx %u, vertex_count %u, start_idx %u, primitive_count %u.\n",
2256  iface, primitive_type, min_vertex_idx, vertex_count, start_idx, primitive_count);
2257 
2259  wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0);
2260  hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, start_idx,
2261  vertex_count_from_primitive_count(primitive_type, primitive_count));
2263 
2264  return hr;
2265 }
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:3826
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:3774
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
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:365

◆ 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 2399 of file device.c.

2403 {
2404  UINT idx_count = vertex_count_from_primitive_count(primitive_type, primitive_count);
2406  UINT idx_fmt_size = index_format == D3DFMT_INDEX16 ? 2 : 4;
2407  UINT vtx_size = vertex_count * vertex_stride;
2408  UINT idx_size = idx_count * idx_fmt_size;
2410  struct wined3d_box wined3d_box = {0};
2411  struct wined3d_resource *ib, *vb;
2412  UINT vb_pos, ib_pos, align;
2413  HRESULT hr;
2414 
2415  TRACE("iface %p, primitive_type %#x, min_vertex_idx %u, vertex_count %u, primitive_count %u, "
2416  "index_data %p, index_format %#x, vertex_data %p, vertex_stride %u.\n",
2417  iface, primitive_type, min_vertex_idx, vertex_count, primitive_count,
2418  index_data, index_format, vertex_data, vertex_stride);
2419 
2420  if (!primitive_count)
2421  {
2422  WARN("primitive_count is 0, returning D3D_OK\n");
2423  return D3D_OK;
2424  }
2425 
2427 
2429  if (FAILED(hr))
2430  goto done;
2431 
2432  vb_pos = device->vertex_buffer_pos;
2433  align = vb_pos % vertex_stride;
2434  if (align) align = vertex_stride - align;
2435  if (vb_pos + vtx_size + align > device->vertex_buffer_size)
2436  vb_pos = 0;
2437  else
2438  vb_pos += align;
2439 
2440  wined3d_box.left = vb_pos;
2441  wined3d_box.right = vb_pos + vtx_size;
2442  vb = wined3d_buffer_get_resource(device->vertex_buffer);
2445  goto done;
2446  memcpy(wined3d_map_desc.data, (char *)vertex_data + min_vertex_idx * vertex_stride, vtx_size);
2447  wined3d_resource_unmap(vb, 0);
2448  device->vertex_buffer_pos = vb_pos + vtx_size;
2449 
2451  if (FAILED(hr))
2452  goto done;
2453 
2454  ib_pos = device->index_buffer_pos;
2455  align = ib_pos % idx_fmt_size;
2456  if (align) align = idx_fmt_size - align;
2457  if (ib_pos + idx_size + align > device->index_buffer_size)
2458  ib_pos = 0;
2459  else
2460  ib_pos += align;
2461 
2462  wined3d_box.left = ib_pos;
2463  wined3d_box.right = ib_pos + idx_size;
2464  ib = wined3d_buffer_get_resource(device->index_buffer);
2467  goto done;
2468  memcpy(wined3d_map_desc.data, index_data, idx_size);
2469  wined3d_resource_unmap(ib, 0);
2470  device->index_buffer_pos = ib_pos + idx_size;
2471 
2472  hr = wined3d_device_set_stream_source(device->wined3d_device, 0, device->vertex_buffer, 0, vertex_stride);
2473  if (FAILED(hr))
2474  goto done;
2475 
2476  wined3d_device_set_index_buffer(device->wined3d_device, device->index_buffer,
2477  wined3dformat_from_d3dformat(index_format), 0);
2478  wined3d_device_set_base_vertex_index(device->wined3d_device, vb_pos / vertex_stride - min_vertex_idx);
2479 
2480  wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0);
2481  hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / idx_fmt_size, idx_count);
2482 
2483  wined3d_device_set_stream_source(device->wined3d_device, 0, NULL, 0, 0);
2485  wined3d_device_set_base_vertex_index(device->wined3d_device, 0);
2486 
2487 done:
2489  return hr;
2490 }
UINT left
Definition: wined3d.h:1840
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:3826
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:3774
HRESULT CDECL wined3d_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx)
Definition: resource.c:372
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
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:1877
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:334
Definition: devices.h:37
static HRESULT d3d8_device_prepare_index_buffer(struct d3d8_device *device, UINT min_size)
Definition: device.c:2363
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:1381
UINT right
Definition: wined3d.h:1842
#define WINED3D_MAP_DISCARD
Definition: wined3d.h:944
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define WINED3D_MAP_WRITE
Definition: wined3d.h:947
#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:1920
#define WINED3D_MAP_NOOVERWRITE
Definition: wined3d.h:943
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:992
unsigned int UINT
Definition: ndis.h:50
static HRESULT d3d8_device_prepare_vertex_buffer(struct d3d8_device *device, UINT min_size)
Definition: device.c:2268
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d8_device_DrawPrimitive()

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

Definition at line 2230 of file device.c.

2232 {
2234  HRESULT hr;
2235 
2236  TRACE("iface %p, primitive_type %#x, start_vertex %u, primitive_count %u.\n",
2237  iface, primitive_type, start_vertex, primitive_count);
2238 
2240  wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0);
2241  hr = wined3d_device_draw_primitive(device->wined3d_device, start_vertex,
2242  vertex_count_from_primitive_count(primitive_type, primitive_count));
2244 
2245  return hr;
2246 }
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:3774
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
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:3797
#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:365

◆ 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 2304 of file device.c.

2307 {
2309  HRESULT hr;
2310  UINT vtx_count = vertex_count_from_primitive_count(primitive_type, primitive_count);
2312  struct wined3d_box wined3d_box = {0};
2313  UINT size = vtx_count * stride;
2314  struct wined3d_resource *vb;
2315  UINT vb_pos, align;
2316 
2317  TRACE("iface %p, primitive_type %#x, primitive_count %u, data %p, stride %u.\n",
2318  iface, primitive_type, primitive_count, data, stride);
2319 
2320  if (!primitive_count)
2321  {
2322  WARN("primitive_count is 0, returning D3D_OK\n");
2323  return D3D_OK;
2324  }
2325 
2328  if (FAILED(hr))
2329  goto done;
2330 
2331  vb_pos = device->vertex_buffer_pos;
2332  align = vb_pos % stride;
2333  if (align) align = stride - align;
2334  if (vb_pos + size + align > device->vertex_buffer_size)
2335  vb_pos = 0;
2336  else
2337  vb_pos += align;
2338 
2339  wined3d_box.left = vb_pos;
2340  wined3d_box.right = vb_pos + size;
2341  vb = wined3d_buffer_get_resource(device->vertex_buffer);
2344  goto done;
2346  wined3d_resource_unmap(vb, 0);
2347  device->vertex_buffer_pos = vb_pos + size;
2348 
2349  hr = wined3d_device_set_stream_source(device->wined3d_device, 0, device->vertex_buffer, 0, stride);
2350  if (FAILED(hr))
2351  goto done;
2352 
2353  wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0);
2354  hr = wined3d_device_draw_primitive(device->wined3d_device, vb_pos / stride, vtx_count);
2355  wined3d_device_set_stream_source(device->wined3d_device, 0, NULL, 0, 0);
2356 
2357 done:
2359  return hr;
2360 }
UINT left
Definition: wined3d.h:1840
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:3774
HRESULT CDECL wined3d_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx)
Definition: resource.c:372
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
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:334
Definition: devices.h:37
HRESULT CDECL wined3d_device_draw_primitive(struct wined3d_device *device, UINT start_vertex, UINT vertex_count)
Definition: device.c:3797
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:1381
UINT right
Definition: wined3d.h:1842
#define WINED3D_MAP_DISCARD
Definition: wined3d.h:944
#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:947
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define WINED3D_MAP_NOOVERWRITE
Definition: wined3d.h:943
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:992
unsigned int UINT
Definition: ndis.h:50
static HRESULT d3d8_device_prepare_vertex_buffer(struct d3d8_device *device, UINT min_size)
Definition: device.c:2268
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ 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 3072 of file device.c.

3074 {
3075  FIXME("iface %p, handle %#x, segment_count %p, patch_info %p unimplemented.\n",
3076  iface, handle, segment_count, patch_info);
3077  return D3D_OK;
3078 }
#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 3080 of file device.c.

3082 {
3083  FIXME("iface %p, handle %#x, segment_count %p, patch_info %p unimplemented.\n",
3084  iface, handle, segment_count, patch_info);
3085  return D3D_OK;
3086 }
#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 1531 of file device.c.

1532 {
1534  HRESULT hr;
1535 
1536  TRACE("iface %p.\n", iface);
1537 
1539  hr = wined3d_device_end_scene(device->wined3d_device);
1541 
1542  return hr;
1543 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
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:365
HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device)
Definition: device.c:3674

◆ d3d8_device_EndStateBlock()

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

Definition at line 1852 of file device.c.

1853 {
1855  struct wined3d_stateblock *stateblock;
1856  HRESULT hr;
1857 
1858  TRACE("iface %p, token %p.\n", iface, token);
1859 
1860  /* Tell wineD3D to endstateblock before anything else (in case we run out
1861  * of memory later and cause locking problems)
1862  */
1864  hr = wined3d_device_end_stateblock(device->wined3d_device, &stateblock);
1865  if (FAILED(hr))
1866  {
1867  WARN("Failed to end the state block, %#x.\n", hr);
1869  return hr;
1870  }
1871 
1872  *token = d3d8_allocate_handle(&device->handle_table, stateblock, D3D8_HANDLE_SB);
1874 
1875  if (*token == D3D8_INVALID_HANDLE)
1876  {
1877  ERR("Failed to create a handle\n");
1879  wined3d_stateblock_decref(stateblock);
1881  return E_FAIL;
1882  }
1883  ++*token;
1884 
1885  TRACE("Returning %#x (%p).\n", *token, stateblock);
1886 
1887  return hr;
1888 }
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
HRESULT CDECL wined3d_device_end_stateblock(struct wined3d_device *device, struct wined3d_stateblock **stateblock)
Definition: device.c:3634
#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:444
#define TRACE(s)
Definition: solgame.cpp:4
ULONG CDECL wined3d_stateblock_decref(struct wined3d_stateblock *stateblock)
Definition: stateblock.c:551
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:365

◆ 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 2559 of file device.c.

2560 {
2561  struct d3d8_vertex_declaration *d3d8_declaration;
2562  struct FvfToDecl *convertedDecls = device->decls;
2563  int p, low, high; /* deliberately signed */
2564  HRESULT hr;
2565 
2566  TRACE("Searching for declaration for fvf %08x... ", fvf);
2567 
2568  low = 0;
2569  high = device->numConvertedDecls - 1;
2570  while (low <= high)
2571  {
2572  p = (low + high) >> 1;
2573  TRACE("%d ", p);
2574 
2575  if (convertedDecls[p].fvf == fvf)
2576  {
2577  TRACE("found %p\n", convertedDecls[p].declaration);
2578  return convertedDecls[p].declaration;
2579  }
2580 
2581  if (convertedDecls[p].fvf < fvf)
2582  low = p + 1;
2583  else
2584  high = p - 1;
2585  }
2586  TRACE("not found. Creating and inserting at position %d.\n", low);
2587 
2588  if (!(d3d8_declaration = heap_alloc(sizeof(*d3d8_declaration))))
2589  return NULL;
2590 
2591  if (FAILED(hr = d3d8_vertex_declaration_init_fvf(d3d8_declaration, device, fvf)))
2592  {
2593  WARN("Failed to initialize vertex declaration, hr %#x.\n", hr);
2594  heap_free(d3d8_declaration);
2595  return NULL;
2596  }
2597 
2598  if (device->declArraySize == device->numConvertedDecls)
2599  {
2600  UINT grow = device->declArraySize / 2;
2601 
2602  if (!(convertedDecls = heap_realloc(convertedDecls,
2603  sizeof(*convertedDecls) * (device->numConvertedDecls + grow))))
2604  {
2605  d3d8_vertex_declaration_destroy(d3d8_declaration);
2606  return NULL;
2607  }
2608  device->decls = convertedDecls;
2609  device->declArraySize += grow;
2610  }
2611 
2612  memmove(convertedDecls + low + 1, convertedDecls + low,
2613  sizeof(*convertedDecls) * (device->numConvertedDecls - low));
2614  convertedDecls[low].declaration = d3d8_declaration;
2615  convertedDecls[low].fvf = fvf;
2616  ++device->numConvertedDecls;
2617 
2618  TRACE("Returning %p. %u decls in array.\n", d3d8_declaration, device->numConvertedDecls);
2619 
2620  return d3d8_declaration;
2621 }
#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 629 of file device.c.

630 {
632  UINT ret;
633 
634  TRACE("iface %p.\n", iface);
635 
639 
640  return ret;
641 }
UINT CDECL wined3d_device_get_available_texture_mem(const struct wined3d_device *device)
Definition: device.c:1301
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
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:365

◆ d3d8_device_GetBackBuffer()

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

Definition at line 928 of file device.c.

930 {
934  struct d3d8_surface *surface_impl;
935 
936  TRACE("iface %p, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.\n",
937  iface, backbuffer_idx, backbuffer_type, backbuffer);
938 
939  /* backbuffer_type is ignored by native. */
940 
941  /* No need to check for backbuffer == NULL, Windows crashes in that case. */
943 
944  wined3d_swapchain = device->implicit_swapchain->wined3d_swapchain;
946  {
948  *backbuffer = NULL;
949  return D3DERR_INVALIDCALL;
950  }
951 
953  *backbuffer = &surface_impl->IDirect3DSurface8_iface;
954  IDirect3DSurface8_AddRef(*backbuffer);
955 
957  return D3D_OK;
958 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#define D3DERR_INVALIDCALL
#define IDirect3DSurface8_AddRef(p)
Definition: d3d8.h:309
IDirect3DSurface8 IDirect3DSurface8_iface
Definition: d3d8_private.h:177
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:3264
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:211
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d8_device_GetClipPlane()

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

Definition at line 1780 of file device.c.

1781 {
1783  HRESULT hr;
1784 
1785  TRACE("iface %p, index %u, plane %p.\n", iface, index, plane);
1786 
1788  hr = wined3d_device_get_clip_plane(device->wined3d_device, index, (struct wined3d_vec4 *)plane);
1790 
1791  return hr;
1792 }
HRESULT CDECL wined3d_device_get_clip_plane(const struct wined3d_device *device, UINT plane_idx, struct wined3d_vec4 *plane)
Definition: device.c:1814
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:360
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:365

◆ d3d8_device_GetClipStatus()

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

Definition at line 2020 of file device.c.

2021 {
2023  HRESULT hr;
2024 
2025  TRACE("iface %p, clip_status %p.\n", iface, clip_status);
2026 
2028  hr = wined3d_device_get_clip_status(device->wined3d_device, (struct wined3d_clip_status *)clip_status);
2030 
2031  return hr;
2032 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
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:1841
#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:365

◆ d3d8_device_GetCreationParameters()

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

Definition at line 714 of file device.c.

716 {
718 
719  TRACE("iface %p, parameters %p.\n", iface, parameters);
720 
723  (struct wined3d_device_creation_parameters *)parameters);
725 
726  return D3D_OK;
727 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
void CDECL wined3d_device_get_creation_parameters(const struct wined3d_device *device, struct wined3d_device_creation_parameters *parameters)
Definition: device.c:5076
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:365

◆ d3d8_device_GetCurrentTexturePalette()

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

Definition at line 2223 of file device.c.

2224 {
2225  FIXME("iface %p, palette_idx %p unimplemented.\n", iface, palette_idx);
2226 
2227  return D3DERR_INVALIDCALL;
2228 }
#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 1486 of file device.c.

1487 {
1489  struct wined3d_rendertarget_view *wined3d_dsv;
1490  struct d3d8_surface *surface_impl;
1491  HRESULT hr = D3D_OK;
1492 
1493  TRACE("iface %p, depth_stencil %p.\n", iface, depth_stencil);
1494 
1495  if (!depth_stencil)
1496  return D3DERR_INVALIDCALL;
1497 
1499  if ((wined3d_dsv = wined3d_device_get_depth_stencil_view(device->wined3d_device)))
1500  {
1501  /* We want the sub resource parent here, since the view itself may be
1502  * internal to wined3d and may not have a parent. */
1503  surface_impl = wined3d_rendertarget_view_get_sub_resource_parent(wined3d_dsv);
1504  *depth_stencil = &surface_impl->IDirect3DSurface8_iface;
1505  IDirect3DSurface8_AddRef(*depth_stencil);
1506  }
1507  else
1508  {
1509  hr = D3DERR_NOTFOUND;
1510  *depth_stencil = NULL;
1511  }
1513 
1514  return hr;
1515 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#define D3DERR_INVALIDCALL
struct wined3d_rendertarget_view *CDECL wined3d_device_get_depth_stencil_view(const struct wined3d_device *device)
Definition: device.c:4495
#define D3DERR_NOTFOUND
Definition: d3d8.h:80
#define IDirect3DSurface8_AddRef(p)
Definition: d3d8.h:309
IDirect3DSurface8 IDirect3DSurface8_iface
Definition: d3d8_private.h:177
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:365

◆ d3d8_device_GetDeviceCaps()

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

Definition at line 671 of file device.c.

672 {
674  WINED3DCAPS wined3d_caps;
675  HRESULT hr;
676 
677  TRACE("iface %p, caps %p.\n", iface, caps);
678 
679  if (!caps)
680  return D3DERR_INVALIDCALL;
681 
683  hr = wined3d_device_get_device_caps(device->wined3d_device, &wined3d_caps);
685 
686  d3dcaps_from_wined3dcaps(caps, &wined3d_caps);
687 
688  return hr;
689 }
HRESULT hr
Definition: shlfolder.c:183
HRESULT CDECL wined3d_device_get_device_caps(const struct wined3d_device *device, WINED3DCAPS *caps)
Definition: device.c:3583
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#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:324
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d8_device_GetDirect3D()

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

Definition at line 659 of file device.c.

660 {
662 
663  TRACE("iface %p, d3d8 %p.\n", iface, d3d8);
664 
665  if (!d3d8)
666  return D3DERR_INVALIDCALL;
667 
668  return IDirect3D8_QueryInterface(device->d3d_parent, &IID_IDirect3D8, (void **)d3d8);
669 }
#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 691 of file device.c.

692 {
694  struct wined3d_display_mode wined3d_mode;
695  HRESULT hr;
696 
697  TRACE("iface %p, mode %p.\n", iface, mode);
698 
700  hr = wined3d_device_get_display_mode(device->wined3d_device, 0, &wined3d_mode, NULL);
702 
703  if (SUCCEEDED(hr))
704  {
705  mode->Width = wined3d_mode.width;
706  mode->Height = wined3d_mode.height;
707  mode->RefreshRate = wined3d_mode.refresh_rate;
708  mode->Format = d3dformat_from_wined3dformat(wined3d_mode.format_id);
709  }
710 
711  return hr;
712 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
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:3598
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:365
#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 1359 of file device.c.

1360 {
1362  struct d3d8_surface *dst_impl = unsafe_impl_from_IDirect3DSurface8(dst_surface);
1363  HRESULT hr;
1364 
1365  TRACE("iface %p, dst_surface %p.\n", iface, dst_surface);
1366 
1367  if (!dst_surface)
1368  {
1369  WARN("Invalid destination surface passed.\n");
1370  return D3DERR_INVALIDCALL;
1371  }
1372 
1374  hr = wined3d_swapchain_get_front_buffer_data(device->implicit_swapchain->wined3d_swapchain,
1375  dst_impl->wined3d_texture, dst_impl->sub_resource_idx);
1377 
1378  return hr;
1379 }
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#define D3DERR_INVALIDCALL
Definition: devices.h:37
unsigned int sub_resource_idx
Definition: d3d8_private.h:180
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
struct wined3d_texture * wined3d_texture
Definition: d3d8_private.h:179
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:190
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d8_device_GetGammaRamp()

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

Definition at line 986 of file device.c.

987 {
989 
990  TRACE("iface %p, ramp %p.\n", iface, ramp);
991 
992  /* Note: D3DGAMMARAMP is compatible with struct wined3d_gamma_ramp. */
994  wined3d_device_get_gamma_ramp(device->wined3d_device, 0, (struct wined3d_gamma_ramp *)ramp);
996 }
void CDECL wined3d_device_get_gamma_ramp(const struct wined3d_device *device, UINT swapchain_idx, struct wined3d_gamma_ramp *ramp)
Definition: device.c:5103
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
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:365

◆ d3d8_device_GetIndices()

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

Definition at line 2853 of file device.c.

2855 {
2859  struct d3d8_indexbuffer *buffer_impl;
2860 
2861  TRACE("iface %p, buffer %p, base_vertex_index %p.\n", iface, buffer, base_vertex_index);
2862 
2863  if (!buffer)
2864  return D3DERR_INVALIDCALL;
2865 
2866  /* The case from UINT to INT is safe because d3d8 will never set negative values */
2868  *base_vertex_index = wined3d_device_get_base_vertex_index(device->wined3d_device);
2870  {
2872  *buffer = &buffer_impl->IDirect3DIndexBuffer8_iface;
2874  }
2875  else
2876  {
2877  *buffer = NULL;
2878  }
2880 
2881  return D3D_OK;
2882 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#define D3DERR_INVALIDCALL
GLuint buffer
Definition: glext.h:5915
IDirect3DIndexBuffer8 IDirect3DIndexBuffer8_iface
Definition: d3d8_private.h:211
void *CDECL wined3d_buffer_get_parent(const struct wined3d_buffer *buffer)
Definition: buffer.c:804
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:1909
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:1927
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d8_device_GetInfo()

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

Definition at line 2187 of file device.c.

2189 {
2190  TRACE("iface %p, info_id %#x, info %p, info_size %u.\n", iface, info_id, info, info_size);
2191 
2192  if (info_id < 4)
2193  return E_FAIL;
2194  return S_FALSE;
2195 }
#define E_FAIL
Definition: ddrawi.h:102
#define S_FALSE
Definition: winerror.h:2357
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3d8_device_GetLight()

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

Definition at line 1723 of file device.c.

1724 {
1726  HRESULT hr;
1727 
1728  TRACE("iface %p, index %u, light %p.\n", iface, index, light);
1729 
1730  /* Note: D3DLIGHT8 is compatible with struct wined3d_light. */
1732  hr = wined3d_device_get_light(device->wined3d_device, index, (struct wined3d_light *)light);
1734 
1735  return hr;
1736 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
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:1727
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d8_device_GetLightEnable()

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

Definition at line 1752 of file device.c.

1753 {
1755  HRESULT hr;
1756 
1757  TRACE("iface %p, index %u, enable %p.\n", iface, index, enable);
1758 
1760  hr = wined3d_device_get_light_enable(device->wined3d_device, index, enable);
1762 
1763  return hr;
1764 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
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:1770
#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:365

◆ d3d8_device_GetMaterial()

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

Definition at line 1694 of file device.c.

1695 {
1697 
1698  TRACE("iface %p, material %p.\n", iface, material);
1699 
1700  /* Note: D3DMATERIAL8 is compatible with struct wined3d_material. */
1702  wined3d_device_get_material(device->wined3d_device, (struct wined3d_material *)material);
1704 
1705  return D3D_OK;
1706 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
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:1864
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d8_device_GetPaletteEntries()

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

Definition at line 2208 of file device.c.

2210 {
2211  FIXME("iface %p, palette_idx %u, entries %p unimplemented.\n", iface, palette_idx, entries);
2212 
2213  return D3DERR_INVALIDCALL;
2214 }
#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 2961 of file device.c.

2962 {
2964  struct wined3d_shader *object;
2965 
2966  TRACE("iface %p, shader %p.\n", iface, shader);
2967 
2968  if (!shader)
2969  return D3DERR_INVALIDCALL;
2970 
2972  if ((object = wined3d_device_get_pixel_shader(device->wined3d_device)))
2973  {
2974  struct d3d8_pixel_shader *d3d8_shader;
2975  d3d8_shader = wined3d_shader_get_parent(object);
2976  *shader = d3d8_shader->handle;
2977  }
2978  else
2979  {
2980  *shader = 0;
2981  }
2983 
2984  TRACE("Returning %#x.\n", *shader);
2985 
2986  return D3D_OK;
2987 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#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:3436
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365
void * object
Definition: jmemsys.h:48
struct wined3d_shader *CDECL wined3d_device_get_pixel_shader(const struct wined3d_device *device)
Definition: device.c:2570

◆ d3d8_device_GetPixelShaderConstant()

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

Definition at line 3031 of file device.c.

3033 {
3035  HRESULT hr;
3036 
3037  TRACE("iface %p, start_register %u, data %p, count %u.\n",
3038  iface, start_register, data, count);
3039 
3041  hr = wined3d_device_get_ps_consts_f(device->wined3d_device, start_register, count, data);
3043 
3044  return hr;
3045 }
HRESULT hr
Definition: shlfolder.c:183
GLuint GLuint GLsizei count
Definition: gl.h:1545
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
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:365
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:2748

◆ d3d8_device_GetPixelShaderFunction()

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

Definition at line 3047 of file device.c.

3049 {
3051  struct d3d8_pixel_shader *shader_impl = NULL;
3052  HRESULT hr;
3053 
3054  TRACE("iface %p, shader %#x, data %p, data_size %p.\n",
3055  iface, shader, data, data_size);
3056 
3058  if (!(shader_impl = d3d8_get_object(&device->handle_table, shader - (VS_HIGHESTFIXEDFXF + 1), D3D8_HANDLE_PS)))
3059  {
3060  WARN("Invalid handle (%#x) passed.\n", shader);
3062 
3063  return D3DERR_INVALIDCALL;
3064  }
3065 
3066  hr = wined3d_shader_get_byte_code(shader_impl->wined3d_shader, data, data_size);
3068 
3069  return hr;
3070 }
HRESULT CDECL wined3d_shader_get_byte_code(const struct wined3d_shader *shader, void *byte_code, UINT *byte_code_size)
Definition: shader.c:3443
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#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:268
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:365
static void * d3d8_get_object(struct d3d8_handle_table *t, DWORD handle, enum d3d8_handle_type type)
Definition: device.c:513

◆ d3d8_device_GetRasterStatus()

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

Definition at line 960 of file device.c.

961 {
963  HRESULT hr;
964 
965  TRACE("iface %p, raster_status %p.\n", iface, raster_status);
966 
968  hr = wined3d_device_get_raster_status(device->wined3d_device, 0, (struct wined3d_raster_status *)raster_status);
970 
971  return hr;
972 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
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:4035
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d8_device_GetRenderState()

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

Definition at line 1816 of file device.c.

1818 {
1820 
1821  TRACE("iface %p, state %#x, value %p.\n", iface, state, value);
1822 
1824  switch (state)
1825  {
1826  case D3DRS_ZBIAS:
1828  break;
1829 
1830  default:
1831  *value = wined3d_device_get_render_state(device->wined3d_device, state);
1832  }
1834 
1835  return D3D_OK;
1836 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
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:365
DWORD CDECL wined3d_device_get_render_state(const struct wined3d_device *device, enum wined3d_render_state state)
Definition: device.c:2085

◆ d3d8_device_GetRenderTarget()

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

Definition at line 1453 of file device.c.

1454 {
1456  struct wined3d_rendertarget_view *wined3d_rtv;
1457  struct d3d8_surface *surface_impl;
1458  HRESULT hr;
1459 
1460  TRACE("iface %p, render_target %p.\n", iface, render_target);
1461 
1462  if (!render_target)
1463  return D3DERR_INVALIDCALL;
1464 
1466  if ((wined3d_rtv = wined3d_device_get_rendertarget_view(device->wined3d_device, 0)))
1467  {
1468  /* We want the sub resource parent here, since the view itself may be
1469  * internal to wined3d and may not have a parent. */
1471  *render_target = &surface_impl->IDirect3DSurface8_iface;
1472  IDirect3DSurface8_AddRef(*render_target);
1473  hr = D3D_OK;
1474  }
1475  else
1476  {
1477  ERR("Failed to get wined3d render target.\n");
1478  *render_target = NULL;
1479  hr = D3DERR_NOTFOUND;
1480  }
1482 
1483  return hr;
1484 }
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:4481
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#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:177
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:182
#define D3D_OK
Definition: d3d.h:106
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d8_device_GetStreamSource()

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

Definition at line 3112 of file device.c.

3114 {
3116  struct d3d8_vertexbuffer *buffer_impl;
3118  HRESULT hr;
3119 
3120  TRACE("iface %p, stream_idx %u, buffer %p, stride %p.\n",
3121  iface, stream_idx, buffer, stride);
3122 
3123  if (!buffer)
3124  return D3DERR_INVALIDCALL;
3125 
3127  hr = wined3d_device_get_stream_source(device->wined3d_device, stream_idx, &wined3d_buffer, 0, stride);
3128  if (SUCCEEDED(hr) && wined3d_buffer)
3129  {
3131  *buffer = &buffer_impl->IDirect3DVertexBuffer8_iface;
3133  }
3134  else
3135  {
3136  if (FAILED(hr))
3137  ERR("Failed to get wined3d stream source, hr %#x.\n", hr);
3138  *buffer = NULL;
3139  }
3141 
3142  return hr;
3143 }
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:1431
#define IDirect3DVertexBuffer8_AddRef(p)
Definition: d3d8.h:417
HRESULT hr
Definition: shlfolder.c:183
IDirect3DVertexBuffer8 IDirect3DVertexBuffer8_iface
Definition: d3d8_private.h:198
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#define D3DERR_INVALIDCALL
GLuint buffer
Definition: glext.h:5915
void *CDECL wined3d_buffer_get_parent(const struct wined3d_buffer *buffer)
Definition: buffer.c:804
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:365
#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 2034 of file device.c.

2035 {
2038  struct d3d8_texture *texture_impl;
2039 
2040  TRACE("iface %p, stage %u, texture %p.\n", iface, stage, texture);
2041 
2042  if (!texture)
2043  return D3DERR_INVALIDCALL;
2044 
2046  if ((wined3d_texture = wined3d_device_get_texture(device->wined3d_device, stage)))
2047  {
2049  *texture = &texture_impl->IDirect3DBaseTexture8_iface;
2051  }
2052  else
2053  {
2054  *texture = NULL;
2055  }
2057 
2058  return D3D_OK;
2059 }
void *CDECL wined3d_texture_get_parent(const struct wined3d_texture *texture)
Definition: texture.c:1317
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#define D3DERR_INVALIDCALL
IDirect3DBaseTexture8 IDirect3DBaseTexture8_iface
Definition: d3d8_private.h:224
#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:3567
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d8_device_GetTextureStageState()

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

Definition at line 2121 of file device.c.

2123 {
2125  const struct tss_lookup *l;
2126 
2127  TRACE("iface %p, stage %u, state %#x, value %p.\n", iface, stage, Type, value);
2128 
2129  if (Type >= sizeof(tss_lookup) / sizeof(*tss_lookup))
2130  {
2131  WARN("Invalid Type %#x passed.\n", Type);
2132  return D3D_OK;
2133  }
2134 
2135  l = &tss_lookup[Type];
2136 
2138  if (l->sampler_state)
2139  *value = wined3d_device_get_sampler_state(device->wined3d_device, stage, l->u.sampler_state);
2140  else
2141  *value = wined3d_device_get_texture_stage_state(device->wined3d_device, stage, l->u.texture_state);
2143 
2144  return D3D_OK;
2145 }
DWORD CDECL wined3d_device_get_sampler_state(const struct wined3d_device *device, UINT sampler_idx, enum wined3d_sampler_state state)
Definition: device.c:2129
Type
Definition: Type.h:6
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
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:3504
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365

◆ d3d8_device_GetTransform()

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

Definition at line 1589 of file device.c.

1591 {
1593 
1594  TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
1595 
1596  /* Note: D3DMATRIX is compatible with struct wined3d_matrix. */
1598  wined3d_device_get_transform(device->wined3d_device, state, (struct wined3d_matrix *)matrix);
1600 
1601  return D3D_OK;
1602 }
void CDECL wined3d_device_get_transform(const struct wined3d_device *device, enum wined3d_transform_state state, struct wined3d_matrix *matrix)
Definition: device.c:1543
GLuint GLenum matrix
Definition: glext.h:9407
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
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:365

◆ d3d8_device_GetVertexShader()

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

Definition at line 2662 of file device.c.

2663 {
2665  struct wined3d_vertex_declaration *wined3d_declaration;
2666  struct d3d8_vertex_declaration *d3d8_declaration;
2667 
2668  TRACE("iface %p, shader %p.\n", iface, shader);
2669 
2671  if ((wined3d_declaration = wined3d_device_get_vertex_declaration(device->wined3d_device)))
2672  {
2673  d3d8_declaration = wined3d_vertex_declaration_get_parent(wined3d_declaration);
2674  *shader = d3d8_declaration->shader_handle;
2675  }
2676  else
2677  {
2678  *shader = 0;
2679  }
2681 
2682  TRACE("Returning %#x.\n", *shader);
2683 
2684  return D3D_OK;
2685 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
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:2219
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:365
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 2737 of file device.c.

2739 {
2741  HRESULT hr;
2742 
2743  TRACE("iface %p, start_register %u, data %p, count %u.\n",
2744  iface, start_register, data, count);
2745 
2746  if (start_register + count > D3D8_MAX_VERTEX_SHADER_CONSTANTF)
2747  {
2748  WARN("Trying to access %u constants, but d3d8 only supports %u\n",
2749  start_register + count, D3D8_MAX_VERTEX_SHADER_CONSTANTF);
2750  return D3DERR_INVALIDCALL;
2751  }
2752 
2754  hr = wined3d_device_get_vs_consts_f(device->wined3d_device, start_register, count, data);
2756 
2757  return hr;
2758 }
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:360
#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:263
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
Definition: d3d8_private.h:132
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365
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:2532

◆ d3d8_device_GetVertexShaderDeclaration()

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

Definition at line 2760 of file device.c.

2762 {
2765  struct d3d8_vertex_shader *shader_impl;
2766 
2767  TRACE("iface %p, shader %#x, data %p, data_size %p.\n",
2768  iface, shader, data, data_size);
2769 
2771  shader_impl = d3d8_get_object(&device->handle_table, shader - (VS_HIGHESTFIXEDFXF + 1), D3D8_HANDLE_VS);
2773 
2774  if (!shader_impl)
2775  {
2776  WARN("Invalid handle (%#x) passed.\n", shader);
2777  return D3DERR_INVALIDCALL;
2778  }
2779  declaration = shader_impl->vertex_declaration;
2780 
2781  if (!data)
2782  {
2783  *data_size = declaration->elements_size;
2784  return D3D_OK;
2785  }
2786 
2787  /* MSDN claims that if *data_size is smaller than the required size
2788  * we should write the required size and return D3DERR_MOREDATA.
2789  * That's not actually true. */
2790  if (*data_size < declaration->elements_size)
2791  return D3DERR_INVALIDCALL;
2792 
2793  memcpy(data, declaration->elements, declaration->elements_size);
2794 
2795  return D3D_OK;
2796 }
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#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:255
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365
static void * d3d8_get_object(struct d3d8_handle_table *t, DWORD handle, enum d3d8_handle_type type)
Definition: device.c:513

◆ d3d8_device_GetVertexShaderFunction()

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

Definition at line 2798 of file device.c.

2800 {
2802  struct d3d8_vertex_shader *shader_impl = NULL;
2803  HRESULT hr;
2804 
2805  TRACE("iface %p, shader %#x, data %p, data_size %p.\n",
2806  iface, shader, data, data_size);
2807 
2809  if (!(shader_impl = d3d8_get_object(&device->handle_table, shader - (VS_HIGHESTFIXEDFXF + 1), D3D8_HANDLE_VS)))
2810  {
2811  WARN("Invalid handle (%#x) passed.\n", shader);
2813 
2814  return D3DERR_INVALIDCALL;
2815  }
2816 
2817  if (!shader_impl->wined3d_shader)
2818  {
2820  *data_size = 0;
2821  return D3D_OK;
2822  }
2823 
2824  hr = wined3d_shader_get_byte_code(shader_impl->wined3d_shader, data, data_size);
2826 
2827  return hr;
2828 }
HRESULT CDECL wined3d_shader_get_byte_code(const struct wined3d_shader *shader, void *byte_code, UINT *byte_code_size)
Definition: shader.c:3443
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#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:256
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:365
static void * d3d8_get_object(struct d3d8_handle_table *t, DWORD handle, enum d3d8_handle_type type)
Definition: device.c:513

◆ d3d8_device_GetViewport()

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

Definition at line 1659 of file device.c.

1660 {
1663 
1664  TRACE("iface %p, viewport %p.\n", iface, viewport);
1665 
1669 
1670  viewport->X = wined3d_viewport.x;
1671  viewport->Y = wined3d_viewport.y;
1672  viewport->Width = wined3d_viewport.width;
1673  viewport->Height = wined3d_viewport.height;
1674  viewport->MinZ = wined3d_viewport.min_z;
1675  viewport->MaxZ = wined3d_viewport.max_z;
1676 
1677  return D3D_OK;
1678 }
void CDECL wined3d_device_get_viewports(const struct wined3d_device *device, unsigned int *viewport_count, struct wined3d_viewport *viewports)
Definition: device.c:1964
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
#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:365

◆ d3d8_device_LightEnable()

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

Definition at line 1738 of file device.c.

1739 {
1741  HRESULT hr;
1742 
1743  TRACE("iface %p, index %u, enable %#x.\n", iface, index, enable);
1744 
1746  hr = wined3d_device_set_light_enable(device->wined3d_device, index, enable);
1748 
1749  return hr;
1750 }
<