ReactOS 0.4.17-dev-934-g091855f
d3d10core_main.c
Go to the documentation of this file.
1/*
2 * Copyright 2008 Henri Verbeet for CodeWeavers
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 *
18 */
19
20#include "wine/debug.h"
21
22#include "initguid.h"
23
24#define COBJMACROS
25#include "d3d10.h"
26
28
30 unsigned int flags, const D3D_FEATURE_LEVEL *feature_levels, unsigned int level_count, void **device);
31
33{
34 TRACE("\n");
35
36 return E_NOTIMPL;
37}
38
40 unsigned int flags, D3D_FEATURE_LEVEL feature_level, ID3D10Device **device)
41{
43 HMODULE d3d11;
44 HRESULT hr;
45
46 TRACE("factory %p, adapter %p, flags %#x, feature_level %#x, device %p.\n",
47 factory, adapter, flags, feature_level, device);
48
49 d3d11 = LoadLibraryA("d3d11.dll");
50 hr = DXGID3D10CreateDevice(d3d11, factory, adapter, flags, &feature_level, 1, (void **)&dxgi_device);
51 FreeLibrary(d3d11);
52 if (FAILED(hr))
53 {
54 WARN("Failed to create device, hr %#lx.\n", hr);
55 return hr;
56 }
57
58 hr = IUnknown_QueryInterface(dxgi_device, &IID_ID3D10Device, (void **)device);
59 IUnknown_Release(dxgi_device);
60 if (FAILED(hr))
61 {
62 ERR("Failed to query ID3D10Device interface, returning E_FAIL.\n");
63 return E_FAIL;
64 }
65
66 return S_OK;
67}
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
HRESULT WINAPI DXGID3D10CreateDevice(HMODULE d3d11, IDXGIFactory *factory, IDXGIAdapter *adapter, unsigned int flags, const D3D_FEATURE_LEVEL *feature_levels, unsigned int level_count, void **device)
Definition: dxgi_main.c:135
HRESULT WINAPI D3D10CoreRegisterLayers(void)
HRESULT WINAPI D3D10CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapter, unsigned int flags, D3D_FEATURE_LEVEL feature_level, ID3D10Device **device)
D3D_FEATURE_LEVEL
Definition: d3dcommon.idl:102
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
HRESULT hr
Definition: delayimp.cpp:582
#define FreeLibrary(x)
Definition: compat.h:748
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
return adapter
GLbitfield flags
Definition: glext.h:7161
static D3D_DRIVER_TYPE HMODULE UINT const D3D_FEATURE_LEVEL * feature_levels
Definition: hlsl_d3d11.c:28
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
#define TRACE(s)
Definition: solgame.cpp:4
Definition: devices.h:37
Definition: main.c:439
#define WINAPI
Definition: msvc.h:6