28 #ifndef YSL_INC_Core_YDevice_h_
29 #define YSL_INC_Core_YDevice_h_ 1
32 #include YFM_YSLib_Core_YObject
33 #include YFM_YSLib_Core_YGDIBase
73 virtual
DefGetter(const, unique_ptr<Drawing::IImage>, BackBuffer,
74 unique_ptr<Drawing::IImage>())
95 using Tester = std::function<bool(const KeyInput&, KeyIndex)>;
106 YAssert(w != 0,
"Invalid key input device found.");
113 virtual PDefH(KeyIndex, Map, KeyIndex code)
114 ImplRet(code < width ? code : 0)
117 static PDefH(
bool, DefaultTest, const
KeyInput& keys, KeyIndex code)
118 ImplRet(code < KeyBitsetWidth ? keys[code] : false)
134 : GraphicDevice(w, h, p)
149 GetCheckedBufferPtr() const ynothrow;
KeyIndex width
宽度:设备支持的按键编码上界(不含)。
#define DefDeDtor(_t)
定义默认析构函数。
std::size_t KeyIndex
按键索引类型:标识特定的按键在按键集合中的位置。
GraphicDevice(SDst w, SDst h, Drawing::BitmapPtr p={}) ynothrow
构造:指定宽度、高度和缓冲区指针。
std::uint16_t SDst
屏幕坐标距离。
#define DefGetter(_q, _t, _n,...)
不可复制对象:禁止派生类调用默认原型的复制构造函数和复制赋值操作符。
#define ynothrow
YSLib 无异常抛出保证:若支持 noexcept 关键字, 指定特定的 noexcept 异常规范。
KeyInputDevice(KeyIndex w=KeyBitsetWidth)
Screen(SDst w, SDst h, Drawing::BitmapPtr p={}) ynothrow
构造:指定宽度、高度和缓冲区指针。
Screen(const Drawing::Size &s, Drawing::BitmapPtr p={}) ynothrow
构造:指定大小和缓冲区指针。
if(YB_UNLIKELY(r >=sGraphics.Height)) throw std return pBuffer r *sGraphics Width
std::bitset< KeyBitsetWidth > KeyInput
按键并行位宽。
#define YAssert(_expr, _msg)
std::function< bool(const KeyInput &, KeyIndex)> Tester
输入测试器:判断是否在指定索引上激活输入状态。