Graphics: Make Background/RenderTechnique independent from Scene

Former-commit-id: d588a3bb74b08d79990a278ad2e399e9797755b4
This commit is contained in:
Lynix
2015-06-09 00:26:13 +02:00
parent e97cc666a1
commit 6f2f8d6390
32 changed files with 124 additions and 86 deletions

View File

@@ -3,7 +3,7 @@
// For conditions of distribution and use, see copyright notice in Prerequesites.hpp
#include <NDK/Systems/RenderSystem.hpp>
#include <Nazara/Graphics/Scene.hpp>
#include <Nazara/Graphics/ColorBackground.hpp>
#include <NDK/Components/CameraComponent.hpp>
#include <NDK/Components/GraphicsComponent.hpp>
#include <NDK/Components/NodeComponent.hpp>
@@ -21,9 +21,6 @@ namespace Ndk
CameraComponent& camComponent = camera->GetComponent<CameraComponent>();
camComponent.ApplyView();
NzScene dummyScene;
dummyScene.SetViewer(camComponent);
NzAbstractRenderQueue* renderQueue = m_renderTechnique.GetRenderQueue();
renderQueue->Clear();
@@ -35,7 +32,13 @@ namespace Ndk
graphicsComponent.AddToRenderQueue(renderQueue, drawableNode.GetTransformMatrix());
}
m_renderTechnique.Draw(&dummyScene);
NzColorBackground background;
NzSceneData sceneData;
sceneData.ambientColor = NzColor(25, 25, 25);
sceneData.background = &background;
m_renderTechnique.Draw(&camComponent, sceneData);
}
}