-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathWindow.h
More file actions
50 lines (37 loc) · 1.09 KB
/
Copy pathWindow.h
File metadata and controls
50 lines (37 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#pragma once
#include "Core.h"
#include "../Events/Event.h"
#include <sstream>
namespace Engine
{
struct WindowProps
{
std::string Title;
uint32_t Width;
uint32_t Height;
WindowProps(const std::string &title = "Application",
uint32_t width = 1600,
uint32_t height = 900)
: Title(title), Width(width), Height(height)
{
}
};
// Interface representing a desktop system based Window
class Window
{
public:
static Window *Create(const WindowProps &props = WindowProps());
using EventCallbackFn = std::function<void(Event &)>;
virtual ~Window() = default;
virtual void OnUpdate() = 0;
virtual void HandleEvents() = 0;
virtual uint32_t GetWidth() const = 0;
virtual uint32_t GetHeight() const = 0;
virtual void SetEventCallback(const EventCallbackFn &callback) = 0;
virtual void SetVSync(bool enabled) = 0;
virtual bool IsVSync() const = 0;
virtual void *GetNativeWindow() const = 0;
virtual void *GetNativeContext() const = 0;
virtual void *GetNativeEvent() const = 0;
};
}