Ndk/RenderSystem: Finish first implementation

Huge WIP, but I have a first render with it


Former-commit-id: 82ecea8b6ce5c452818f1585c61af7623c28e958
This commit is contained in:
Lynix
2015-06-04 00:20:51 +02:00
parent fac893f379
commit 80ed8c48bd
4 changed files with 31 additions and 0 deletions

View File

@@ -3,6 +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 <NDK/Components/CameraComponent.hpp>
#include <NDK/Components/GraphicsComponent.hpp>
#include <NDK/Components/NodeComponent.hpp>
@@ -21,6 +22,23 @@ namespace Ndk
NodeComponent& cameraNode = camera->GetComponent<NodeComponent>();
camComponent.ApplyView();
NzScene dummyScene;
dummyScene.SetViewer(camComponent);
NzAbstractRenderQueue* renderQueue = m_renderTechnique.GetRenderQueue();
renderQueue->Clear();
for (const Ndk::EntityHandle& drawable : m_drawables)
{
GraphicsComponent& graphicsComponent = drawable->GetComponent<GraphicsComponent>();
NodeComponent& drawableNode = drawable->GetComponent<NodeComponent>();
graphicsComponent.AddToRenderQueue(renderQueue, drawableNode.GetTransformMatrix());
}
m_renderTechnique.Clear(&dummyScene);
m_renderTechnique.Draw(&dummyScene);
}
}