YSTest: ydevice.h 源文件

YSTest PreAlpha_b400_20130424 The YSLib Test Project

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

- 文件列表
- 文件成员

全部 类 命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义 组 页
ydevice.h
浏览该文件的文档.
1 ﻿/*
2 Copyright (C) by Franksoft 2009 - 2012.
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 #ifndef YSL_INC_CORE_YDEVICE_H_
29 #define YSL_INC_CORE_YDEVICE_H_ 1
30
31 #include "yobject.h"
32 #include "ygdibase.h"
33
34 YSL_BEGIN
35
36 YSL_BEGIN_NAMESPACE(Devices)
37
38 //图形设备。
39 class YF_API GraphicDevice : private noncopyable, protected Drawing::Graphics
40 {
41 public:
46 inline
47 GraphicDevice(SDst w, SDst h, Drawing::BitmapPtr p = {}) ynothrow
48 : Graphics(p, Drawing::Size(w, h))
49 {}
54 virtual DefEmptyDtor(GraphicDevice)
55
56
57
58 using Graphics::operator!;
59
60 using Graphics::operator bool;
62
64
65 using Graphics::GetBufferPtr;
66 using Graphics::GetHeight;
67 using Graphics::GetWidth;
68 using Graphics::GetSize;
69 using Graphics::GetSizeOfBuffer;
70 DefGetter(const ynothrow, const Graphics&, Context, *this)
72 };
73
74
75 //屏幕。
76 class YF_API Screen : public GraphicDevice
77 {
78 public:
83 Screen(SDst w, SDst h, Drawing::BitmapPtr p = {}) ynothrow
84 : GraphicDevice(w, h, p)
85 {}
86
91 virtual Drawing::BitmapPtr
92 GetCheckedBufferPtr() const ynothrow;
93
99 virtual void
100 Update(Drawing::BitmapPtr) ynothrow;
101 };
102
103 YSL_END_NAMESPACE(Devices)
104
105 YSL_END
106
107 #endif
108