WIP
This commit is contained in:
35
include/Nazara/Graphics/InstancedRenderable.hpp
Normal file
35
include/Nazara/Graphics/InstancedRenderable.hpp
Normal file
@@ -0,0 +1,35 @@
|
||||
// Copyright (C) 2017 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_INSTANCEDRENDERABLE_HPP
|
||||
#define NAZARA_INSTANCEDRENDERABLE_HPP
|
||||
|
||||
#include <Nazara/Prerequisites.hpp>
|
||||
#include <Nazara/Graphics/Config.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class CommandBufferBuilder;
|
||||
class ModelInstance;
|
||||
|
||||
class NAZARA_GRAPHICS_API InstancedRenderable
|
||||
{
|
||||
public:
|
||||
InstancedRenderable() = default;
|
||||
InstancedRenderable(const InstancedRenderable&) = delete;
|
||||
InstancedRenderable(InstancedRenderable&&) noexcept = default;
|
||||
~InstancedRenderable();
|
||||
|
||||
virtual void Draw(CommandBufferBuilder& commandBuffer, ModelInstance& instance) const = 0;
|
||||
|
||||
InstancedRenderable& operator=(const InstancedRenderable&) = delete;
|
||||
InstancedRenderable& operator=(InstancedRenderable&&) noexcept = default;
|
||||
};
|
||||
}
|
||||
|
||||
#include <Nazara/Graphics/InstancedRenderable.inl>
|
||||
|
||||
#endif
|
||||
12
include/Nazara/Graphics/InstancedRenderable.inl
Normal file
12
include/Nazara/Graphics/InstancedRenderable.inl
Normal file
@@ -0,0 +1,12 @@
|
||||
// Copyright (C) 2017 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
|
||||
|
||||
#include <Nazara/Graphics/InstancedRenderable.hpp>
|
||||
#include <Nazara/Graphics/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
}
|
||||
|
||||
#include <Nazara/Graphics/DebugOff.hpp>
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <Nazara/Prerequisites.hpp>
|
||||
#include <Nazara/Graphics/Config.hpp>
|
||||
#include <Nazara/Graphics/InstancedRenderable.hpp>
|
||||
#include <Nazara/Renderer/RenderPipeline.hpp>
|
||||
#include <Nazara/Utility/Mesh.hpp>
|
||||
#include <Nazara/Utility/VertexDeclaration.hpp>
|
||||
@@ -19,7 +20,7 @@ namespace Nz
|
||||
class GraphicalMesh;
|
||||
class Material;
|
||||
|
||||
class NAZARA_GRAPHICS_API Model
|
||||
class NAZARA_GRAPHICS_API Model : public InstancedRenderable
|
||||
{
|
||||
public:
|
||||
Model(std::shared_ptr<GraphicalMesh> graphicalMesh);
|
||||
@@ -27,6 +28,8 @@ namespace Nz
|
||||
Model(Model&&) noexcept = default;
|
||||
~Model() = default;
|
||||
|
||||
void Draw(CommandBufferBuilder& commandBuffer, ModelInstance& instance) const override;
|
||||
|
||||
const std::shared_ptr<AbstractBuffer>& GetIndexBuffer(std::size_t subMeshIndex) const;
|
||||
std::size_t GetIndexCount(std::size_t subMeshIndex) const;
|
||||
const std::shared_ptr<RenderPipeline>& GetRenderPipeline(std::size_t subMeshIndex) const;
|
||||
|
||||
Reference in New Issue
Block a user