2 * ID3DXBuffer implementation
4 * Copyright 2002 Raphael Junqueira
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "wine/port.h"
30 #include "wine/debug.h"
33 #include "d3dx8core_private.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(d3d);
37 /* ID3DXBuffer IUnknown parts follow: */
38 HRESULT WINAPI ID3DXBufferImpl_QueryInterface(LPD3DXBUFFER iface, REFIID riid, LPVOID* ppobj) {
39 ICOM_THIS(ID3DXBufferImpl,iface);
41 if (IsEqualGUID(riid, &IID_IUnknown)
42 || IsEqualGUID(riid, &IID_ID3DXBuffer)) {
43 ID3DXBufferImpl_AddRef(iface);
48 WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
52 ULONG WINAPI ID3DXBufferImpl_AddRef(LPD3DXBUFFER iface) {
53 ICOM_THIS(ID3DXBufferImpl,iface);
54 TRACE("(%p) : AddRef from %ld\n", This, This->ref);
58 ULONG WINAPI ID3DXBufferImpl_Release(LPD3DXBUFFER iface) {
59 ICOM_THIS(ID3DXBufferImpl,iface);
60 ULONG ref = --This->ref;
61 TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
63 if (NULL != This->buffer) HeapFree(GetProcessHeap(), 0, This->buffer);
64 HeapFree(GetProcessHeap(), 0, This);
69 /* ID3DXBuffer Interface follow: */
70 LPVOID WINAPI ID3DXBufferImpl_GetBufferPointer(LPD3DXBUFFER iface) {
71 ICOM_THIS(ID3DXBufferImpl,iface);
75 DWORD WINAPI ID3DXBufferImpl_GetBufferSize(LPD3DXBUFFER iface) {
76 ICOM_THIS(ID3DXBufferImpl,iface);
77 return This->bufferSize;
80 ICOM_VTABLE(ID3DXBuffer) D3DXBuffer_Vtbl =
82 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
83 ID3DXBufferImpl_QueryInterface,
84 ID3DXBufferImpl_AddRef,
85 ID3DXBufferImpl_Release,
86 ID3DXBufferImpl_GetBufferPointer,
87 ID3DXBufferImpl_GetBufferSize