Scope
|
#include <d2wrap.h>
Public Member Functions | |
RenderTarget (HWND _hwnd) | |
~RenderTarget () | |
HRESULT | Resize (const D2D1_SIZE_U &_pixelSize) |
D2D1_WINDOW_STATE | CheckWindowState () |
D2D1_SIZE_F | GetSize () const |
Methods for creation of resources | |
HRESULT | CreateSolidColorBrush (ID2D1SolidColorBrush **_brush, const D2D1_COLOR_F &_color=D2D1::ColorF(D2D1::ColorF::White)) |
HRESULT | CreateBitmap (ID2D1Bitmap **_bitmap, const uint32_t &_yres, const uint32_t &_xres) |
HRESULT | CreateTextFormat (IDWriteTextFormat **_text_format) |
HRESULT | CreateRectangleGeometry (const D2D1_RECT_F &_rectangle, ID2D1RectangleGeometry **_rectangleGeometry) |
Methods for drawing | |
void | BeginDraw () |
void | SetTransform (const D2D1_MATRIX_3X2_F &_transform) |
void | Clear (const D2D1_COLOR_F &_clearColor=D2D1::ColorF(D2D1::ColorF::White)) |
void | ClearWindow () |
void | DrawBitmap (ID2D1Bitmap *_bitmap, D2D1_BITMAP_INTERPOLATION_MODE _mode=D2D1_BITMAP_INTERPOLATION_MODE_LINEAR) |
void | DrawLine (const D2D1_POINT_2F &_point0, const D2D1_POINT_2F &_point1, ID2D1Brush *_brush, const FLOAT &_strokeWidth) |
void | DrawText (const CString &_text, const D2D1_RECT_F *_layoutRect, IDWriteTextFormat *_text_format, ID2D1Brush *_brush) |
void | FillRectangle (const D2D1_RECT_F *_rect, ID2D1Brush *_brush) |
HRESULT | Flush () |
HRESULT | EndDraw () |
Protected Member Functions | |
RenderTarget (const RenderTarget &) | |
RenderTarget & | operator= (const RenderTarget &) |
Protected Attributes | |
d2dfactory< D2D1_FACTORY_TYPE_MULTI_THREADED > | factory |
ID2D1HwndRenderTarget * | target |
IDWriteFactory * | dwrite_factory |
D2D1_PIXEL_FORMAT | pixelformat |
Wrapper around a Direct2D render target and the underlying Direct2D factory and IDWriteFactory.
|
protected |
disable copy
d2d::RenderTarget::RenderTarget | ( | HWND | _hwnd | ) |
Create render target on window.
Definition at line 10 of file d2wrap.cpp.
d2d::RenderTarget::~RenderTarget | ( | ) |
Release resources.
Definition at line 42 of file d2wrap.cpp.
|
protected |
disable assignment
HRESULT d2d::RenderTarget::CreateSolidColorBrush | ( | ID2D1SolidColorBrush ** | _brush, |
const D2D1_COLOR_F & | _color = D2D1::ColorF(D2D1::ColorF::White) |
||
) |
Create a solid color brush.
Definition at line 47 of file d2wrap.cpp.
HRESULT d2d::RenderTarget::CreateBitmap | ( | ID2D1Bitmap ** | _bitmap, |
const uint32_t & | _yres, | ||
const uint32_t & | _xres | ||
) |
Creates a new Direct2D bitmap.
[out] | _bitmap | handle to the new bitmap |
[in] | _yres,_xres | resolution of the bitmap |
Definition at line 52 of file d2wrap.cpp.
HRESULT d2d::RenderTarget::CreateTextFormat | ( | IDWriteTextFormat ** | _text_format | ) |
Create a text format.
Definition at line 79 of file d2wrap.cpp.
HRESULT d2d::RenderTarget::CreateRectangleGeometry | ( | const D2D1_RECT_F & | _rectangle, |
ID2D1RectangleGeometry ** | _rectangleGeometry | ||
) |
Create a rectangle geometry.
Definition at line 96 of file d2wrap.cpp.
void d2d::RenderTarget::BeginDraw | ( | ) |
Trigger Direct2D begin draw.
Definition at line 101 of file d2wrap.cpp.
void d2d::RenderTarget::SetTransform | ( | const D2D1_MATRIX_3X2_F & | _transform | ) |
Set current transform matrix.
Definition at line 109 of file d2wrap.cpp.
void d2d::RenderTarget::Clear | ( | const D2D1_COLOR_F & | _clearColor = D2D1::ColorF(D2D1::ColorF::White) | ) |
Clear the window with a certain color.
Definition at line 118 of file d2wrap.cpp.
void d2d::RenderTarget::ClearWindow | ( | ) |
Clear the window with black.
Definition at line 113 of file d2wrap.cpp.
void d2d::RenderTarget::DrawBitmap | ( | ID2D1Bitmap * | _bitmap, |
D2D1_BITMAP_INTERPOLATION_MODE | _mode = D2D1_BITMAP_INTERPOLATION_MODE_LINEAR |
||
) |
Draws a Direct2D bitmap.
[in] | _bitmap | pointer to bitmap |
[in] | _mode | interpolation mode, possible values
|
Definition at line 123 of file d2wrap.cpp.
void d2d::RenderTarget::DrawLine | ( | const D2D1_POINT_2F & | _point0, |
const D2D1_POINT_2F & | _point1, | ||
ID2D1Brush * | _brush, | ||
const FLOAT & | _strokeWidth | ||
) |
Draw a line.
Definition at line 131 of file d2wrap.cpp.
void d2d::RenderTarget::DrawText | ( | const CString & | _text, |
const D2D1_RECT_F * | _layoutRect, | ||
IDWriteTextFormat * | _text_format, | ||
ID2D1Brush * | _brush | ||
) |
Draw text.
Definition at line 135 of file d2wrap.cpp.
void d2d::RenderTarget::FillRectangle | ( | const D2D1_RECT_F * | _rect, |
ID2D1Brush * | _brush | ||
) |
Fill a rectangle.
Definition at line 143 of file d2wrap.cpp.
HRESULT d2d::RenderTarget::Flush | ( | ) |
Flush the render target.
Definition at line 159 of file d2wrap.cpp.
HRESULT d2d::RenderTarget::EndDraw | ( | ) |
Trigger Direct2D end draw.
Definition at line 151 of file d2wrap.cpp.
HRESULT d2d::RenderTarget::Resize | ( | const D2D1_SIZE_U & | _pixelSize | ) |
Resize render target.
Definition at line 155 of file d2wrap.cpp.
D2D1_WINDOW_STATE d2d::RenderTarget::CheckWindowState | ( | ) |
D2D1_SIZE_F d2d::RenderTarget::GetSize | ( | void | ) | const |
Get size of render target.
Definition at line 147 of file d2wrap.cpp.
|
protected |
|
protected |
|
protected |
|
protected |