update RenderContext
This commit is contained in:
parent
192a520405
commit
678b47b9bd
|
|
@ -76,19 +76,21 @@ void RenderContextImpl::DiscardDeviceResources()
|
||||||
|
|
||||||
void RenderContextImpl::BeginDraw()
|
void RenderContextImpl::BeginDraw()
|
||||||
{
|
{
|
||||||
|
KGE_ASSERT(render_target_ && "Render target has not been initialized!");
|
||||||
|
|
||||||
SaveDrawingState();
|
SaveDrawingState();
|
||||||
|
|
||||||
RenderContext::BeginDraw();
|
RenderContext::BeginDraw();
|
||||||
|
|
||||||
if (render_target_)
|
render_target_->BeginDraw();
|
||||||
{
|
|
||||||
render_target_->BeginDraw();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderContextImpl::EndDraw()
|
void RenderContextImpl::EndDraw()
|
||||||
{
|
{
|
||||||
KGE_THROW_IF_FAILED(render_target_->EndDraw(), "ID2D1RenderTarget EndDraw failed");
|
KGE_ASSERT(render_target_ && "Render target has not been initialized!");
|
||||||
|
|
||||||
|
HRESULT hr = render_target_->EndDraw();
|
||||||
|
KGE_THROW_IF_FAILED(hr, "ID2D1RenderTarget EndDraw failed");
|
||||||
|
|
||||||
RenderContext::EndDraw();
|
RenderContext::EndDraw();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,14 @@
|
||||||
} while (0)
|
} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef KGE_THROW_IF
|
||||||
|
#define KGE_THROW_IF(EXPRESSION, MESSAGE) \
|
||||||
|
if (EXPRESSION) \
|
||||||
|
{ \
|
||||||
|
KGE_THROW(MESSAGE); \
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef KGE_THROW_SYSTEM_ERROR
|
#ifndef KGE_THROW_SYSTEM_ERROR
|
||||||
#define KGE_THROW_SYSTEM_ERROR(ERRCODE, MESSAGE) \
|
#define KGE_THROW_SYSTEM_ERROR(ERRCODE, MESSAGE) \
|
||||||
do \
|
do \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue