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
63 return m_WindowOs.GetClientRect();
80 return ::std::make_shared<Component::Renders>(m_pImpl->GetCreators());
86 return m_pImpl->GetDrawCallCount();
89 auto Window::MakeImpl(
const WindowOs_t & _Window) -> IGraphicApiPtr_t
92 oSettingsData.
Handle = _Window.GetHandle();
93 oSettingsData.
ClientRect = _Window.GetClientRect();
95 using String_t = ::alicorn::extension::std::String;
97 const auto MainSection = ::covellite::app::Settings_t::GetInstance();
98 const auto WindowSection = MainSection[uT(
"Window")];
101 oSettingsData.
IsFullScreen = WindowSection.Get<
bool>(uT(
"IsFullScreen"));
104 const auto NameOfApiClass = WindowSection.Get<String_t>(uT(
"GraphicsApi"));
106 return MakeImpl(NameOfApiClass, oSettingsData);
Класс для передачи значений настроек программы реализации рендера.
Определения IGraphicApi.hpp:63
bool IsFullScreen
Признак работы программы в полноэкранном режиме.
Определения IGraphicApi.hpp:67
Rect ClientRect
Фактические размеры клиентской области окна.
Определения IGraphicApi.hpp:66
Any_t Handle
Хэнд окна операционной системы.
Определения IGraphicApi.hpp:65
size_t GetDrawCallCount(void) const final
Количество drawcall'ов в последнем кадре.
Определения Window.cpp:84
RendersPtr_t GetRenders(void) const override
Функция получения объекта для созданий рендеров компонентов объектов 3D сцены.
Определения Window.cpp:78
Rect GetClientRect(void) const override
Функция получения размеров клиентской области окна.
Определения Window.cpp:61