SDXFrameWork 0.12 SDXFrameWork

- Main Page
- Related Pages
- Classes

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 int Music::mainVolume = MIX_MAX_VOLUME;
47 bool Music::nextLoop;
48 bool Music::nextRestart;
49
50 bool Loading::isLoading = false;
51 int Loading::loadingCount = 0;
52 int Loading::succesCount = 0;
53 std::mutex Loading::mtx;
54 std::vector<std::function<void(void)>> Loading::funcS;
55
56 double CompAngle(double 角度A, double 角度B)
57 {
58 double 角度差 = 角度A - 角度B;
59 角度差 = fmod(角度差, PAI * 2);
60
61 //角度差がPAI以上
62 if (角度差 > PAI)
63 {
64 角度差 -= PAI * 2;
65 }
66 //角度差が-PAI以下
67 if (角度差 < -PAI)
68 {
69 角度差 += PAI * 2;
70 }
71
72 return 角度差;
73 }
74
75 bool Renderer::SetTarget(Image *描画対象)
76 {
77 bool a;
78
79 if (描画対象 == nullptr)
80 {
81 a = (SDL_SetRenderTarget(handle, nullptr) == 0);
82 }
83 else
84 {
85 a = (SDL_SetRenderTarget(handle, 描画対象->GetHandle()) == 0);
86 }
87
88 if ( a )
89 {
90 target = 描画対象;
91 }
92
93 return a;
94 }
95 }
SDX::Color::Aqua
static const Color Aqua
水 [RGB]0,255,255
Definition: Color.h:93
SDX::PAI
const double PAI
円周率
Definition: SDX.h:26
SDX::Color::Red
static const Color Red
赤 [RGB]255,0,0
Definition: Color.h:83
SDX::Input::mouse
static Mouse mouse
マウス
Definition: Input.h:23
SDX::Color::Maroon
static const Color Maroon
栗 [RGB]128,0,0
Definition: Color.h:82
SDX::Color::Yellow
static const Color Yellow
黄 [[RGB]255,255,0
Definition: Color.h:89
SDX::Color::Olive
static const Color Olive
暗黄 [RGB]128,128,0
Definition: Color.h:88
SDX::Color::Blue
static const Color Blue
青 [RGB]0,0,255
Definition: Color.h:91
SDX::Color::Silver
static const Color Silver
銀 [R]192,192,192
Definition: Color.h:79
SDX::Input::gesture
static Gesture gesture
タッチジェスチャー
Definition: Input.h:26
SDX::Color::Green
static const Color Green
濃緑 [RGB]0,128,0
Definition: Color.h:86
SDX::Color::White
static const Color White
白 [RGB]255,255,255
Definition: Color.h:81
SDX::Image
画像データを表すクラス.
Definition: Image.h:17
SDX::Input::pad
static Joypad pad
ジョイパッド
Definition: Input.h:22
SDX::Color::Lime
static const Color Lime
明緑 [RGB]0,255,0
Definition: Color.h:87
SDX::Image::GetHandle
SDL_Texture * GetHandle() const
ハンドルを取得.
Definition: Image.h:175
SDX::Color::Gray
static const Color Gray
灰 [RGB]128,128,128
Definition: Color.h:80
SDX::Input::key
static Keyboard key
キーボード
Definition: Input.h:24
SDX::Color::Black
static const Color Black
黒 [RGB]0,0,0
Definition: Color.h:78
SDX::Renderer::SetTarget
bool SetTarget(Image *描画対象=nullptr)
描画先を変更.
Definition: SDXafx.h:75
SDX::Color::Teal
static const Color Teal
青緑 [RGB]0,128,128
Definition: Color.h:92
SDX::Input::touch
static Touch touch[10]
タッチ
Definition: Input.h:25
SDX::Renderer::mainRenderer
static Renderer & mainRenderer
メインウィンドウのレンダラー
Definition: Renderer.h:49
SDX::SubWindow::mainWindow
static SubWindow mainWindow
現在アクティブなウィンドウ
Definition: SubWindow.h:45
SDX::Color::Fuchsia
static const Color Fuchsia
赤紫 [RGB]255,0,255
Definition: Color.h:85
SDX::CompAngle
double CompAngle(double 角度A, double 角度B)
Aから見たBの角度差を-PAI～+PAIで返す.
Definition: SDXafx.h:56
SDX::Color::Purple
static const Color Purple
紫 [RGB]128,0,128
Definition: Color.h:84
SDX::Window::activeWindow
static SubWindow * activeWindow
現在アクティブなウィンドウ
Definition: Window.h:24
SDX::Color::Navy
static const Color Navy
濃青 [RGB]0,0,128
Definition: Color.h:90