diff options
author | chai <chaifix@163.com> | 2018-05-19 12:05:57 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-05-19 12:05:57 +0800 |
commit | adfda73e1810973a40b7bedd9a8edc3e7ab89e3c (patch) | |
tree | 3ee6b9ad4f3c71b5cefc719c694e7a80f3df7088 /src/libjin/render/window.h | |
parent | 3ce3b10167a98f45614408a8042a10c686f3a9cc (diff) |
增加子系统基类
Diffstat (limited to 'src/libjin/render/window.h')
-rw-r--r-- | src/libjin/render/window.h | 27 |
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 |