2021-05-26 18:39:40 +04:30
|
|
|
#include "ltpch.h"
|
2021-05-27 10:41:32 +04:30
|
|
|
#include "UserInterface.h"
|
2021-05-27 18:55:30 +04:30
|
|
|
#include "OpenGL/glUserInterface.h"
|
2021-05-27 10:41:32 +04:30
|
|
|
|
2021-06-02 17:20:15 +04:30
|
|
|
#ifdef LIGHT_PLATFORM_WINDOWS
|
|
|
|
#include "DirectX/dxUserInterface.h"
|
2021-06-19 15:12:42 +04:30
|
|
|
#include "DirectX/dxSharedContext.h"
|
2021-06-02 17:20:15 +04:30
|
|
|
#endif
|
|
|
|
|
2021-05-27 18:55:30 +04:30
|
|
|
#include "Events/Event.h"
|
2021-08-01 16:43:59 +04:30
|
|
|
#include "Events/CharEvent.h"
|
2021-05-27 12:51:39 +04:30
|
|
|
#include "Events/MouseEvents.h"
|
2021-05-27 18:55:30 +04:30
|
|
|
#include "Events/KeyboardEvents.h"
|
2021-05-27 12:51:39 +04:30
|
|
|
|
2021-07-29 17:12:13 +04:30
|
|
|
#include "Graphics/GraphicsContext.h"
|
|
|
|
|
2021-05-27 12:51:39 +04:30
|
|
|
#include <imgui.h>
|
|
|
|
|
2021-05-26 18:39:40 +04:30
|
|
|
namespace Light {
|
|
|
|
|
2021-07-26 11:43:37 +04:30
|
|
|
Scope<UserInterface> UserInterface::Create(GLFWwindow* windowHandle, Ref<SharedContext> sharedContext)
|
2021-05-26 18:39:40 +04:30
|
|
|
{
|
2021-05-27 10:41:32 +04:30
|
|
|
switch (GraphicsContext::GetGraphicsAPI())
|
|
|
|
{
|
|
|
|
case GraphicsAPI::OpenGL:
|
2021-07-26 11:43:37 +04:30
|
|
|
return CreateScope<glUserInterface>(windowHandle);
|
2021-05-27 19:54:05 +04:30
|
|
|
|
2021-06-02 17:20:15 +04:30
|
|
|
case GraphicsAPI::DirectX: LT_WIN(
|
2021-07-26 11:43:37 +04:30
|
|
|
return CreateScope<dxUserInterface>(windowHandle, std::dynamic_pointer_cast<dxSharedContext>(sharedContext));)
|
2021-06-02 17:20:15 +04:30
|
|
|
|
2021-05-27 19:54:05 +04:30
|
|
|
default:
|
2021-07-01 19:25:46 +04:30
|
|
|
LT_ENGINE_ASSERT(false, "UserInterface::Create: invalid/unsupported 'GraphicsAPI' {}", GraphicsContext::GetGraphicsAPI());
|
2021-05-27 19:54:05 +04:30
|
|
|
return nullptr;
|
2021-05-27 10:41:32 +04:30
|
|
|
}
|
|
|
|
}
|
2021-05-26 18:39:40 +04:30
|
|
|
|
|
|
|
}
|