SDXFrameWork  0.07
SDXFrameWork
 全て クラス ネームスペース 関数 変数 列挙型 列挙型の値 ページ
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 
24 public:
25 
26  static Window& Single()
27  {
28  static Window single;
29  return single;
30  }
31 
34  static bool SetFullScreen(bool フルスクリーンフラグ)
35  {
36  Single().isFullScreen = フルスクリーンフラグ;
37 
38  if (Single().isFullScreen)
39  {
40  SDL_RenderSetLogicalSize(Screen::GetHandle() , GetWidth() , GetHeight() );
41  SDL_SetWindowFullscreen(Single().handle, SDL_WINDOW_FULLSCREEN_DESKTOP);
42  }
43  else
44  {
45  SDL_SetWindowFullscreen(Single().handle, 0);
46  SDL_SetWindowSize(Single().handle, GetWidth(), GetHeight());
47  }
48  return false;
49  }
50 
52  static bool SetTitle(const char *タイトル名)
53  {
54  SDL_SetWindowTitle( Single().handle , タイトル名 );
55  return true;
56  }
57 
59  static bool SetIconID(int アイコンID)
60  {
61  return false;
62  }
63 
65  static bool SetSizeChangeEnable(bool 拡大縮小可能フラグ)
66  {
67  return false;
68  }
69 
71  static bool SetSize(int 幅,int 高さ )
72  {
73  Window::Single().width = 幅;
74  Window::Single().height = 高さ;
75 
76  SDL_RenderSetLogicalSize(Screen::GetHandle(), 幅, 高さ);
77  SDL_SetWindowSize( Single().handle , 幅, 高さ);
78  return true;
79  }
80 
82  static int GetWidth()
83  {
84  return Single().width;
85  }
86 
88  static int GetHeight()
89  {
90  return Single().height;
91  }
92 };
93 }
static int GetWidth()
ウィンドウ幅の取得.
Definition: Window.h:82
マウスの状態を表すクラス.
Definition: Mouse.h:12
static bool SetIconID(int アイコンID)
アイコンIDの設定[DXLIB].
Definition: Window.h:59
static int GetHeight()
ウィンドウ高さの取得.
Definition: Window.h:88
static bool SetSizeChangeEnable(bool 拡大縮小可能フラグ)
ウィンドウの拡大縮小可否設定[DXLIB].
Definition: Window.h:65
static bool SetTitle(const char *タイトル名)
ウィンドウタイトルを設定.
Definition: Window.h:52
Definition: Touch.h:7
ライブラリの初期化やシステム的な処理を行う関数群.
Definition: System.h:13
static bool SetFullScreen(bool フルスクリーンフラグ)
スクリーンモードを設定する.
Definition: Window.h:34
static bool SetSize(int 幅, int 高さ)
ウィンドウサイズの設定.
Definition: Window.h:71
Definition: Touch.h:69
ウィンドウを表すクラス.
Definition: Window.h:9
static ScreenHandle GetHandle()
スクリーンハンドルを取得.
Definition: Screen.h:49