summaryrefslogtreecommitdiffstats
path: root/src/render/backend/rendercommand.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-08-24 18:00:38 +0200
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-11-13 09:59:28 +0000
commit30d8f4d0c8bdae9d6e632c5becea3c4c0ccbecfd (patch)
treeb7fde7d660fbc532a06afc953f64463304fc26e7 /src/render/backend/rendercommand.cpp
parent77738989396b79998d2b494962817376690f78a9 (diff)
Make BackToFront sorting work
Change-Id: I9f2442b49d825a36bef7036ee0893a17464bd73c Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
Diffstat (limited to 'src/render/backend/rendercommand.cpp')
-rw-r--r--src/render/backend/rendercommand.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/render/backend/rendercommand.cpp b/src/render/backend/rendercommand.cpp
index a3e971fd2..6def67187 100644
--- a/src/render/backend/rendercommand.cpp
+++ b/src/render/backend/rendercommand.cpp
@@ -43,12 +43,17 @@ namespace Qt3DRender {
namespace Render {
RenderCommand::RenderCommand()
+ : m_sortBackToFront(false)
{
m_sortingType.global = 0;
}
bool compareCommands(RenderCommand *r1, RenderCommand *r2)
{
+ // The smaller m_depth is, the closer it is to the eye.
+ if (r1->m_sortBackToFront && r2->m_sortBackToFront)
+ return r1->m_depth > r2->m_depth;
+
return r1->m_sortingType.global < r2->m_sortingType.global;
}