blob: 2ecd7e49f6bea77c6b91e0cb12e8634de845f2d7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
#ifndef __JIN_RENDER_WINDOW
#define __JIN_RENDER_WINDOW
#include "../modules.h"
#if JIN_MODULES_RENDER
#include "SDL2/SDL.h"
#include "../utils/utils.h"
#include "../math/Vector2.hpp"
#include "../common/Subsystem.hpp"
namespace jin
{
namespace graphics
{
class Window : public Subsystem<Window>
{
public:
struct Setting : SettingBase
{
public:
const char* title; //
bool fullscreen; // ȫ
int width, height; // ڴС
bool vsync; // ֱͬ
int fps; // FPS
bool resizable; // resize
};
void setTitle(const char* title);
inline int getW(){ return size.w; }
inline int getH(){ return size.h; }
inline int getFPS(){ return fps; }
inline void swapBuffers();
private:
SINGLETON(Window);
Window() {};
virtual ~Window() {};
bool initSystem(const SettingBase* setting) override;
void quitSystem() override;
SDL_Window* wnd;
jin::math::Vector2<unsigned int> size;
int fps;
};
} // render
} // jin
#endif // JIN_MODULES_RENDER
#endif // __JIN_RENDER_WINDOW
|