Add basic input system

This commit is contained in:
2020-05-16 00:56:22 +02:00
parent 3e3cbad9c4
commit fc529b0694
29 changed files with 1926 additions and 493 deletions

View File

@@ -1,9 +1,10 @@
#pragma once
#include <stdexcept>
#include "../Base/Logger.hpp"
#include "../Vulkan/Renderer.hpp"
#include "../Base/PlatformEnums.hpp"
#include "WindowGLFW.hpp"
#include "../Base/IPlatform.hpp"
#include "../Vulkan/Renderer.hpp"
#include "GLFW/PlatformGLFW.hpp"
namespace openVulkanoCpp
{
@@ -32,18 +33,18 @@ namespace openVulkanoCpp
}
/**
* \brief Creates a window that fits best for the current environment
* \param renderApi The render api that should be used when searching for the best suited window
* \return The created window. nullptr if no window is supported on the current platform
* \brief Creates a platform that fits best for the current environment
* \param renderApi The render api that should be used when searching for the best suited platform provider
* \return The created platform
* \throws std::runtime_error if the render api is not supported
*/
static IWindow* CreateBestWindow(RenderAPI::RenderApi renderApi)
{ //TODO add more windows to chose from
switch(renderApi)
static IPlatform* CreatePlatform(RenderAPI::RenderApi renderApi)
{
switch (renderApi)
{
case RenderAPI::VULKAN: return new WindowGLFW();
case RenderAPI::VULKAN: return new GLFW::PlatformGLFW();
default:
Logger::RENDER->error("Unsupported render api requested! Requested %d", static_cast<int>(renderApi));
Logger::MANAGER->error("Unsupported render api requested! Requested %d", static_cast<int>(renderApi));
throw std::runtime_error("Unsupported render api requested!");
}
}