48 lines
1.1 KiB
C++
48 lines
1.1 KiB
C++
#pragma once
|
|
#include <string>
|
|
#include "SDL.h"
|
|
#include "imgui.h"
|
|
|
|
class renderer;
|
|
class texture;
|
|
|
|
extern bool g_is_running;
|
|
extern bool g_exit_requested;
|
|
|
|
struct window_params
|
|
{
|
|
std::string title;
|
|
int width;
|
|
int height;
|
|
bool fullscreen;
|
|
bool borderless;
|
|
bool resizable;
|
|
bool minimized;
|
|
bool maximized;
|
|
bool hi_dpi;
|
|
bool always_on_top;
|
|
};
|
|
|
|
class CORE_API application
|
|
{
|
|
public:
|
|
application() = default;
|
|
virtual ~application();
|
|
application(const application&) = delete;
|
|
application(application&&) = delete;
|
|
|
|
virtual void init(window_params in_window_params, int argc, char** argv);
|
|
virtual int run();
|
|
virtual void shutdown();
|
|
virtual void draw_gui() = 0;
|
|
virtual void init_imgui(ImGuiContext* in_context) = 0;
|
|
texture* load_texture(const std::string& path) const;
|
|
texture* create_texture(const unsigned char* data, const int width, const int height) const;
|
|
|
|
renderer* get_renderer() const { return renderer_; }
|
|
SDL_Window* get_window() const { return window_; }
|
|
protected:
|
|
renderer* renderer_ = nullptr;
|
|
SDL_Window* window_ = nullptr;
|
|
};
|