From 26191e40da44ae2cd57dd80f08e8c4def4d6eae0 Mon Sep 17 00:00:00 2001 From: Benlitz Date: Wed, 31 Jul 2013 17:27:23 +0000 Subject: [PATCH] gpu: getters in RenderContext class --- src/gpu/rendercontext.cpp | 49 +++++++++++++++++++++++++++++++++++++ src/lol/gpu/rendercontext.h | 11 +++++++++ 2 files changed, 60 insertions(+) diff --git a/src/gpu/rendercontext.cpp b/src/gpu/rendercontext.cpp index 5fcffa1d..5f024bad 100644 --- a/src/gpu/rendercontext.cpp +++ b/src/gpu/rendercontext.cpp @@ -110,6 +110,10 @@ void RenderContext::SetViewport(ibox2 viewport) g_renderer->SetViewport(viewport); } +ibox2 RenderContext::GetViewport() +{ + return g_renderer->GetViewport(); +} void RenderContext::SetClearColor(vec4 color) { @@ -119,6 +123,11 @@ void RenderContext::SetClearColor(vec4 color) g_renderer->SetClearColor(color); } +vec4 RenderContext::GetClearColor() +{ + return g_renderer->GetClearColor(); +} + void RenderContext::SetClearDepth(float depth) { if (!m_data->m_clear_depth.HasChanged()) @@ -127,6 +136,11 @@ void RenderContext::SetClearDepth(float depth) g_renderer->SetClearDepth(depth); } +float RenderContext::GetClearDepth() +{ + return g_renderer->GetClearDepth(); +} + void RenderContext::SetAlphaFunc(AlphaFunc func, float alpha) { if (!m_data->m_alpha_func.HasChanged()) @@ -137,6 +151,16 @@ void RenderContext::SetAlphaFunc(AlphaFunc func, float alpha) g_renderer->SetAlphaFunc(func, alpha); } +AlphaFunc RenderContext::GetAlphaFunc() +{ + return g_renderer->GetAlphaFunc(); +} + +float RenderContext::GetAlphaValue() +{ + return g_renderer->GetAlphaValue(); +} + void RenderContext::SetBlendFunc(BlendFunc src, BlendFunc dst) { if (!m_data->m_blend_src.HasChanged()) @@ -147,6 +171,16 @@ void RenderContext::SetBlendFunc(BlendFunc src, BlendFunc dst) g_renderer->SetBlendFunc(src, dst); } +BlendFunc RenderContext::GetBlendFuncSrc() +{ + return g_renderer->GetBlendFuncSrc(); +} + +BlendFunc RenderContext::GetBlendFuncDst() +{ + return g_renderer->GetBlendFuncDst(); +} + void RenderContext::SetDepthFunc(DepthFunc func) { if (!m_data->m_depth_func.HasChanged()) @@ -155,6 +189,11 @@ void RenderContext::SetDepthFunc(DepthFunc func) g_renderer->SetDepthFunc(func); } +DepthFunc RenderContext::GetDepthFunc() +{ + return g_renderer->GetDepthFunc(); +} + void RenderContext::SetCullMode(CullMode mode) { if (!m_data->m_cull_mode.HasChanged()) @@ -163,6 +202,11 @@ void RenderContext::SetCullMode(CullMode mode) g_renderer->SetCullMode(mode); } +CullMode RenderContext::GetCullMode() +{ + return g_renderer->GetCullMode(); +} + void RenderContext::SetPolygonMode(PolygonMode mode) { if (!m_data->m_polygon_mode.HasChanged()) @@ -171,5 +215,10 @@ void RenderContext::SetPolygonMode(PolygonMode mode) g_renderer->SetPolygonMode(mode); } +PolygonMode RenderContext::GetPolygonMode() +{ + return g_renderer->GetPolygonMode(); +} + } /* namespace lol */ diff --git a/src/lol/gpu/rendercontext.h b/src/lol/gpu/rendercontext.h index 85022926..7ed9e169 100644 --- a/src/lol/gpu/rendercontext.h +++ b/src/lol/gpu/rendercontext.h @@ -36,6 +36,17 @@ public: void SetCullMode(CullMode mode); void SetPolygonMode(PolygonMode mode); + ibox2 GetViewport(); + vec4 GetClearColor(); + float GetClearDepth(); + AlphaFunc GetAlphaFunc(); + float GetAlphaValue(); + BlendFunc GetBlendFuncSrc(); + BlendFunc GetBlendFuncDst(); + DepthFunc GetDepthFunc(); + CullMode GetCullMode(); + PolygonMode GetPolygonMode(); + private: RenderContextData *m_data; };