1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
/*RenderText() called at rendering loop
IDWriteTextLayout textLayout_ is at Initialize. That does not go into loop.
*/
RenderText(/*...PARAMETERS...*/){
...
m_writeFactory->CreateTextLayout(
text, // The string to be laid out and formatted.
wcslen(text), // The length of the string.
textFormat, // The text format to apply to the string (contains font information, etc).
layoutSize.x, // The width of the layout box.
layoutSize.y, // The height of the layout box.
&textLayout_ // The IDWriteTextLayout interface pointer.
);
DWRITE_TEXT_RANGE textRange; textRange.length = wcslen(text); textRange.startPosition = 0;
textLayout_->SetFontFamilyName(fontFamily, textRange);
m_d2dRenderTarget->DrawTextLayout(D2D1_POINT_2F{ (float)posX, (float)posY }, textLayout_, m_whiteBrush, D2D1_DRAW_TEXT_OPTIONS::D2D1_DRAW_TEXT_OPTIONS_CLIP); //OVERFLOW HIDDEN
//m_d2dRenderTarget->DrawTextW(wcharText, wcslen(wcharText), textFormat, RectF(posX, posY, m_screenSize.x, m_screenSize.y), m_whiteBrush);
m_d2dRenderTarget->PopLayer();
m_d2dRenderTarget->EndDraw();
textLayout_->Release();
textLayout_ = 0;
...
}
| |