aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/render/window.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libjin/render/window.h')
-rw-r--r--src/libjin/render/window.h27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/libjin/render/window.h b/src/libjin/render/window.h
index 8066f8a..1064c36 100644
--- a/src/libjin/render/window.h
+++ b/src/libjin/render/window.h
@@ -2,24 +2,25 @@
#define __JIN_RENDER_WINDOW
#include <SDL2/SDL.h>
#include "../utils/utils.h"
+#include "../common/subsystem.h"
namespace jin
{
namespace render
{
- class Window
+
+ class Window : public common::Subsystem
{
public:
- struct Setting
- {
- int width, height; // ڴС
- bool vsync; // ֱͬ
- const char* title; //
- };
+ struct Setting : SettingBase
+ {
+ public:
+ int width, height; // ڴС
+ bool vsync; // ֱͬ
+ const char* title; //
+ };
- onlyonce void init(const Setting& setting);
-
SDL_Window* getWnd();
SDL_GLContext getCtx();
@@ -39,7 +40,7 @@ namespace render
return height;
}
- inline void swapBuffers();
+ inline void swapBuffers();
private:
@@ -54,8 +55,12 @@ namespace render
int width, height;
- inline void _init(const Setting& setting);
+ onlyonce bool _init(const SettingBase* setting) override;
+
};
+
+ typedef Window::Setting WindowSetting;
+
}
}
#endif \ No newline at end of file