YSTest  PreAlpha_b500_20140530
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
DSScreen.cpp
浏览该文件的文档.
1 /*
2  © 2013-2014 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 #include "DSScreen.h"
29 
30 namespace YSLib
31 {
32 
33 using namespace Drawing;
34 
35 namespace Devices
36 {
37 
38 #if YCL_DS
39 DSScreen::DSScreen(bool b) ynothrow
40  : Screen(MainScreenWidth, MainScreenHeight)
41 {
42  pBuffer = (b ? DS::InitScrDown : DS::InitScrUp)(bg);
43 }
44 
45 void
46 DSScreen::Update(BitmapPtr buf) ynothrow
47 {
48  DS::ScreenSynchronize(GetCheckedBufferPtr(), buf);
49 }
50 #elif YCL_Win32 || YCL_Android
51 DSScreen::DSScreen(bool b) ynothrow
52  : Screen(MainScreenWidth, MainScreenHeight),
53  Offset(), WindowHandle(),
54  rbuf(Size(MainScreenWidth, MainScreenHeight))
55 {
56  pBuffer = rbuf.GetBufferPtr();
57  if(b)
58  Offset.Y = MainScreenHeight;
59 }
60 
61 void
62 DSScreen::Update(Drawing::BitmapPtr p_buf) ynothrow
63 {
64  YAssert(bool(WindowHandle), "Null handle found.");
65  rbuf.UpdateFrom(p_buf);
66  rbuf.UpdateTo(WindowHandle, Offset);
67 }
68 #else
69 # error "Unsupported platform found."
70 #endif
71 
72 } // namespace Devices;
73 
74 } // namespace YSLib;
75 
DS 屏幕。
#define ynothrow
YSLib 无异常抛出保证:若支持 noexcept 关键字, 指定特定的 noexcept 异常规范。
Definition: ydef.h:514
PixelType * BitmapPtr
Definition: Video.h:295
屏幕区域大小。
Definition: ygdibase.h:249
#define YAssert(_expr, _msg)
Definition: cassert.h:73