YSTest: DSWindow.cpp 源文件

YSTest PreAlpha_b400_20130424 The YSLib Test Project

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

- 文件列表
- 文件成员

全部 类 命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义 组 页
DSWindow.cpp
浏览该文件的文档.
1 ﻿/*
2 Copyright by FrankHB 2013.
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 #include "DSWindow.h"
29 #include "DSScreen.h" // for GSurface;
30
31 YSL_BEGIN
32
33 #if YCL_HOSTED
34 using Devices::DSScreen;
35 using Drawing::Point;
36
37 YSL_BEGIN_NAMESPACE(Host)
38
39 DSWindow::DSWindow(NativeWindowHandle h, DSScreen& s_up, DSScreen& s_dn,
40 Environment& e)
41 : Window(h, e), scr_up(s_up), scr_dn(s_dn)
42 {}
43
44 pair<Point, Point>
45 DSWindow::GetInputBounds() const ynothrow
46 {
47 return {Point(0, MainScreenHeight),
48 Point(MainScreenWidth, MainScreenHeight << 1)};
49 }
50
51 void
52 DSWindow::OnDestroy()
53 {
54 Window::OnDestroy(),
55 YSLib::PostQuitMessage(0);
56 // NOTE: Try to make sure all shells are released before destructing the
57 // instance of %DSApplication.
58 }
59
60 void
61 DSWindow::OnPaint()
62 {
63 GSurface<WindowRegionDeviceContext> sf(GetNativeHandle());
64
65 scr_up.UpdateToSurface(sf),
66 scr_dn.UpdateToSurface(sf);
67 }
68
69 YSL_END_NAMESPACE(Host)
70 #endif
71
72 YSL_END
73