SDXFrameWork  0.10
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  Camera* Camera::active = nullptr;
29 
30  Joypad Input::pad;
31  Mouse Input::mouse;
32  Keyboard Input::key;
33  Touch Input::touch[10];
34  Gesture Input::gesture;
35 
36  Renderer &Renderer::mainRenderer = SubWindow::mainWindow.renderer;
37  SubWindow SubWindow::mainWindow;
38 
39  std::list<SubWindow*> SubWindow::windowS;
40 
41  Renderer* Screen::activeRenderer = nullptr;
42  SubWindow* Window::activeWindow = nullptr;
43 
44  Music* Music::active = nullptr;
45  Music* Music::next = nullptr;
46  bool Music::nextLoop;
47  bool Music::nextRestart;
48 
49  bool Loading::isLoading = false;
50  int Loading::loadingCount = 0;
51  int Loading::succesCount = 0;
52  std::mutex Loading::mtx;
53  std::vector<std::function<void(void)>> Loading::funcS;
54 
55  double CompAngle(double 角度A, double 角度B)
56  {
57  double 角度差 = 角度A - 角度B;
58  角度差 = fmod(角度差, PAI * 2);
59 
60  //角度差がPAI以上
61  if (角度差 > PAI)
62  {
63  角度差 -= PAI * 2;
64  }
65  //角度差が-PAI以下
66  if (角度差 < -PAI)
67  {
68  角度差 += PAI * 2;
69  }
70 
71  return 角度差;
72  }
73 
74  bool Renderer::SetTarget(Image *描画対象)
75  {
76  bool a;
77 
78  if (描画対象 == nullptr)
79  {
80  a = (SDL_SetRenderTarget(handle, nullptr) == 0);
81  }
82  else
83  {
84  a = (SDL_SetRenderTarget(handle, 描画対象->GetHandle()) == 0);
85  }
86 
87  if ( a )
88  {
89  target = 描画対象;
90  }
91 
92  return a;
93  }
94 }
static const Color Aqua
水 [RGB]0,255,255
Definition: Color.h:93
const double PAI
円周率
Definition: SDX.h:26
static const Color Red
赤 [RGB]255,0,0
Definition: Color.h:83
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
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
static Joypad pad
ジョイパッド
Definition: Input.h:22
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
bool SetTarget(Image *描画対象=nullptr)
描画先を変更.
Definition: SDXafx.h:74
static const Color Teal
青緑 [RGB]0,128,128
Definition: Color.h:92
static Touch touch[10]
タッチ
Definition: Input.h:25
static Renderer & mainRenderer
メインウィンドウのレンダラー
Definition: Renderer.h:48
static SubWindow mainWindow
現在アクティブなウィンドウ
Definition: SubWindow.h:43
static const Color Fuchsia
赤紫 [RGB]255,0,255
Definition: Color.h:85
double CompAngle(double 角度A, double 角度B)
Aから見たBの角度差を-PAI~+PAIで返す.
Definition: SDXafx.h:55
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