feat: add render context blend mode
This commit is contained in:
parent
be23fedc84
commit
494a4d05f9
|
|
@ -429,6 +429,12 @@ void RenderContextImpl::SetTransform(const Matrix3x2& matrix)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RenderContextImpl::SetBlendMode(BlendMode blend)
|
||||||
|
{
|
||||||
|
KGE_ASSERT(render_ctx_ && "Render target has not been initialized!");
|
||||||
|
render_ctx_->SetPrimitiveBlend(D2D1_PRIMITIVE_BLEND(blend));
|
||||||
|
}
|
||||||
|
|
||||||
void RenderContextImpl::SetAntialiasMode(bool enabled)
|
void RenderContextImpl::SetAntialiasMode(bool enabled)
|
||||||
{
|
{
|
||||||
KGE_ASSERT(render_ctx_ && "Render target has not been initialized!");
|
KGE_ASSERT(render_ctx_ && "Render target has not been initialized!");
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,8 @@ public:
|
||||||
|
|
||||||
void SetTransform(const Matrix3x2& matrix) override;
|
void SetTransform(const Matrix3x2& matrix) override;
|
||||||
|
|
||||||
|
void SetBlendMode(BlendMode blend) override;
|
||||||
|
|
||||||
void SetAntialiasMode(bool enabled) override;
|
void SetAntialiasMode(bool enabled) override;
|
||||||
|
|
||||||
void SetTextAntialiasMode(TextAntialiasMode mode) override;
|
void SetTextAntialiasMode(TextAntialiasMode mode) override;
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,17 @@ enum class TextAntialiasMode
|
||||||
None ///< 不启用抗锯齿
|
None ///< 不启用抗锯齿
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// \~chinese
|
||||||
|
/// @brief »ìºÏģʽ
|
||||||
|
enum class BlendMode
|
||||||
|
{
|
||||||
|
SourceOver = 0,
|
||||||
|
Copy = 1,
|
||||||
|
Min = 2,
|
||||||
|
Add = 3,
|
||||||
|
Max = 4,
|
||||||
|
};
|
||||||
|
|
||||||
/// \~chinese
|
/// \~chinese
|
||||||
/// @brief 渲染上下文
|
/// @brief 渲染上下文
|
||||||
/// @details 渲染上下文将完成基础图元的绘制,并将绘制结果输出到特定的平面中
|
/// @details 渲染上下文将完成基础图元的绘制,并将绘制结果输出到特定的平面中
|
||||||
|
|
@ -204,6 +215,10 @@ public:
|
||||||
/// @brief 设置当前使用的线条样式
|
/// @brief 设置当前使用的线条样式
|
||||||
virtual void SetCurrentStrokeStyle(StrokeStylePtr stroke);
|
virtual void SetCurrentStrokeStyle(StrokeStylePtr stroke);
|
||||||
|
|
||||||
|
/// \~chinese
|
||||||
|
/// @brief ÉèÖûìºÏģʽ
|
||||||
|
virtual void SetBlendMode(BlendMode blend) = 0;
|
||||||
|
|
||||||
/// \~chinese
|
/// \~chinese
|
||||||
/// @brief 设置抗锯齿模式
|
/// @brief 设置抗锯齿模式
|
||||||
virtual void SetAntialiasMode(bool enabled) = 0;
|
virtual void SetAntialiasMode(bool enabled) = 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue