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.
40 lines
927 B
40 lines
927 B
#pragma once
|
|
|
|
#include "melpch.h"
|
|
#include "MEL.h"
|
|
#include "Events/Event.h"
|
|
#include "Renderer.h"
|
|
namespace MEL {
|
|
class Renderer;
|
|
struct WindowProps{
|
|
std::string Title;
|
|
unsigned int Width;
|
|
unsigned int Height;
|
|
WindowProps(const std::string &title="MEL Engine",unsigned int width=1280,unsigned int height=720)
|
|
:Title(title),Width(width),Height(height){}
|
|
};
|
|
class Window{
|
|
public:
|
|
using EventCallbackFn=std::function<void(Event&)>;
|
|
virtual ~Window(){}
|
|
|
|
virtual void OnUpdate()=0;
|
|
virtual unsigned int GetWidth()const=0;
|
|
virtual unsigned int GetHeight()const=0;
|
|
|
|
virtual void* GetNativeWindow()const=0;
|
|
|
|
virtual void SetEventCallback(const EventCallbackFn& callback)=0;
|
|
|
|
virtual void SetSync(bool enable)=0;
|
|
|
|
virtual bool IsVSync()const=0;
|
|
|
|
virtual void Show()=0;
|
|
|
|
static Window* Create(const WindowProps& props=WindowProps());
|
|
|
|
virtual Renderer* GetRenderer()const=0;
|
|
};
|
|
}
|