From 8144613c949cf5d1c421ed59186eb41ae1b317bf Mon Sep 17 00:00:00 2001 From: bkaradzic Date: Sun, 20 Oct 2013 19:30:58 -0700 Subject: [PATCH] Cleanup. --- examples/13-stencil/stencil.cpp | 25 ++++++--------------- examples/14-shadowvolumes/shadowvolumes.cpp | 18 ++++----------- 2 files changed, 11 insertions(+), 32 deletions(-) diff --git a/examples/13-stencil/stencil.cpp b/examples/13-stencil/stencil.cpp index 29f2ca31..0b5a3938 100644 --- a/examples/13-stencil/stencil.cpp +++ b/examples/13-stencil/stencil.cpp @@ -610,17 +610,17 @@ static RenderState s_renderStates[RenderState::Count] = struct ViewState { - ViewState(uint32_t _width = 1280 - , uint32_t _height = 720 - ) + ViewState(uint32_t _width = 1280, uint32_t _height = 720) : m_width(_width) , m_height(_height) - { } + { + } uint32_t m_width; uint32_t m_height; - float m_view[16], m_proj[16]; + float m_view[16]; + float m_proj[16]; }; struct ClearValues @@ -639,18 +639,6 @@ struct ClearValues uint8_t m_clearStencil; }; -void setViewRectTransform(uint8_t _view, const ViewState& _viewState) -{ - bgfx::setViewRect(_view, 0, 0, _viewState.m_width, _viewState.m_height); - bgfx::setViewTransform(_view, _viewState.m_view, _viewState.m_proj); -} - -void setViewRectTransformMask(uint32_t _viewMask, const ViewState& _viewState) -{ - bgfx::setViewRectMask(_viewMask, 0, 0, _viewState.m_width, _viewState.m_height); - bgfx::setViewTransformMask(_viewMask, _viewState.m_view, _viewState.m_proj); -} - void clearView(uint8_t _id, uint8_t _flags, const ClearValues& _clearValues) { bgfx::setViewClear(_id @@ -1494,7 +1482,8 @@ int _main_(int /*_argc*/, char** /*_argv*/) ); // Setup view rect and transform for all used views. - setViewRectTransformMask(s_viewMask, viewState); + bgfx::setViewRectMask(s_viewMask, 0, 0, viewState.m_width, viewState.m_height); + bgfx::setViewTransformMask(s_viewMask, viewState.m_view, viewState.m_proj); s_viewMask = 0; // Advance to next frame. Rendering thread will be kicked to diff --git a/examples/14-shadowvolumes/shadowvolumes.cpp b/examples/14-shadowvolumes/shadowvolumes.cpp index 73279360..9c3371dd 100644 --- a/examples/14-shadowvolumes/shadowvolumes.cpp +++ b/examples/14-shadowvolumes/shadowvolumes.cpp @@ -659,21 +659,10 @@ struct ViewState uint32_t m_width; uint32_t m_height; - float m_view[16], m_proj[16]; + float m_view[16]; + float m_proj[16]; }; -void setViewRectTransform(uint8_t _view, const ViewState& _viewState) -{ - bgfx::setViewRect(_view, 0, 0, _viewState.m_width, _viewState.m_height); - bgfx::setViewTransform(_view, _viewState.m_view, _viewState.m_proj); -} - -void setViewRectTransformMask(uint32_t _viewMask, const ViewState& _viewState) -{ - bgfx::setViewRectMask(_viewMask, 0, 0, _viewState.m_width, _viewState.m_height); - bgfx::setViewTransformMask(_viewMask, _viewState.m_view, _viewState.m_proj); -} - struct ClearValues { uint32_t m_clearRgba; @@ -2752,7 +2741,8 @@ int _main_(int /*_argc*/, char** /*_argv*/) } // Setup view rect and transform for all used views. - setViewRectTransformMask(s_viewMask, viewState); + bgfx::setViewRectMask(s_viewMask, 0, 0, viewState.m_width, viewState.m_height); + bgfx::setViewTransformMask(s_viewMask, viewState.m_view, viewState.m_proj); s_viewMask = 0; // Advance to next frame. Rendering thread will be kicked to