Пример #1
0
    HDRPostProcessor::TempRenderTarget* HDRPostProcessor::GetTempRenderTarget(U32 width, U32 height, DXGI_FORMAT format, U32 mipMapLevels) {

        // Check if there is free renderTarget that has already been created

        for(auto it = tempRenderTargets.begin(); it != tempRenderTargets.end(); ++it) {
            TempRenderTarget* tempRT = *it;
            RenderTarget* rt = tempRT->renderTarget;
            if (!(tempRT->inUse) &&
                rt->GetWidth() == width &&
                rt->GetHeight() == height &&
                rt->GetRTViewFormat() == format &&
                rt->GetMipMapLevels() == mipMapLevels) {
                return tempRT;
            }
        }

        // If there are no specified renderTargets that are free, create one

        RenderTarget* renderTarget = RenderTarget::Create(lowLevelGraphics->GetDevice(), width, height, format, mipMapLevels);
        TempRenderTarget* tempRenderTarget = new TempRenderTarget(renderTarget);
        tempRenderTargets.push_back(tempRenderTarget);
        return tempRenderTarget;
    }
Пример #2
0
        void    Widget::Render(RenderTarget& target, RenderQueue& queue) const
        {
            OnPaint(target, queue);

            if (mUseScissor)
            {
                Area& area = ResourceManager::Get()->WidgetArea;
                area.PushArea(GetRect(true));
                const FloatRect& top = area.GetTopArea();

                target.Flush();

                RenderChildren(target, queue);

                queue.SetScissor(true, Vector2f(top.Left, target.GetHeight() - top.Bottom), Vector2f(top.GetSize().x, top.GetSize().y));
                target.Flush();
                area.PopArea();
            }
            else
            {
                queue.SetScissor(false);
                RenderChildren(target, queue);
            }
        }