33 #if YCL_MULTITHREAD == 1
43 using namespace Drawing;
50 std::chrono::nanoseconds host_sleep(
u64(1000000000 / g_max_free_fps));
61 InitializeMainWindow(
const wchar_t* wnd_title,
u16 wnd_w,
u16 wnd_h,
62 ::DWORD wstyle = WS_TILED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX)
64 ::RECT rect{0, 0, wnd_w, wnd_h};
66 ::AdjustWindowRect(&rect, wstyle, FALSE);
67 return ::CreateWindowW(Host::WindowClassName, wnd_title, wstyle,
68 CW_USEDEFAULT, CW_USEDEFAULT, rect.right - rect.left,
69 rect.bottom - rect.top, HWND_DESKTOP,
nullptr,
70 ::GetModuleHandleW(
nullptr),
nullptr);
84 using Devices::DSScreen;
86 YAssert(!YSLib::pApp,
"Duplicate instance found.");
100 using namespace Host;
102 YAssert(IsScreenReady(),
"Screen is not ready.");
104 p_wnd_thrd.reset(
new WindowThread([
this]{
105 return unique_ptr<Window>(
new DSWindow(InitializeMainWindow(
106 L"YSTest", 256, 384), *
scrs[0], *
scrs[1], GetHost()));
109 while(!p_wnd_thrd->GetWindowPtr())
111 std::this_thread::sleep_for(host_sleep);
113 const auto h_wnd(p_wnd_thrd->GetWindowPtr()->GetNativeHandle());
115 yunseq(
scrs[0]->WindowHandle = h_wnd,
scrs[1]->WindowHandle = h_wnd);
135 DSApplication::GetDSScreenUp() const
ynothrow
142 DSApplication::GetDSScreenDown() const
ynothrow
151 return GetDSScreenUp();
156 return GetDSScreenDown();
164 using namespace platform;
166 if(&FetchGlobalInstance<DSApplication>().
GetScreenUp() == &scr)
168 else if(&FetchGlobalInstance<DSApplication>().
GetScreenDown() == &scr)
176 # error Unsupported platform found!
184 using namespace platform;
188 std::printf(
"Fatal Error:\n%s\n", s);
196 TestFramework(
size_t idx)