YSTest: DSMain.h 源文件

YSTest PreAlpha_b500_20140530 The YSLib Test Project

- 首页
- 相关页面
- 模块
- 命名空间
- 类
- 文件

- 文件列表
- 文件成员

全部 类 命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义 组 页
DSMain.h
浏览该文件的文档.
1 /*
2 © 2012-2013 FrankHB.
3
4 This file is part of the YSLib project, and may only be used,
5 modified, and distributed under the terms of the YSLib project
6 license, LICENSE.TXT. By continuing to use, modify, or distribute
7 this file you indicate that you have read the license and
8 understand and accept it fully.
9 */
10
28 #ifndef INC_Helper_DSMain_h_
29 #define INC_Helper_DSMain_h_ 1
30
31 #include "Helper/YModules.h"
32 #include YFM_Helper_GUIApplication
33 #include YFM_YCLib_Video
34
35 namespace YSLib
36 {
37
38 #if YCL_DS || YF_Hosted
39 # ifndef SCREEN_WIDTH
40 # define SCREEN_WIDTH 256
41 # endif
42 # ifndef SCREEN_HEIGHT
43 # define SCREEN_HEIGHT 192
44 # endif
45
56 const SDst MainScreenWidth(SCREEN_WIDTH), MainScreenHeight(SCREEN_HEIGHT);
58
59
60 namespace Devices
61 {
62 class DSScreen;
63 } // namespace Devices;
64
65
71 class YF_API DSApplication : public GUIApplication,
72 private platform_ex::DSVideoState
73 {
74 private:
79 array<unique_ptr<Devices::DSScreen>, 2> scrs;
80
81 # if YCL_Win32
82
86 unique_ptr<Host::WindowThread> p_wnd_thrd;
87 # endif
88
89 public:
94 DSApplication();
95
100 ~DSApplication() override;
101
103 using DSVideoState::IsLCDMainOnTop;
105 DefPred(const ynothrow, ScreenReady, bool(scrs[0]) && bool(scrs[1]))
106
107
112 Devices::DSScreen&
113 GetDSScreenUp() const ynothrow;
119 Devices::DSScreen&
120 GetDSScreenDown() const ynothrow;
126 Devices::Screen&
127 GetScreenUp() const ynothrow;
133 Devices::Screen&
134 GetScreenDown() const ynothrow;
135
140 void
141 SwapScreens();
142 };
143
144
149 YF_API bool
150 InitConsole(Devices::Screen&, Drawing::PixelType, Drawing::PixelType);
151
156 YF_API void
157 ShowFatalError(const char*);
158
159 # if YCL_Win32
160 namespace MinGW32
161 {
162
163 using namespace platform_ex;
164
165 YF_API void
166 TestFramework(size_t);
167
168 } // namespace MinGW32;
169 # endif
170 #else
171 # error "Only DS and hosted platform supported."
172 #endif
173
174 } // namespace YSLib;
175
176 #endif
177
YSLib::Devices::Screen
屏幕。
Definition: ydevice.h:126
DefPred
#define DefPred(_q, _n,...)
Definition: YBaseMacro.h:172
YF_API
#define YF_API
Definition: Platform.h:64
platform::SDst
std::uint16_t SDst
屏幕坐标距离。
Definition: Video.h:39
ynothrow
#define ynothrow
YSLib 无异常抛出保证：若支持 noexcept 关键字， 指定特定的 noexcept 异常规范。
Definition: ydef.h:514
YModules.h
ShowFatalError
void ShowFatalError(const char *s)
Definition: DSMain.cpp:181
YSLib::Devices::DSScreen
DS 屏幕。
Definition: DSScreen.h:49
YSLib::GUIApplication
平台相关的应用程序类。
Definition: GUIApplication.h:51