2 * state block implementation
4 * Copyright 2002 Raphael Junqueira
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #include "wined3d_private.h"
25 WINE_DEFAULT_DEBUG_CHANNEL(d3d);
27 HRESULT WINAPI IWineD3DStateBlockImpl_InitStartupStateBlock(IWineD3DStateBlock* iface) {
28 IWineD3DStateBlockImpl *This = (IWineD3DStateBlockImpl *)iface;
30 /* Note this may have a large overhead but it should only be executed
31 once, in order to initialize the complete state of the device and
32 all opengl equivalents */
33 TRACE("-----------------------> Setting up device defaults...\n");
34 This->blockType = D3DSBT_ALL;
36 TRACE("-----------------------> Device defaults now set up...\n");
40 /**********************************************************
41 * IUnknown parts follows
42 **********************************************************/
43 HRESULT WINAPI IWineD3DStateBlockImpl_QueryInterface(IWineD3DStateBlock *iface,REFIID riid,LPVOID *ppobj)
48 ULONG WINAPI IWineD3DStateBlockImpl_AddRef(IWineD3DStateBlock *iface) {
49 IWineD3DStateBlockImpl *This = (IWineD3DStateBlockImpl *)iface;
50 TRACE("(%p) : AddRef increasing from %ld\n", This, This->ref);
51 return InterlockedIncrement(&This->ref);
54 ULONG WINAPI IWineD3DStateBlockImpl_Release(IWineD3DStateBlock *iface) {
55 IWineD3DStateBlockImpl *This = (IWineD3DStateBlockImpl *)iface;
57 TRACE("(%p) : Releasing from %ld\n", This, This->ref);
58 ref = InterlockedDecrement(&This->ref);
59 if (ref == 0) HeapFree(GetProcessHeap(), 0, This);
63 /**********************************************************
64 * IWineD3DStateBlock VTbl follows
65 **********************************************************/
67 IWineD3DStateBlockVtbl IWineD3DStateBlock_Vtbl =
69 IWineD3DStateBlockImpl_QueryInterface,
70 IWineD3DStateBlockImpl_AddRef,
71 IWineD3DStateBlockImpl_Release,
72 IWineD3DStateBlockImpl_InitStartupStateBlock