Added window abstraction and will be implemented in app

dev
anulax1225 ago%!(EXTRA string=1 year)
parent f3036be13f
commit 415b342d3c
  1. 1
      bakara/src/bakara/core/application.h
  2. 33
      bakara/src/bakara/core/window.h

@ -1,6 +1,7 @@
#pragma once
#include <bkpch.h>
#include "window.h"
namespace Bk {
class Application

@ -1,7 +1,34 @@
#pragma once
#include <bkpch.h>
#include <bakara/events/event.h>
namespace Bk {
class Window {
}
struct WindowPros
{
std::string title;
uint width;
uint height;
WindowPros(std::string title = "Bakara engine", uint width = 1000, uint height = 800)
: title(title), width(width), height(height) {}
};
class Window
{
public:
using EventCallback = std::function<void(Event& e)>;
virtual ~Window(){}
virtual uint get_width() const = 0;
virtual uint get_height() const = 0;
virtual void on_update() = 0;
virtual void set_event_callback(const EventCallback callback) = 0;
virtual void set_vsync(bool enable) = 0;
virtual bool is_vsync() const = 0;
static std::unique_ptr<Window> create_window(const WindowPros& props = WindowPros());
};
}
Loading…
Cancel
Save