SDXFrameWork  0.13
SDXFrameWork
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
SDXafx.h
1 //Copyright © 2014 SDXFramework
2 //[License]GNU Affero General Public License, version 3
3 //[Contact]http://sourceforge.jp/projects/dxframework/
4 #pragma once
5 //多重定義の関係でプリコンパイル済みヘッダーにのみインクルードするヘッダー
6 #include <Framework/ShapeHit.h>
7 #include <Framework/ShapeDraw.h>
8 
9 namespace SDX
10 {
11  const Color Color::Black = { 0, 0, 0 };
12  const Color Color::Silver = { 192, 192, 192 };
13  const Color Color::Gray(0x80, 0x80, 0x80);
14  const Color Color::White(0xff, 0xff, 0xff);
15  const Color Color::Maroon(0x80, 0x00, 0x00);
16  const Color Color::Red(0xff, 0x00, 0x00);
17  const Color Color::Purple(0x80, 0x00, 0x80);
18  const Color Color::Fuchsia(0xff, 0x00, 0xff);
19  const Color Color::Green(0x00, 0x80, 0x00);
20  const Color Color::Lime(0x00, 0xff, 0x00);
21  const Color Color::Olive(0x80, 0x80, 0x00);
22  const Color Color::Yellow(0xff, 0xff, 0x00);
23  const Color Color::Navy(0x00, 0x00, 0x80);
24  const Color Color::Blue(0x00, 0x00, 0xff);
25  const Color Color::Teal(0x00, 0x80, 0x80);
26  const Color Color::Aqua(0x00, 0xff, 0xff);
27 
28  std::string System::inputText;
29  std::string System::textComposition;
30  int System::textCursor;
31  int System::textSelection_len;
32 
33  Camera* Camera::active = nullptr;
34 
38  Touch Input::touch[10];
40 
43 
44  std::list<SubWindow*> SubWindow::windowS;
45 
46  Renderer* Screen::activeRenderer = nullptr;
48 
49  Music* Music::active = nullptr;
50  Music* Music::next = nullptr;
51  int Music::mainVolume = MIX_MAX_VOLUME;
52  bool Music::nextLoop;
53  bool Music::nextRestart;
54 
55  bool Loading::isLoading = false;
56  int Loading::loadingCount = 0;
57  int Loading::succesCount = 0;
58  std::mutex Loading::mtx;
59  std::vector<std::function<void(void)>> Loading::funcS;
60 
61  double CompAngle(double 角度A, double 角度B)
62  {
63  double 角度差 = 角度A - 角度B;
64  角度差 = fmod(角度差, PAI * 2);
65 
66  //角度差がPAI以上
67  if (角度差 > PAI)
68  {
69  角度差 -= PAI * 2;
70  }
71  //角度差が-PAI以下
72  if (角度差 < -PAI)
73  {
74  角度差 += PAI * 2;
75  }
76 
77  return 角度差;
78  }
79 
80  bool Renderer::SetTarget(Image *描画対象)
81  {
82  bool a;
83 
84  if (描画対象 == nullptr)
85  {
86  a = (SDL_SetRenderTarget(handle, nullptr) == 0);
87  }
88  else
89  {
90  a = (SDL_SetRenderTarget(handle, 描画対象->GetHandle()) == 0);
91  }
92 
93  if ( a )
94  {
95  target = 描画対象;
96  }
97 
98  return a;
99  }
100 
101  std::string GetTag(std::string &元の文字, std::string タグ名)
102  {
103  if (元の文字.find(タグ名) == std::string::npos)
104  {
105  return "0";
106  }
107 
108  int a = 元の文字.find(タグ名) + タグ名.size() + 1;
109  return 元の文字.substr(a, 元の文字.find("\"", a) - a);
110  }
111 }
static const Color Aqua
水 [RGB]0,255,255
Definition: Color.h:93
const double PAI
円周率
Definition: SDX.h:26
マウスの状態を表すクラス.
Definition: Mouse.h:30
static const Color Red
赤 [RGB]255,0,0
Definition: Color.h:83
キーボードの状態を表すクラス.
Definition: Keyboard.h:121
static Mouse mouse
マウス
Definition: Input.h:23
static const Color Maroon
栗 [RGB]128,0,0
Definition: Color.h:82
static const Color Yellow
黄 [[RGB]255,255,0
Definition: Color.h:89
static const Color Olive
暗黄 [RGB]128,128,0
Definition: Color.h:88
static const Color Blue
青 [RGB]0,0,255
Definition: Color.h:91
ジョイパッドの状態を表すクラス.
Definition: Joypad.h:63
タッチ操作の各種ジェスチャー.
Definition: Gesture.h:12
static const Color Silver
銀 [R]192,192,192
Definition: Color.h:79
static Gesture gesture
タッチジェスチャー
Definition: Input.h:26
static const Color Green
濃緑 [RGB]0,128,0
Definition: Color.h:86
static const Color White
白 [RGB]255,255,255
Definition: Color.h:81
画像データを表すクラス.
Definition: Image.h:17
描画先を表すクラス.
Definition: Renderer.h:27
static Joypad pad
ジョイパッド
Definition: Input.h:22
色を表すクラス.
Definition: Color.h:11
static const Color Lime
明緑 [RGB]0,255,0
Definition: Color.h:87
SDL_Texture * GetHandle() const
ハンドルを取得.
Definition: Image.h:175
static const Color Gray
灰 [RGB]128,128,128
Definition: Color.h:80
static Keyboard key
キーボード
Definition: Input.h:24
static const Color Black
黒 [RGB]0,0,0
Definition: Color.h:78
BGM用音声を表すクラス.
Definition: Music.h:15
bool SetTarget(Image *描画対象=nullptr)
描画先を変更.
Definition: SDXafx.h:80
ウィンドウを表すクラス.
Definition: SubWindow.h:14
static const Color Teal
青緑 [RGB]0,128,128
Definition: Color.h:92
static Touch touch[10]
タッチ
Definition: Input.h:25
2D用に座標変換を行うカメラを表すクラス.
Definition: Camera.h:12
static Renderer & mainRenderer
メインウィンドウのレンダラー
Definition: Renderer.h:49
static SubWindow mainWindow
現在アクティブなウィンドウ
Definition: SubWindow.h:46
static const Color Fuchsia
赤紫 [RGB]255,0,255
Definition: Color.h:85
タッチ操作.
Definition: Touch.h:12
double CompAngle(double 角度A, double 角度B)
Aから見たBの角度差を-PAI~+PAIで返す.
Definition: SDXafx.h:61
static const Color Purple
紫 [RGB]128,0,128
Definition: Color.h:84
static SubWindow * activeWindow
現在アクティブなウィンドウ
Definition: Window.h:24
static const Color Navy
濃青 [RGB]0,0,128
Definition: Color.h:90