058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync/*
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * Direct3D 9 private include file
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync *
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * Copyright 2002-2003 Jason Edmeades
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * Copyright 2002-2003 Raphael Junqueira
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * Copyright 2005 Oliver Stieber
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync *
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * This library is free software; you can redistribute it and/or
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * modify it under the terms of the GNU Lesser General Public
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * License as published by the Free Software Foundation; either
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * version 2.1 of the License, or (at your option) any later version.
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync *
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * This library is distributed in the hope that it will be useful,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * but WITHOUT ANY WARRANTY; without even the implied warranty of
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * Lesser General Public License for more details.
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync *
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * You should have received a copy of the GNU Lesser General Public
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * License along with this library; if not, write to the Free Software
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync */
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
4237d5a79f48789aacc67dc43378d2d7813a39f4vboxsync/*
4237d5a79f48789aacc67dc43378d2d7813a39f4vboxsync * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
4237d5a79f48789aacc67dc43378d2d7813a39f4vboxsync * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
4237d5a79f48789aacc67dc43378d2d7813a39f4vboxsync * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
4237d5a79f48789aacc67dc43378d2d7813a39f4vboxsync * a choice of LGPL license versions is made available with the language indicating
4237d5a79f48789aacc67dc43378d2d7813a39f4vboxsync * that LGPLv2 or any later version may be used, or where a choice of which version
4237d5a79f48789aacc67dc43378d2d7813a39f4vboxsync * of the LGPL is applied is otherwise unspecified.
4237d5a79f48789aacc67dc43378d2d7813a39f4vboxsync */
4237d5a79f48789aacc67dc43378d2d7813a39f4vboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#ifndef __WINE_D3D9_PRIVATE_H
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#define __WINE_D3D9_PRIVATE_H
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#include <assert.h>
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#include <stdarg.h>
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#define NONAMELESSUNION
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#define NONAMELESSSTRUCT
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#define COBJMACROS
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#ifndef VBOX_WINE_WITHOUT_LIBWINE
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#include "windef.h"
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#include "winbase.h"
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#include "wingdi.h"
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#include "winuser.h"
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#else
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#include <windows.h>
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#endif
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#include "wine/debug.h"
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#include "wine/unicode.h"
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#include "d3d9.h"
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#include "wine/wined3d.h"
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncextern HRESULT vdecl_convert_fvf(DWORD FVF, D3DVERTEXELEMENT9 **ppVertexElements) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncD3DFORMAT d3dformat_from_wined3dformat(enum wined3d_format_id format) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncenum wined3d_format_id wined3dformat_from_d3dformat(D3DFORMAT format) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncvoid present_parameters_from_wined3d_swapchain_desc(D3DPRESENT_PARAMETERS *present_parameters,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync const struct wined3d_swapchain_desc *swapchain_desc) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#define WINECAPSTOD3D9CAPS(_pD3D9Caps, _pWineCaps) \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->DeviceType = (D3DDEVTYPE) _pWineCaps->DeviceType; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->AdapterOrdinal = _pWineCaps->AdapterOrdinal; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->Caps = _pWineCaps->Caps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->Caps2 = _pWineCaps->Caps2; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->Caps3 = _pWineCaps->Caps3; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->PresentationIntervals = _pWineCaps->PresentationIntervals; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->CursorCaps = _pWineCaps->CursorCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->DevCaps = _pWineCaps->DevCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->PrimitiveMiscCaps = _pWineCaps->PrimitiveMiscCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->RasterCaps = _pWineCaps->RasterCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->ZCmpCaps = _pWineCaps->ZCmpCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->SrcBlendCaps = _pWineCaps->SrcBlendCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->DestBlendCaps = _pWineCaps->DestBlendCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->AlphaCmpCaps = _pWineCaps->AlphaCmpCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->ShadeCaps = _pWineCaps->ShadeCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->TextureCaps = _pWineCaps->TextureCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->TextureFilterCaps = _pWineCaps->TextureFilterCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->CubeTextureFilterCaps = _pWineCaps->CubeTextureFilterCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->VolumeTextureFilterCaps = _pWineCaps->VolumeTextureFilterCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->TextureAddressCaps = _pWineCaps->TextureAddressCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->VolumeTextureAddressCaps = _pWineCaps->VolumeTextureAddressCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->LineCaps = _pWineCaps->LineCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->MaxTextureWidth = _pWineCaps->MaxTextureWidth; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->MaxTextureHeight = _pWineCaps->MaxTextureHeight; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->MaxVolumeExtent = _pWineCaps->MaxVolumeExtent; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->MaxTextureRepeat = _pWineCaps->MaxTextureRepeat; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->MaxTextureAspectRatio = _pWineCaps->MaxTextureAspectRatio; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->MaxAnisotropy = _pWineCaps->MaxAnisotropy; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->MaxVertexW = _pWineCaps->MaxVertexW; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->GuardBandLeft = _pWineCaps->GuardBandLeft; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->GuardBandTop = _pWineCaps->GuardBandTop; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->GuardBandRight = _pWineCaps->GuardBandRight; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->GuardBandBottom = _pWineCaps->GuardBandBottom; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->ExtentsAdjust = _pWineCaps->ExtentsAdjust; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->StencilCaps = _pWineCaps->StencilCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->FVFCaps = _pWineCaps->FVFCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->TextureOpCaps = _pWineCaps->TextureOpCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->MaxTextureBlendStages = _pWineCaps->MaxTextureBlendStages; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->MaxSimultaneousTextures = _pWineCaps->MaxSimultaneousTextures; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->VertexProcessingCaps = _pWineCaps->VertexProcessingCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->MaxActiveLights = _pWineCaps->MaxActiveLights; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->MaxUserClipPlanes = _pWineCaps->MaxUserClipPlanes; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->MaxVertexBlendMatrices = _pWineCaps->MaxVertexBlendMatrices; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->MaxVertexBlendMatrixIndex = _pWineCaps->MaxVertexBlendMatrixIndex; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->MaxPointSize = _pWineCaps->MaxPointSize; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->MaxPrimitiveCount = _pWineCaps->MaxPrimitiveCount; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->MaxVertexIndex = _pWineCaps->MaxVertexIndex; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->MaxStreams = _pWineCaps->MaxStreams; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->MaxStreamStride = _pWineCaps->MaxStreamStride; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->VertexShaderVersion = _pWineCaps->VertexShaderVersion; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->MaxVertexShaderConst = _pWineCaps->MaxVertexShaderConst; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->PixelShaderVersion = _pWineCaps->PixelShaderVersion; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->PixelShader1xMaxValue = _pWineCaps->PixelShader1xMaxValue; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->DevCaps2 = _pWineCaps->DevCaps2; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->MaxNpatchTessellationLevel = _pWineCaps->MaxNpatchTessellationLevel; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->MasterAdapterOrdinal = _pWineCaps->MasterAdapterOrdinal; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->AdapterOrdinalInGroup = _pWineCaps->AdapterOrdinalInGroup; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->NumberOfAdaptersInGroup = _pWineCaps->NumberOfAdaptersInGroup; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->DeclTypes = _pWineCaps->DeclTypes; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->NumSimultaneousRTs = _pWineCaps->NumSimultaneousRTs; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->StretchRectFilterCaps = _pWineCaps->StretchRectFilterCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->VS20Caps.Caps = _pWineCaps->VS20Caps.caps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->VS20Caps.DynamicFlowControlDepth = _pWineCaps->VS20Caps.dynamic_flow_control_depth; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->VS20Caps.NumTemps = _pWineCaps->VS20Caps.temp_count; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->VS20Caps.StaticFlowControlDepth = _pWineCaps->VS20Caps.static_flow_control_depth; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->PS20Caps.Caps = _pWineCaps->PS20Caps.caps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->PS20Caps.DynamicFlowControlDepth = _pWineCaps->PS20Caps.dynamic_flow_control_depth; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->PS20Caps.NumTemps = _pWineCaps->PS20Caps.temp_count; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->PS20Caps.StaticFlowControlDepth = _pWineCaps->PS20Caps.static_flow_control_depth; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->PS20Caps.NumInstructionSlots = _pWineCaps->PS20Caps.instruction_slot_count; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->VertexTextureFilterCaps = _pWineCaps->VertexTextureFilterCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->MaxVShaderInstructionsExecuted = _pWineCaps->MaxVShaderInstructionsExecuted; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->MaxPShaderInstructionsExecuted = _pWineCaps->MaxPShaderInstructionsExecuted; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->MaxVertexShader30InstructionSlots = _pWineCaps->MaxVertexShader30InstructionSlots; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D9Caps->MaxPixelShader30InstructionSlots = _pWineCaps->MaxPixelShader30InstructionSlots;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d9
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync{
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3D9Ex IDirect3D9Ex_iface;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync LONG refcount;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct wined3d *wined3d;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync BOOL extended;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync};
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncBOOL d3d9_init(struct d3d9 *d3d9, BOOL extended) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncvoid filter_caps(D3DCAPS9* pCaps) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct fvf_declaration
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync{
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct wined3d_vertex_declaration *decl;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync DWORD fvf;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync};
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d9_device
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync{
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DDevice9Ex IDirect3DDevice9Ex_iface;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct wined3d_device_parent device_parent;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync LONG refcount;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct wined3d_device *wined3d_device;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct d3d9 *d3d_parent;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct fvf_declaration *fvf_decls;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync UINT fvf_decl_count, fvf_decl_size;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct wined3d_buffer *vertex_buffer;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync UINT vertex_buffer_size;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync UINT vertex_buffer_pos;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct wined3d_buffer *index_buffer;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync UINT index_buffer_size;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync UINT index_buffer_pos;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync BOOL in_destruction;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync BOOL not_reset;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync BOOL in_scene;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync};
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncHRESULT device_init(struct d3d9_device *device, struct d3d9 *parent, struct wined3d *wined3d,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync UINT adapter, D3DDEVTYPE device_type, HWND focus_window, DWORD flags
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#ifdef VBOX_WITH_WDDM
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync , VBOXWINEEX_D3DPRESENT_PARAMETERS *parameters
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#else
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync , D3DPRESENT_PARAMETERS *parameters
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#endif
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync , D3DDISPLAYMODEEX *mode) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d9_volume
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync{
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DVolume9 IDirect3DVolume9_iface;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync LONG refcount;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct wined3d_volume *wined3d_volume;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IUnknown *container;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IUnknown *forwardReference;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync};
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncHRESULT volume_init(struct d3d9_volume *volume, struct d3d9_device *device, UINT width, UINT height,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync UINT depth, DWORD usage, enum wined3d_format_id format, enum wined3d_pool pool
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#ifdef VBOX_WITH_WDDM
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync , HANDLE *shared_handle
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync , void *pvClientMem
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#endif
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync ) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d9_swapchain
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync{
76f3927069cc452e77bf72f32d9175c0256ed3b3vboxsync IDirect3DSwapChain9Ex IDirect3DSwapChain9Ex_iface;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync LONG refcount;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct wined3d_swapchain *wined3d_swapchain;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DDevice9Ex *parent_device;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync};
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncHRESULT d3d9_swapchain_create(struct d3d9_device *device, struct wined3d_swapchain_desc *desc,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct d3d9_swapchain **swapchain) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d9_surface
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync{
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DSurface9 IDirect3DSurface9_iface;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync LONG refcount;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct wined3d_surface *wined3d_surface;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DDevice9Ex *parent_device;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IUnknown *container;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IUnknown *forwardReference;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync BOOL getdc_supported;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync};
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncHRESULT surface_init(struct d3d9_surface *surface, struct d3d9_device *device, UINT width, UINT height,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync D3DFORMAT format, DWORD flags, DWORD usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync DWORD multisample_quality
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#ifdef VBOX_WITH_WDDM
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync , HANDLE *shared_handle
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync , void *pvClientMem
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#endif
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync ) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d9_surface *unsafe_impl_from_IDirect3DSurface9(IDirect3DSurface9 *iface) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d9_vertexbuffer
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync{
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DVertexBuffer9 IDirect3DVertexBuffer9_iface;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync LONG refcount;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct wined3d_buffer *wined3d_buffer;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DDevice9Ex *parent_device;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync DWORD fvf;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync};
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncHRESULT vertexbuffer_init(struct d3d9_vertexbuffer *buffer, struct d3d9_device *device,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync UINT size, UINT usage, DWORD fvf, D3DPOOL pool) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d9_vertexbuffer *unsafe_impl_from_IDirect3DVertexBuffer9(IDirect3DVertexBuffer9 *iface) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d9_indexbuffer
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync{
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DIndexBuffer9 IDirect3DIndexBuffer9_iface;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync LONG refcount;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct wined3d_buffer *wined3d_buffer;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DDevice9Ex *parent_device;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync enum wined3d_format_id format;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync};
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncHRESULT indexbuffer_init(struct d3d9_indexbuffer *buffer, struct d3d9_device *device,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync UINT size, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d9_indexbuffer *unsafe_impl_from_IDirect3DIndexBuffer9(IDirect3DIndexBuffer9 *iface) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d9_texture
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync{
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DBaseTexture9 IDirect3DBaseTexture9_iface;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync LONG refcount;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct wined3d_texture *wined3d_texture;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DDevice9Ex *parent_device;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync};
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncHRESULT cubetexture_init(struct d3d9_texture *texture, struct d3d9_device *device,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync UINT edge_length, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#ifdef VBOX_WITH_WDDM
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync , HANDLE *shared_handle
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync , void **pavClientMem
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#endif
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync ) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncHRESULT texture_init(struct d3d9_texture *texture, struct d3d9_device *device,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#ifdef VBOX_WITH_WDDM
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync , HANDLE *shared_handle
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync , void **pavClientMem
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#endif
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync ) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncHRESULT volumetexture_init(struct d3d9_texture *texture, struct d3d9_device *device,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync UINT width, UINT height, UINT depth, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#ifdef VBOX_WITH_WDDM
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync , HANDLE *shared_handle
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync , void **pavClientMem
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#endif
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync ) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d9_texture *unsafe_impl_from_IDirect3DBaseTexture9(IDirect3DBaseTexture9 *iface) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d9_stateblock
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync{
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DStateBlock9 IDirect3DStateBlock9_iface;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync LONG refcount;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct wined3d_stateblock *wined3d_stateblock;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DDevice9Ex *parent_device;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync};
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncHRESULT stateblock_init(struct d3d9_stateblock *stateblock, struct d3d9_device *device,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync D3DSTATEBLOCKTYPE type, struct wined3d_stateblock *wined3d_stateblock) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d9_vertex_declaration
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync{
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DVertexDeclaration9 IDirect3DVertexDeclaration9_iface;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync LONG refcount;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync D3DVERTEXELEMENT9 *elements;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync UINT element_count;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct wined3d_vertex_declaration *wined3d_declaration;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync DWORD fvf;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DDevice9Ex *parent_device;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync};
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncHRESULT d3d9_vertex_declaration_create(struct d3d9_device *device,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync const D3DVERTEXELEMENT9 *elements, struct d3d9_vertex_declaration **declaration) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d9_vertex_declaration *unsafe_impl_from_IDirect3DVertexDeclaration9(
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DVertexDeclaration9 *iface) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d9_vertexshader
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync{
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DVertexShader9 IDirect3DVertexShader9_iface;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync LONG refcount;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct wined3d_shader *wined3d_shader;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DDevice9Ex *parent_device;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync};
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncHRESULT vertexshader_init(struct d3d9_vertexshader *shader,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct d3d9_device *device, const DWORD *byte_code) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d9_vertexshader *unsafe_impl_from_IDirect3DVertexShader9(IDirect3DVertexShader9 *iface) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#define D3D9_MAX_VERTEX_SHADER_CONSTANTF 256
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#define D3D9_MAX_SIMULTANEOUS_RENDERTARGETS 4
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d9_pixelshader
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync{
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DPixelShader9 IDirect3DPixelShader9_iface;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync LONG refcount;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct wined3d_shader *wined3d_shader;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DDevice9Ex *parent_device;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync};
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncHRESULT pixelshader_init(struct d3d9_pixelshader *shader,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct d3d9_device *device, const DWORD *byte_code) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d9_pixelshader *unsafe_impl_from_IDirect3DPixelShader9(IDirect3DPixelShader9 *iface) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d9_query
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync{
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DQuery9 IDirect3DQuery9_iface;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync LONG refcount;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct wined3d_query *wined3d_query;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DDevice9Ex *parent_device;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync};
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncHRESULT query_init(struct d3d9_query *query, struct d3d9_device *device, D3DQUERYTYPE type) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
76f3927069cc452e77bf72f32d9175c0256ed3b3vboxsyncstatic inline struct d3d9_device *impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
76f3927069cc452e77bf72f32d9175c0256ed3b3vboxsync{
76f3927069cc452e77bf72f32d9175c0256ed3b3vboxsync return CONTAINING_RECORD(iface, struct d3d9_device, IDirect3DDevice9Ex_iface);
76f3927069cc452e77bf72f32d9175c0256ed3b3vboxsync}
76f3927069cc452e77bf72f32d9175c0256ed3b3vboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#ifdef VBOX_WITH_WDDM
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d9_volume *unsafe_impl_from_IDirect3DVolume9(IDirect3DVolume9 *iface) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#endif
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#endif /* __WINE_D3D9_PRIVATE_H */