Karma Engine
Loading...
Searching...
No Matches
MacWindow.h
1#pragma once
2
3#include "Karma/Window.h"
4
5struct GLFWwindow;
6
7namespace Karma
8{
9 class GraphicsContext;
10
11 class MacWindow : public Window
12 {
13 public:
14 MacWindow(const WindowProps& props);
15 virtual ~MacWindow();
16
17 void OnUpdate() override;
18
19 virtual bool OnResize(WindowResizeEvent& event) override { return true; }
20
21 inline unsigned int GetWidth() const override { return m_Data.Width; }
22 inline unsigned int GetHeight() const override { return m_Data.Height; }
23
24 inline void SetEventCallback(const EventCallbackFn& callback) override
25 {
26 m_Data.EventCallback = callback;
27 }
28 inline virtual void* GetNativeWindow() const override { return m_Window; }
29
30 void SetVSync(bool enabled) override;
31 bool IsVSync() const override;
32
33 private:
34 void Init(const WindowProps& props);
35
36 void SetGLFWCallbacks(GLFWwindow* glfwWindow);
37 void ShutDown();
38
39 GLFWwindow* m_Window;
40 GraphicsContext* m_Context;
41
42 struct WindowData
43 {
44 std::string Title;
45 unsigned int Width, Height;
46 bool VSync;
47
48 EventCallbackFn EventCallback;
49 };
50
51 WindowData m_Data;
52 };
53}
Definition GraphicsContext.h:8
Definition MacWindow.h:12
Definition ApplicationEvent.h:10
Definition Window.h:27
Definition Window.h:12