Diligent Engine  v.2.4.g
EngineFactoryMtl.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019-2021 Diligent Graphics LLC
3  * Copyright 2015-2019 Egor Yusov
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS.
14  *
15  * In no event and under no legal theory, whether in tort (including negligence),
16  * contract, or otherwise, unless required by applicable law (such as deliberate
17  * and grossly negligent acts) or agreed to in writing, shall any Contributor be
18  * liable for any damages, including any direct, indirect, special, incidental,
19  * or consequential damages of any character arising as a result of this License or
20  * out of the use or inability to use the software (including but not limited to damages
21  * for loss of goodwill, work stoppage, computer failure or malfunction, or any and
22  * all other commercial damages or losses), even if such Contributor has been advised
23  * of the possibility of such damages.
24  */
25 
26 #pragma once
27 
30 
31 #include <sstream>
32 
33 #include "../../GraphicsEngine/interface/EngineFactory.h"
34 #include "../../GraphicsEngine/interface/RenderDevice.h"
35 #include "../../GraphicsEngine/interface/DeviceContext.h"
36 #include "../../GraphicsEngine/interface/SwapChain.h"
37 
38 // https://gcc.gnu.org/wiki/Visibility
39 #define API_QUALIFIER __attribute__((visibility("default")))
40 
41 namespace Diligent
42 {
43 
44 // {CF4A590D-2E40-4F48-9579-0D25991F963B}
45 static const INTERFACE_ID IID_EngineFactoryMtl =
46  {0xcf4a590d, 0x2e40, 0x4f48, {0x95, 0x79, 0xd, 0x25, 0x99, 0x1f, 0x96, 0x3b}};
47 
49 {
50 public:
51  virtual void CreateDeviceAndContextsMtl(const EngineMtlCreateInfo& Attribs,
52  IRenderDevice** ppDevice,
53  IDeviceContext** ppContexts) = 0;
54 
55  virtual void CreateSwapChainMtl(IRenderDevice* pDevice,
56  IDeviceContext* pImmediateContext,
57  const SwapChainDesc& SCDesc,
58  const NativeWindow& Window,
59  ISwapChain** ppSwapChain) = 0;
60 
61  virtual void AttachToMtlDevice(void* pMtlNativeDevice,
62  const EngineMtlCreateInfo& EngineAttribs,
63  IRenderDevice** ppDevice,
64  IDeviceContext** ppContexts) = 0;
65 };
66 
67 
69 
70 } // namespace Diligent
Diligent::INTERFACE_ID
struct INTERFACE_ID INTERFACE_ID
Definition: InterfaceID.h:54
Diligent::IEngineFactoryMtl::AttachToMtlDevice
virtual void AttachToMtlDevice(void *pMtlNativeDevice, const EngineMtlCreateInfo &EngineAttribs, IRenderDevice **ppDevice, IDeviceContext **ppContexts)=0
Diligent::EngineMtlCreateInfo
Attributes of the Metal-based engine implementation.
Definition: GraphicsTypes.h:2374
Diligent::GetEngineFactoryMtl
API_QUALIFIER IEngineFactoryMtl * GetEngineFactoryMtl()
Diligent::IEngineFactoryMtl::CreateDeviceAndContextsMtl
virtual void CreateDeviceAndContextsMtl(const EngineMtlCreateInfo &Attribs, IRenderDevice **ppDevice, IDeviceContext **ppContexts)=0
API_QUALIFIER
#define API_QUALIFIER
Definition: EngineFactoryMtl.h:39
Diligent::ISwapChain
Swap chain interface.
Definition: SwapChain.h:56
Diligent::IEngineFactoryMtl::CreateSwapChainMtl
virtual void CreateSwapChainMtl(IRenderDevice *pDevice, IDeviceContext *pImmediateContext, const SwapChainDesc &SCDesc, const NativeWindow &Window, ISwapChain **ppSwapChain)=0
Diligent::IRenderDevice
Render device interface.
Definition: RenderDevice.h:75
Diligent::SwapChainDesc
Swap chain description.
Definition: GraphicsTypes.h:1347
Diligent::IEngineFactoryMtl
Definition: EngineFactoryMtl.h:48
Diligent::IDeviceContext
Device context interface.
Definition: DeviceContext.h:1460
Diligent::IEngineFactory
Engine factory base interface.
Definition: EngineFactory.h:60
Diligent
The library uses Direct3D-style math:
Definition: AdvancedMath.hpp:37