2008-11-12 12:04:24 +01:00
|
|
|
/*
|
|
|
|
* Copyright 2008 Henri Verbeet for CodeWeavers
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2015-08-21 00:07:53 +02:00
|
|
|
#include "wine/debug.h"
|
2008-11-12 12:04:24 +01:00
|
|
|
|
2015-08-21 00:07:53 +02:00
|
|
|
#include "initguid.h"
|
2008-11-12 12:04:24 +01:00
|
|
|
|
2015-08-21 00:07:53 +02:00
|
|
|
#define COBJMACROS
|
2020-06-02 01:17:04 +02:00
|
|
|
#include "d3d10.h"
|
2008-11-12 15:43:46 +01:00
|
|
|
|
2015-08-21 00:07:53 +02:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(d3d10core);
|
2008-11-12 15:43:46 +01:00
|
|
|
|
2020-06-02 01:17:04 +02:00
|
|
|
HRESULT WINAPI DXGID3D10CreateDevice(HMODULE d3d11, IDXGIFactory *factory, IDXGIAdapter *adapter,
|
|
|
|
unsigned int flags, const D3D_FEATURE_LEVEL *feature_levels, unsigned int level_count, void **device);
|
2008-11-12 15:43:46 +01:00
|
|
|
|
|
|
|
HRESULT WINAPI D3D10CoreRegisterLayers(void)
|
|
|
|
{
|
2015-08-21 00:07:53 +02:00
|
|
|
TRACE("\n");
|
2008-11-12 15:43:46 +01:00
|
|
|
|
2015-08-21 00:07:53 +02:00
|
|
|
return E_NOTIMPL;
|
2008-11-12 15:43:46 +01:00
|
|
|
}
|
2008-11-14 13:57:06 +01:00
|
|
|
|
|
|
|
HRESULT WINAPI D3D10CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapter,
|
2016-03-16 00:24:10 +01:00
|
|
|
unsigned int flags, D3D_FEATURE_LEVEL feature_level, ID3D10Device **device)
|
2008-11-14 13:57:06 +01:00
|
|
|
{
|
2020-06-02 01:17:04 +02:00
|
|
|
IUnknown *dxgi_device;
|
|
|
|
HMODULE d3d11;
|
2008-11-14 13:57:06 +01:00
|
|
|
HRESULT hr;
|
|
|
|
|
2016-03-16 00:24:10 +01:00
|
|
|
TRACE("factory %p, adapter %p, flags %#x, feature_level %#x, device %p.\n",
|
|
|
|
factory, adapter, flags, feature_level, device);
|
2008-11-17 12:16:03 +01:00
|
|
|
|
2020-06-02 01:17:04 +02:00
|
|
|
d3d11 = LoadLibraryA("d3d11.dll");
|
|
|
|
hr = DXGID3D10CreateDevice(d3d11, factory, adapter, flags, &feature_level, 1, (void **)&dxgi_device);
|
|
|
|
FreeLibrary(d3d11);
|
|
|
|
if (FAILED(hr))
|
|
|
|
{
|
|
|
|
WARN("Failed to create device, hr %#x.\n", hr);
|
2015-08-21 00:07:53 +02:00
|
|
|
return hr;
|
2020-06-02 01:17:04 +02:00
|
|
|
}
|
2015-08-21 00:07:53 +02:00
|
|
|
|
2020-06-02 01:17:04 +02:00
|
|
|
hr = IUnknown_QueryInterface(dxgi_device, &IID_ID3D10Device, (void **)device);
|
|
|
|
IUnknown_Release(dxgi_device);
|
2008-11-14 13:57:06 +01:00
|
|
|
if (FAILED(hr))
|
|
|
|
{
|
2020-06-02 01:17:04 +02:00
|
|
|
ERR("Failed to query ID3D10Device interface, returning E_FAIL.\n");
|
2015-08-21 00:07:53 +02:00
|
|
|
return E_FAIL;
|
2008-11-14 13:57:06 +01:00
|
|
|
}
|
|
|
|
|
2015-08-21 00:07:53 +02:00
|
|
|
return S_OK;
|
2008-11-14 13:57:06 +01:00
|
|
|
}
|