-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWindow.h
43 lines (32 loc) · 972 Bytes
/
Window.h
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
#pragma once
#include <string>
#include <functional>
#include "event/Event.h"
namespace CC
{
struct WindowProps
{
std::string Title;
uint32_t Width;
uint32_t Height;
WindowProps(const std::string &title = "CC World",
uint32_t width = 1280, uint32_t Height = 720)
: Title(title), Width(width), Height(Height)
{
}
};
class Window
{
public:
virtual ~Window(){}
virtual void OnUpdate() = 0;
virtual uint32_t getWidth() const = 0;
virtual uint32_t getHeight() const = 0;
using EventCallbackFn = std::function<void(Event&)>;
virtual void SetEventCallback(const EventCallbackFn& callback) = 0;
virtual void SetVSync(bool enable) = 0;
virtual bool IsVSync() const = 0;
virtual void* GetNativeWindow() const = 0;
static Window* Create(const WindowProps& props = WindowProps());
};
}