You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.0 KiB
45 lines
1.0 KiB
#pragma once
|
|
#include "melpch.h"
|
|
#include "MEL.h"
|
|
#include "Window.h"
|
|
#include "ImGuiLayer/ImGuiLayer.h"
|
|
|
|
namespace MEL {
|
|
class MacWindow:public Window{
|
|
public:
|
|
MacWindow(const WindowProps& props);
|
|
virtual ~MacWindow();
|
|
|
|
void OnUpdate() override;
|
|
unsigned int GetWidth() const override {return m_Data.Width;}
|
|
unsigned int GetHeight()const override {return m_Data.Height;}
|
|
|
|
void* GetNativeWindow() const override {return m_Window;}
|
|
|
|
void SetEventCallback(const EventCallbackFn& callback) override {m_Data.EventCallback =callback;}
|
|
|
|
void SetSync(bool enable) override;
|
|
|
|
bool IsVSync()const override;
|
|
|
|
static Window* Create(const WindowProps& props=WindowProps());
|
|
|
|
void Show()override;
|
|
private:
|
|
virtual void Init(const WindowProps& props);
|
|
virtual void ShutDown();
|
|
private:
|
|
NSWindow* m_Window;
|
|
struct WindowData{
|
|
std::string Title;
|
|
unsigned int Width,Height;
|
|
bool VSync;
|
|
EventCallbackFn EventCallback;
|
|
};
|
|
WindowData m_Data;
|
|
private:
|
|
ImGuiLayer* m_ImGuiLayer;
|
|
};
|
|
}
|
|
|