// Copyright (C) 2013 Jérôme Leclercq // This file is part of the "Nazara Engine - Graphics module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once #ifndef NAZARA_FORWARDRENDERQUEUE_HPP #define NAZARA_FORWARDRENDERQUEUE_HPP #include #include #include #include #include #include #include #include class NzAbstractViewer; class NzMaterial; class NzSkeletalMesh; class NzStaticMesh; class NAZARA_API NzForwardRenderQueue : public NzAbstractRenderQueue, NzResourceListener { friend class NzForwardRenderTechnique; public: NzForwardRenderQueue() = default; ~NzForwardRenderQueue(); void AddDrawable(const NzDrawable* drawable); void AddLight(const NzLight* light); void AddModel(const NzModel* model); void AddSprite(const NzSprite* sprite); void AddSubMesh(const NzMaterial* material, const NzSubMesh* subMesh, const NzMatrix4f& transformMatrix); void Clear(bool fully); void Sort(const NzAbstractViewer* viewer); private: bool OnResourceDestroy(const NzResource* resource, int index) override; void OnResourceReleased(const NzResource* resource, int index) override; struct SkeletalData { ///TODO NzMatrix4f transformMatrix; }; struct StaticData { NzMatrix4f transformMatrix; }; struct TransparentModel { NzMatrix4f transformMatrix; NzSpheref boundingSphere; const NzMaterial* material; }; struct TransparentSkeletalModel : public TransparentModel { ///TODO }; struct TransparentStaticModel : public TransparentModel { const NzStaticMesh* mesh; }; struct BatchedModelMaterialComparator { bool operator()(const NzMaterial* mat1, const NzMaterial* mat2); }; struct BatchedSpriteMaterialComparator { bool operator()(const NzMaterial* mat1, const NzMaterial* mat2); }; struct BatchedSkeletalMeshComparator { bool operator()(const NzSkeletalMesh* subMesh1, const NzSkeletalMesh* subMesh2); }; struct BatchedStaticMeshComparator { bool operator()(const NzStaticMesh* subMesh1, const NzStaticMesh* subMesh2); }; typedef std::map, BatchedSkeletalMeshComparator> BatchedSkeletalMeshContainer; typedef std::map>, BatchedStaticMeshComparator> BatchedStaticMeshContainer; typedef std::map, BatchedModelMaterialComparator> BatchedModelContainer; typedef std::map> BatchedSpriteContainer; typedef std::vector LightContainer; typedef std::vector> TransparentModelContainer; BatchedModelContainer opaqueModels; BatchedSpriteContainer sprites; TransparentModelContainer transparentsModels; std::vector transparentSkeletalModels; std::vector transparentStaticModels; std::vector otherDrawables; LightContainer directionnalLights; LightContainer lights; }; #endif // NAZARA_FORWARDRENDERQUEUE_HPP