From 6d67345bd5ddea7a4ce37e6bbeda15d341b1ee82 Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 2 Sep 2018 10:47:18 +0800 Subject: *update --- src/libjin/Graphics/Window.h | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/libjin/Graphics/Window.h') diff --git a/src/libjin/Graphics/Window.h b/src/libjin/Graphics/Window.h index e4939f6..4617ef8 100644 --- a/src/libjin/Graphics/Window.h +++ b/src/libjin/Graphics/Window.h @@ -5,6 +5,7 @@ #include "SDL2/SDL.h" #include "../utils/utils.h" +#include "../math/Vector.h" #include "../common/Subsystem.hpp" namespace jin @@ -15,7 +16,6 @@ namespace graphics class Window : public Subsystem { public: - struct Setting : SettingBase { public: @@ -27,25 +27,23 @@ namespace graphics bool resizable; // resize }; - inline int getW(){ return width; } - inline int getH(){ return height; } + inline int getW(){ return size.x; } + inline int getH(){ return size.y; } inline int getFPS(){ return fps; } inline void swapBuffers(); private: - + SINGLETON(Window); Window() {}; virtual ~Window() {}; - SINGLETON(Window); + bool initSystem(const SettingBase* setting) override; + void quitSystem() override; SDL_Window* wnd; - - int width, height; + jin::math::Vector2 size; int fps; - /*call only once*/ bool initSystem(const SettingBase* setting) override; - /*call only once*/ void quitSystem() override; }; } // render -- cgit v1.1-26-g67d0