1//************************************ bs::framework - Copyright 2018 Marko Pintera **************************************//
2//*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********//
3#pragma once
4
5#include "BsCorePrerequisites.h"
6#include "Utility/BsModule.h"
7#include "Managers/BsRenderAPIFactory.h"
8
9namespace bs
10{
11 /** @addtogroup RenderAPI-Internal
12 * @{
13 */
14
15 /** Manager that handles render system start up. */
16 class BS_CORE_EXPORT RenderAPIManager : public Module<RenderAPIManager>
17 {
18 public:
19 RenderAPIManager() = default;
20 ~RenderAPIManager();
21
22 /**
23 * Starts the render API with the provided name and creates the primary render window.
24 *
25 * @param[in] name Name of the render system to start. Factory for this render system must be
26 * previously registered.
27 * @param[in] primaryWindowDesc Contains options used for creating the primary window.
28 * @return Created render window if initialization is successful, null otherwise.
29 */
30 SPtr<RenderWindow> initialize(const String& name, RENDER_WINDOW_DESC& primaryWindowDesc);
31
32 /** Registers a new render API factory responsible for creating a specific render system type. */
33 void registerFactory(SPtr<RenderAPIFactory> factory);
34 private:
35 Vector<SPtr<RenderAPIFactory>> mAvailableFactories;
36 bool mRenderAPIInitialized = false;
37 };
38
39 /** @} */
40}
41
42