Hana
Loading...
Searching...
No Matches
Window.h
1#pragma once
2
3#include "hnpch.h"
4
5#include "Hana/Core/Core.h"
6#include "Hana/Events/Event.h"
7
8namespace Hana
9{
10 struct WindowProps
11 {
12 std::string Title;
13 unsigned int Width;
14 unsigned int Height;
15
16 WindowProps(const std::string& title = "Hana Engine",
17 unsigned int width = 1920,
18 unsigned int height = 1080)
19 : Title(title), Width(width), Height(height)
20 {
21 }
22 };
23
24 // Interface representing a desktop system based Window
25 class Window
26 {
27 public:
28 using EventCallbackFn = std::function<void(Event&)>;
29
30 virtual ~Window() = default;
31
32 virtual void OnUpdate() = 0;
33
34 virtual unsigned int GetWidth() const = 0;
35 virtual unsigned int GetHeight() const = 0;
36
37 // Window attributes
38 virtual void SetEventCallback(const EventCallbackFn& callback) = 0;
39 virtual void SetVSync(bool enabled) = 0;
40 virtual bool IsVSync() const = 0;
41
42 virtual void* GetNativeWindow() const = 0;
43
44 static Scope<Window> Create(const WindowProps& props = WindowProps());
45 };
46}
Definition Event.h:39
Definition Window.h:26
Definition Window.h:11