Files
NazaraEngine/SDK/include/NDK/Systems/RenderSystem.hpp
Lynix 767a0feda0 Sdk/RenderSystem: Make ChangeRenderTechnique return a reference to the render technique
Former-commit-id: f97e9d4a3048c0dfd934b263fd2e3facdec1f839 [formerly 856e89966d172f0cc55a6b7d6dbe0f33f0dad493] [formerly 2c537c041b5c32831d034e5de8a9b738597c5ee8 [formerly 6c47f159c502de0b37d8c0847dd6b6ece1df321b]]
Former-commit-id: 820d117c97286893c9ec7b4b611546e09a7bfd24 [formerly 44daa92d72f776fa879a957e814496882190d302]
Former-commit-id: ca11c6fe9726d380a77650dd4dff26049ac07386
2016-08-10 14:09:48 +02:00

76 lines
2.4 KiB
C++

// Copyright (C) 2015 Jérôme Leclercq
// This file is part of the "Nazara Development Kit"
// For conditions of distribution and use, see copyright notice in Prerequesites.hpp
#pragma once
#ifndef NDK_SERVER
#ifndef NDK_SYSTEMS_RENDERSYSTEM_HPP
#define NDK_SYSTEMS_RENDERSYSTEM_HPP
#include <Nazara/Graphics/AbstractBackground.hpp>
#include <Nazara/Graphics/DepthRenderTechnique.hpp>
#include <Nazara/Graphics/ForwardRenderTechnique.hpp>
#include <Nazara/Renderer/RenderTexture.hpp>
#include <NDK/EntityList.hpp>
#include <NDK/System.hpp>
#include <unordered_map>
#include <vector>
namespace Ndk
{
class GraphicsComponent;
class NDK_API RenderSystem : public System<RenderSystem>
{
public:
RenderSystem();
inline RenderSystem(const RenderSystem& renderSystem);
~RenderSystem() = default;
template<typename T> T& ChangeRenderTechnique();
inline Nz::AbstractRenderTechnique& ChangeRenderTechnique(std::unique_ptr<Nz::AbstractRenderTechnique>&& renderTechnique);
inline const Nz::BackgroundRef& GetDefaultBackground() const;
inline const Nz::Matrix4f& GetCoordinateSystemMatrix() const;
inline Nz::Vector3f GetGlobalForward() const;
inline Nz::Vector3f GetGlobalRight() const;
inline Nz::Vector3f GetGlobalUp() const;
inline Nz::AbstractRenderTechnique& GetRenderTechnique() const;
inline void SetDefaultBackground(Nz::BackgroundRef background);
inline void SetGlobalForward(const Nz::Vector3f& direction);
inline void SetGlobalRight(const Nz::Vector3f& direction);
inline void SetGlobalUp(const Nz::Vector3f& direction);
static SystemIndex systemIndex;
private:
inline void InvalidateCoordinateSystem();
void OnEntityRemoved(Entity* entity) override;
void OnEntityValidation(Entity* entity, bool justAdded) override;
void OnUpdate(float elapsedTime) override;
void UpdateDirectionalShadowMaps(const Nz::AbstractViewer& viewer);
void UpdatePointSpotShadowMaps();
std::unique_ptr<Nz::AbstractRenderTechnique> m_renderTechnique;
EntityList m_cameras;
EntityList m_drawables;
EntityList m_directionalLights;
EntityList m_lights;
EntityList m_pointSpotLights;
EntityList m_particleGroups;
Nz::BackgroundRef m_background;
Nz::DepthRenderTechnique m_shadowTechnique;
Nz::Matrix4f m_coordinateSystemMatrix;
Nz::RenderTexture m_shadowRT;
bool m_coordinateSystemInvalidated;
};
}
#include <NDK/Systems/RenderSystem.inl>
#endif // NDK_SYSTEMS_RENDERSYSTEM_HPP
#endif // NDK_SERVER