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