058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync/*
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * Direct3D 8 private include file
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync *
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * Copyright 2002-2004 Jason Edmeades
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * Copyright 2003-2004 Raphael Junqueira
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * Copyright 2004 Christian Costa
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_D3D8_PRIVATE_H
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#define __WINE_D3D8_PRIVATE_H
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#include <assert.h>
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#include <stdarg.h>
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#define NONAMELESSUNION
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#define NONAMELESSSTRUCT
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#define COBJMACROS
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#include "windef.h"
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#include "winbase.h"
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#include "wingdi.h"
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#include "wine/debug.h"
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#include "d3d8.h"
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#include "wine/wined3d.h"
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync/* CreateVertexShader can return > 0xFFFF */
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#define VS_HIGHESTFIXEDFXF 0xF0000000
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync/* ===========================================================================
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync Macros
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync =========================================================================== */
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync/* Not nice, but it lets wined3d support different versions of directx */
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#define WINECAPSTOD3D8CAPS(_pD3D8Caps, _pWineCaps) \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->DeviceType = (D3DDEVTYPE) _pWineCaps->DeviceType; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->AdapterOrdinal = _pWineCaps->AdapterOrdinal; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->Caps = _pWineCaps->Caps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->Caps2 = _pWineCaps->Caps2; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->Caps3 = _pWineCaps->Caps3; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->PresentationIntervals = _pWineCaps->PresentationIntervals; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->CursorCaps = _pWineCaps->CursorCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->DevCaps = _pWineCaps->DevCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->PrimitiveMiscCaps = _pWineCaps->PrimitiveMiscCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->RasterCaps = _pWineCaps->RasterCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->ZCmpCaps = _pWineCaps->ZCmpCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->SrcBlendCaps = _pWineCaps->SrcBlendCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->DestBlendCaps = _pWineCaps->DestBlendCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->AlphaCmpCaps = _pWineCaps->AlphaCmpCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->ShadeCaps = _pWineCaps->ShadeCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->TextureCaps = _pWineCaps->TextureCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->TextureFilterCaps = _pWineCaps->TextureFilterCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->CubeTextureFilterCaps = _pWineCaps->CubeTextureFilterCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->VolumeTextureFilterCaps = _pWineCaps->VolumeTextureFilterCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->TextureAddressCaps = _pWineCaps->TextureAddressCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->VolumeTextureAddressCaps = _pWineCaps->VolumeTextureAddressCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->LineCaps = _pWineCaps->LineCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->MaxTextureWidth = _pWineCaps->MaxTextureWidth; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->MaxTextureHeight = _pWineCaps->MaxTextureHeight; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->MaxVolumeExtent = _pWineCaps->MaxVolumeExtent; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->MaxTextureRepeat = _pWineCaps->MaxTextureRepeat; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->MaxTextureAspectRatio = _pWineCaps->MaxTextureAspectRatio; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->MaxAnisotropy = _pWineCaps->MaxAnisotropy; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->MaxVertexW = _pWineCaps->MaxVertexW; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->GuardBandLeft = _pWineCaps->GuardBandLeft; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->GuardBandTop = _pWineCaps->GuardBandTop; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->GuardBandRight = _pWineCaps->GuardBandRight; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->GuardBandBottom = _pWineCaps->GuardBandBottom; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->ExtentsAdjust = _pWineCaps->ExtentsAdjust; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->StencilCaps = _pWineCaps->StencilCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->FVFCaps = _pWineCaps->FVFCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->TextureOpCaps = _pWineCaps->TextureOpCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->MaxTextureBlendStages = _pWineCaps->MaxTextureBlendStages; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->MaxSimultaneousTextures = _pWineCaps->MaxSimultaneousTextures; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->VertexProcessingCaps = _pWineCaps->VertexProcessingCaps; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->MaxActiveLights = _pWineCaps->MaxActiveLights; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->MaxUserClipPlanes = _pWineCaps->MaxUserClipPlanes; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->MaxVertexBlendMatrices = _pWineCaps->MaxVertexBlendMatrices; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->MaxVertexBlendMatrixIndex = _pWineCaps->MaxVertexBlendMatrixIndex; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->MaxPointSize = _pWineCaps->MaxPointSize; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->MaxPrimitiveCount = _pWineCaps->MaxPrimitiveCount; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->MaxVertexIndex = _pWineCaps->MaxVertexIndex; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->MaxStreams = _pWineCaps->MaxStreams; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->MaxStreamStride = _pWineCaps->MaxStreamStride; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->VertexShaderVersion = _pWineCaps->VertexShaderVersion; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->MaxVertexShaderConst = _pWineCaps->MaxVertexShaderConst; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->PixelShaderVersion = _pWineCaps->PixelShaderVersion; \
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync _pD3D8Caps->MaxPixelShaderValue = _pWineCaps->PixelShader1xMaxValue;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncvoid fixup_caps(WINED3DCAPS *pWineCaps) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d8
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync{
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3D8 IDirect3D8_iface;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync LONG refcount;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct wined3d *wined3d;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync};
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncBOOL d3d8_init(struct d3d8 *d3d8) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync/*****************************************************************************
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * IDirect3DDevice8 implementation structure
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync */
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#define D3D8_INITIAL_HANDLE_TABLE_SIZE 64
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#define D3D8_INVALID_HANDLE ~0U
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncenum d3d8_handle_type
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync{
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync D3D8_HANDLE_FREE,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync D3D8_HANDLE_VS,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync D3D8_HANDLE_PS,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync D3D8_HANDLE_SB,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync};
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d8_handle_entry
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync{
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync void *object;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync enum d3d8_handle_type type;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync};
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d8_handle_table
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync{
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct d3d8_handle_entry *entries;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct d3d8_handle_entry *free_entries;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync UINT table_size;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync UINT entry_count;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync};
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct FvfToDecl
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync{
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync DWORD fvf;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct d3d8_vertex_declaration *declaration;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync};
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d8_device
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync{
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync /* IUnknown fields */
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DDevice8 IDirect3DDevice8_iface;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct wined3d_device_parent device_parent;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync LONG ref;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct wined3d_device *wined3d_device;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3D8 *d3d_parent;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct d3d8_handle_table handle_table;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync /* FVF management */
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct FvfToDecl *decls;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync UINT numConvertedDecls, declArraySize;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync /* User data draws */
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 /* Avoids recursion with nested ReleaseRef to 0 */
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync BOOL inDestruction;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync BOOL lost;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync};
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncHRESULT device_init(struct d3d8_device *device, struct d3d8 *parent, struct wined3d *wined3d, UINT adapter,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync D3DDEVTYPE device_type, HWND focus_window, DWORD flags, D3DPRESENT_PARAMETERS *parameters) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d8_volume
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync{
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DVolume8 IDirect3DVolume8_iface;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync LONG refcount;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct wined3d_volume *wined3d_volume;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IUnknown *container;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IUnknown *forwardReference;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync};
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncHRESULT volume_init(struct d3d8_volume *volume, struct d3d8_device *device, UINT width, UINT height,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync UINT depth, DWORD usage, enum wined3d_format_id format, enum wined3d_pool pool) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d8_swapchain
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync{
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DSwapChain8 IDirect3DSwapChain8_iface;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync LONG refcount;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct wined3d_swapchain *wined3d_swapchain;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DDevice8 *parent_device;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync};
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncHRESULT d3d8_swapchain_create(struct d3d8_device *device, struct wined3d_swapchain_desc *desc,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct d3d8_swapchain **swapchain) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d8_surface
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync{
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DSurface8 IDirect3DSurface8_iface;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync LONG refcount;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct wined3d_surface *wined3d_surface;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DDevice8 *parent_device;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync /* The surface container */
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IUnknown *container;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync /* If set forward refcounting to this object */
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IUnknown *forwardReference;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync};
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncHRESULT surface_init(struct d3d8_surface *surface, struct d3d8_device *device, UINT width, UINT height,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync D3DFORMAT format, DWORD flags, DWORD usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync DWORD multisample_quality) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d8_surface *unsafe_impl_from_IDirect3DSurface8(IDirect3DSurface8 *iface) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d8_vertexbuffer
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync{
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DVertexBuffer8 IDirect3DVertexBuffer8_iface;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync LONG refcount;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct wined3d_buffer *wined3d_buffer;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DDevice8 *parent_device;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync DWORD fvf;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync};
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncHRESULT vertexbuffer_init(struct d3d8_vertexbuffer *buffer, struct d3d8_device *device,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync UINT size, DWORD usage, DWORD fvf, D3DPOOL pool) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d8_vertexbuffer *unsafe_impl_from_IDirect3DVertexBuffer8(IDirect3DVertexBuffer8 *iface) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d8_indexbuffer
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync{
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DIndexBuffer8 IDirect3DIndexBuffer8_iface;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync LONG refcount;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct wined3d_buffer *wined3d_buffer;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DDevice8 *parent_device;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync enum wined3d_format_id format;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync};
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncHRESULT indexbuffer_init(struct d3d8_indexbuffer *buffer, struct d3d8_device *device,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync UINT size, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d8_indexbuffer *unsafe_impl_from_IDirect3DIndexBuffer8(IDirect3DIndexBuffer8 *iface) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d8_texture
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync{
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DBaseTexture8 IDirect3DBaseTexture8_iface;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync LONG refcount;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct wined3d_texture *wined3d_texture;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync IDirect3DDevice8 *parent_device;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync};
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncHRESULT cubetexture_init(struct d3d8_texture *texture, struct d3d8_device *device,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync UINT edge_length, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncHRESULT texture_init(struct d3d8_texture *texture, struct d3d8_device *device,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncHRESULT volumetexture_init(struct d3d8_texture *texture, struct d3d8_device *device,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync UINT width, UINT height, UINT depth, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d8_texture *unsafe_impl_from_IDirect3DBaseTexture8(IDirect3DBaseTexture8 *iface) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d8_vertex_declaration
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync{
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync DWORD *elements;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync DWORD elements_size; /* Size of elements, in bytes */
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct wined3d_vertex_declaration *wined3d_vertex_declaration;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync DWORD shader_handle;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync};
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncvoid d3d8_vertex_declaration_destroy(struct d3d8_vertex_declaration *declaration) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncHRESULT d3d8_vertex_declaration_init(struct d3d8_vertex_declaration *declaration,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct d3d8_device *device, const DWORD *elements, DWORD shader_handle) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncHRESULT d3d8_vertex_declaration_init_fvf(struct d3d8_vertex_declaration *declaration,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct d3d8_device *device, DWORD fvf) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d8_vertex_shader
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync{
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct d3d8_vertex_declaration *vertex_declaration;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct wined3d_shader *wined3d_shader;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync};
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncvoid d3d8_vertex_shader_destroy(struct d3d8_vertex_shader *shader) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncHRESULT d3d8_vertex_shader_init(struct d3d8_vertex_shader *shader, struct d3d8_device *device,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync const DWORD *declaration, const DWORD *byte_code, DWORD shader_handle, DWORD usage) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#define D3D8_MAX_VERTEX_SHADER_CONSTANTF 256
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncstruct d3d8_pixel_shader
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync{
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync DWORD handle;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync struct wined3d_shader *wined3d_shader;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync};
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncvoid d3d8_pixel_shader_destroy(struct d3d8_pixel_shader *shader) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncHRESULT d3d8_pixel_shader_init(struct d3d8_pixel_shader *shader, struct d3d8_device *device,
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync const DWORD *byte_code, DWORD shader_handle) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncD3DFORMAT d3dformat_from_wined3dformat(enum wined3d_format_id format) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncenum wined3d_format_id wined3dformat_from_d3dformat(D3DFORMAT format) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncvoid load_local_constants(const DWORD *d3d8_elements, struct wined3d_shader *wined3d_vertex_shader) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsyncsize_t parse_token(const DWORD *pToken) DECLSPEC_HIDDEN;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#endif /* __WINE_D3DX8_PRIVATE_H */