SDXFrameWork  0.09
SDXFrameWork
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
Window.h
1 #pragma once//☀SDL
2 #include <Multimedia/SDX.h>
3 #include <Multimedia/Screen.h>
4 
5 namespace SDX
6 {
9 class Window
10 {
11  friend class System;
12  friend class Mouse;
13  friend class Gesture;
14  friend class Touch;
15 private:
16  bool isFullScreen = false;
17  int width;
18  int height;
19  double aspect;
20 
21  Window(){}
22  WindowHandle handle = 0;
23 public:
24 
25  static Window& Single()
26  {
27  static Window single;
28  return single;
29  }
30 
32  static bool SetFullScreen(bool フルスクリーンフラグ)
33  {
34  Single().isFullScreen = フルスクリーンフラグ;
35 
36  if (Single().isFullScreen)
37  {
38  SDL_RenderSetLogicalSize(Screen::GetHandle() , GetWidth() , GetHeight() );
39  SDL_SetWindowFullscreen(Single().handle, SDL_WINDOW_FULLSCREEN_DESKTOP);
40  }
41  else
42  {
43  SDL_SetWindowFullscreen(Single().handle, 0);
44  SDL_SetWindowSize(Single().handle, GetWidth(), GetHeight());
45  }
46  return false;
47  }
48 
50  static bool SetTitle(const char *タイトル名)
51  {
52  SDL_SetWindowTitle( Single().handle , タイトル名 );
53  return true;
54  }
55 
57  static void SetSize(int 幅,int 高さ )
58  {
59  Window::Single().width = 幅;
60  Window::Single().height = 高さ;
61 
62  SDL_RenderSetLogicalSize(Screen::GetHandle(), 幅, 高さ);
63  SDL_SetWindowSize( Single().handle , 幅, 高さ);
64  }
65 
67  static int GetWidth()
68  {
69  return Single().width;
70  }
71 
73  static int GetHeight()
74  {
75  return Single().height;
76  }
77 };
78 }
static int GetWidth()
ウィンドウ幅の取得.
Definition: Window.h:67
マウスの状態を表すクラス.
Definition: Mouse.h:12
static RendererHandle GetHandle()
スクリーンハンドルを取得.
Definition: Screen.h:77
static int GetHeight()
ウィンドウ高さの取得.
Definition: Window.h:73
static bool SetTitle(const char *タイトル名)
ウィンドウタイトルを設定.
Definition: Window.h:50
Definition: Touch.h:7
ライブラリの初期化やシステム的な処理を行う関数群.
Definition: System.h:11
static bool SetFullScreen(bool フルスクリーンフラグ)
スクリーンモードを設定する.
Definition: Window.h:32
static void SetSize(int 幅, int 高さ)
ウィンドウサイズの設定.
Definition: Window.h:57
Definition: Touch.h:69
ウィンドウを表すクラス.
Definition: Window.h:9