Orange/include/Orange/Render/Window.h

39 lines
845 B
C
Raw Normal View History

2022-06-19 04:33:41 +01:00
#pragma once
#include <Orange/Core/Result.h>
2022-08-13 14:20:40 +01:00
#include <Orange/Core/Array.h>
#include <Orange/Render/Input.h>
2022-08-04 03:00:54 +01:00
#include <vulkan/vulkan_core.h>
2022-06-19 04:33:41 +01:00
struct SDL_Window;
namespace orange
{
class Window
{
public:
~Window();
2022-08-04 03:00:54 +01:00
static bool GetInstanceExtensions(Window& window, uint32_t *count, const char **extensions);
Result<VkSurfaceKHR> CreateSurface(VkInstance instance);
2022-06-19 04:33:41 +01:00
2022-08-02 22:27:01 +01:00
static const char* GetError();
2022-06-19 04:33:41 +01:00
static Result<Window> Create();
2022-08-04 22:18:11 +01:00
2022-08-13 14:20:40 +01:00
bool Update(Input::InputHandler& handler);
2022-08-13 07:37:36 +01:00
void EnableRelativeMouse(bool relative);
2022-08-13 21:41:19 +01:00
void SetTitle(const char* title);
2022-06-19 04:33:41 +01:00
protected:
friend Result<Window>;
Window(SDL_Window* window);
private:
SDL_Window* m_window = nullptr;
2022-08-13 07:37:36 +01:00
bool m_relativeMouse = false;
bool m_hasFocus = false;
2022-06-19 04:33:41 +01:00
};
}