}
static HRESULT WINAPI IWineD3DDeviceImpl_CreateQuery(IWineD3DDevice *iface,
- WINED3DQUERYTYPE type, IWineD3DQuery **query, IUnknown *parent)
+ WINED3DQUERYTYPE type, IWineD3DQuery **query)
{
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
IWineD3DQueryImpl *object;
HRESULT hr;
- TRACE("iface %p, type %#x, query %p, parent %p.\n", iface, type, query, parent);
+ TRACE("iface %p, type %#x, query %p.\n", iface, type, query);
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
if (!object)
return E_OUTOFMEMORY;
}
- hr = query_init(object, This, type, parent);
+ hr = query_init(object, This, type);
if (FAILED(hr))
{
WARN("Failed to initialize query, hr %#x.\n", hr);
context_release(context);
}
-/*
- * Occlusion Queries:
- * http://www.gris.uni-tuebingen.de/~bartz/Publications/paper/hww98.pdf
- * http://oss.sgi.com/projects/ogl-sample/registry/ARB/occlusion_query.txt
- */
-
-/* *******************************************
- IWineD3DQuery IUnknown parts follow
- ******************************************* */
-static HRESULT WINAPI IWineD3DQueryImpl_QueryInterface(IWineD3DQuery *iface, REFIID riid, LPVOID *ppobj)
+static HRESULT WINAPI IWineD3DQueryImpl_QueryInterface(IWineD3DQuery *iface, REFIID riid, void **object)
{
- IWineD3DQueryImpl *This = (IWineD3DQueryImpl *)iface;
- TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(riid),ppobj);
- if (IsEqualGUID(riid, &IID_IUnknown)
- || IsEqualGUID(riid, &IID_IWineD3DBase)
- || IsEqualGUID(riid, &IID_IWineD3DQuery)) {
+ TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
+
+ if (IsEqualGUID(riid, &IID_IWineD3DQuery)
+ || IsEqualGUID(riid, &IID_IUnknown))
+ {
IUnknown_AddRef(iface);
- *ppobj = This;
+ *object = iface;
return S_OK;
}
- *ppobj = NULL;
+
+ WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
+
+ *object = NULL;
return E_NOINTERFACE;
}
return ref;
}
-/* *******************************************
- IWineD3DQuery IWineD3DQuery parts follow
- ******************************************* */
-static HRESULT WINAPI IWineD3DQueryImpl_GetParent(IWineD3DQuery *iface, IUnknown **parent)
-{
- TRACE("iface %p, parent %p.\n", iface, parent);
-
- *parent = (IUnknown *)parent;
- IUnknown_AddRef(*parent);
-
- TRACE("Returning %p.\n", *parent);
-
- return WINED3D_OK;
-}
-
static HRESULT WINAPI IWineD3DOcclusionQueryImpl_GetData(IWineD3DQuery* iface, void* pData, DWORD dwSize, DWORD dwGetDataFlags) {
IWineD3DQueryImpl *This = (IWineD3DQueryImpl *) iface;
struct wined3d_occlusion_query *query = This->extendedData;
IWineD3DQueryImpl_AddRef,
IWineD3DQueryImpl_Release,
/*** IWineD3Dquery methods ***/
- IWineD3DQueryImpl_GetParent,
IWineD3DEventQueryImpl_GetData,
IWineD3DEventQueryImpl_GetDataSize,
IWineD3DQueryImpl_GetType,
IWineD3DQueryImpl_AddRef,
IWineD3DQueryImpl_Release,
/*** IWineD3Dquery methods ***/
- IWineD3DQueryImpl_GetParent,
IWineD3DOcclusionQueryImpl_GetData,
IWineD3DOcclusionQueryImpl_GetDataSize,
IWineD3DQueryImpl_GetType,
IWineD3DOcclusionQueryImpl_Issue
};
-HRESULT query_init(IWineD3DQueryImpl *query, IWineD3DDeviceImpl *device,
- WINED3DQUERYTYPE type, IUnknown *parent)
+HRESULT query_init(IWineD3DQueryImpl *query, IWineD3DDeviceImpl *device, WINED3DQUERYTYPE type)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
query->type = type;
query->state = QUERY_CREATED;
query->device = device;
- query->parent = parent;
query->ref = 1;
return WINED3D_OK;