1 /* Copyright (C) 2010-2020 The RetroArch team
2  *
3  * ---------------------------------------------------------------------------------------------
4  * The following license statement only applies to this libretro API header (libretro_d3d.h)
5  * ---------------------------------------------------------------------------------------------
6  *
7  * Permission is hereby granted, free of charge,
8  * to any person obtaining a copy of this software and associated documentation files (the
9  * "Software"),
10  * to deal in the Software without restriction, including without limitation the rights to
11  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
12  * and to permit persons to whom the Software is furnished to do so, subject to the following
13  * conditions:
14  *
15  * The above copyright notice and this permission notice shall be included in all copies or
16  * substantial portions of the Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
19  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22  * LIABILITY,
23  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25  */
26 
27 #ifndef LIBRETRO_DIRECT3D_H__
28 #define LIBRETRO_DIRECT3D_H__
29 
30 #include "libretro.h"
31 
32 #ifdef HAVE_D3D11
33 
34 #include <d3d11.h>
35 #include <d3dcompiler.h>
36 
37 #define RETRO_HW_RENDER_INTERFACE_D3D11_VERSION 1
38 
39 struct retro_hw_render_interface_d3d11
40 {
41   /* Must be set to RETRO_HW_RENDER_INTERFACE_D3D11. */
42   enum retro_hw_render_interface_type interface_type;
43   /* Must be set to RETRO_HW_RENDER_INTERFACE_D3D11_VERSION. */
44   unsigned interface_version;
45 
46   /* Opaque handle to the d3d11 backend in the frontend
47    * which must be passed along to all function pointers
48    * in this interface.
49    */
50   void* handle;
51   ID3D11Device *device;
52   ID3D11DeviceContext *context;
53   D3D_FEATURE_LEVEL featureLevel;
54   pD3DCompile D3DCompile;
55 };
56 
57 #endif
58 
59 #endif /* LIBRETRO_DIRECT3D_H__ */
60