SDXFrameWork 0.13 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 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
35 Joypad Input::pad;
36 Mouse Input::mouse;
37 Keyboard Input::key;
38 Touch Input::touch[10];
39 Gesture Input::gesture;
40
41 Renderer &Renderer::mainRenderer = SubWindow::mainWindow.renderer;
42 SubWindow SubWindow::mainWindow;
43
44 std::list<SubWindow*> SubWindow::windowS;
45
46 Renderer* Screen::activeRenderer = nullptr;
47 SubWindow* Window::activeWindow = 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 }
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::Mouse
マウスの状態を表すクラス.
Definition: Mouse.h:30
SDX::Color::Red
static const Color Red
赤 [RGB]255,0,0
Definition: Color.h:83
SDX::Keyboard
キーボードの状態を表すクラス.
Definition: Keyboard.h:121
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::Joypad
ジョイパッドの状態を表すクラス.
Definition: Joypad.h:63
SDX::Gesture
タッチ操作の各種ジェスチャー.
Definition: Gesture.h:12
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::Renderer
描画先を表すクラス.
Definition: Renderer.h:27
SDX::Input::pad
static Joypad pad
ジョイパッド
Definition: Input.h:22
SDX::Color
色を表すクラス.
Definition: Color.h:11
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::Music
BGM用音声を表すクラス.
Definition: Music.h:15
SDX::Renderer::SetTarget
bool SetTarget(Image *描画対象=nullptr)
描画先を変更.
Definition: SDXafx.h:80
SDX::SubWindow
ウィンドウを表すクラス.
Definition: SubWindow.h:14
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::Camera
2D用に座標変換を行うカメラを表すクラス.
Definition: Camera.h:12
SDX::Renderer::mainRenderer
static Renderer & mainRenderer
メインウィンドウのレンダラー
Definition: Renderer.h:49
SDX::SubWindow::mainWindow
static SubWindow mainWindow
現在アクティブなウィンドウ
Definition: SubWindow.h:46
SDX::Color::Fuchsia
static const Color Fuchsia
赤紫 [RGB]255,0,255
Definition: Color.h:85
SDX::Touch
タッチ操作.
Definition: Touch.h:12
SDX::CompAngle
double CompAngle(double 角度A, double 角度B)
Aから見たBの角度差を-PAI～+PAIで返す.
Definition: SDXafx.h:61
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