3#include <Covellite/Api/Window.hpp>
4#include <alicorn/std/string.hpp>
5#include <Covellite/Events.hpp>
6#include <Covellite/App/Events.hpp>
7#include <Covellite/App/Settings.hpp>
8#include <Covellite/Os/IWindow.hpp>
9#include <Covellite/Os/Events.hpp>
10#include <Covellite/Api/Events.hpp>
11#include "Renderer/IGraphicApi.hpp"
17#include "Renderer/OpenGL.hpp"
18#include "Renderer/DirectX10.hpp"
19#include "Renderer/DirectX11.hpp"
21# elif BOOST_PLAT_ANDROID
23#include "Renderer/OpenGLES3.hpp"
35Window::Window(
const WindowOs_t & _Window) :
38 m_pImpl(MakeImpl(_Window))
40 LOGGER(Info) << uT(
"Using graphics API: ") << m_pImpl->GetUsingApi();
42 m_Events[events::Application.Update].Connect([
this](
void)
44 m_Events[events::Drawing.Do]();
45 m_pImpl->PresentFrame();
48 m_Events[events::Window.Resize].Connect([
this](
void)
50 m_pImpl->ResizeWindow(GetClientRect());
54Window::~Window(
void) =
default;
56Window::operator Window::Events_t(
void)
const
61Rect Window::GetClientRect(
void)
const
63 return m_WindowOs.GetClientRect();
78auto Window::GetRenders(
void)
const -> RendersPtr_t
80 return ::std::make_shared<Component::Renders>(m_pImpl->GetCreators());
83 auto Window::MakeImpl(
const WindowOs_t & _Window) -> IGraphicApiPtr_t
86 oSettingsData.
Handle = _Window.GetHandle();
87 oSettingsData.
ClientRect = _Window.GetClientRect();
89 using String_t = ::alicorn::extension::std::String;
91 const auto MainSection = ::covellite::app::Settings_t::GetInstance();
92 const auto WindowSection = MainSection[uT(
"Window")];
95 oSettingsData.
IsFullScreen = WindowSection.Get<
bool>(uT(
"IsFullScreen"));
98 const auto NameOfApiClass = WindowSection.Get<String_t>(uT(
"GraphicsApi"));
100 return MakeImpl(NameOfApiClass, oSettingsData);
Класс для передачи значений настроек программы реализации рендера.
Definition IGraphicApi.hpp:62
bool IsFullScreen
Признак работы программы в полноэкранном режиме.
Definition IGraphicApi.hpp:66
Rect ClientRect
Фактические размеры клиентской области окна.
Definition IGraphicApi.hpp:65
Any_t Handle
Хэнд окна операционной системы.
Definition IGraphicApi.hpp:64