YSTest  PreAlpha_b500_20140530
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
ydevice.cpp
浏览该文件的文档.
1 /*
2  © 2009-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 "YSLib/Core/YModules.h"
29 #include YFM_YSLib_Core_YDevice
30 
31 namespace YSLib
32 {
33 
34 using namespace Drawing;
35 
36 namespace Devices
37 {
38 
40 Screen::GetCheckedBufferPtr() const ynothrow
41 {
42  YAssertNonnull(GetBufferPtr());
43  return GetBufferPtr();
44 }
45 
46 void
47 Screen::Update(BitmapPtr buf) ynothrow
48 {
49  // TODO: Explicitly assert that copy cannot throw.
50  std::copy_n(buf, GetAreaOf(GetSize()), GetCheckedBufferPtr());
51 }
52 
53 } // namespace Devices;
54 
55 } // namespace YSLib;
56 
yconstfn auto GetAreaOf(const Size &s) ynothrow-> decltype(s.Width *s.Height)
取面积。
Definition: ygdibase.h:404
#define ynothrow
YSLib 无异常抛出保证:若支持 noexcept 关键字, 指定特定的 noexcept 异常规范。
Definition: ydef.h:514
#define YAssertNonnull(_expr)
Definition: cassert.h:81
PixelType * BitmapPtr
Definition: Video.h:295