tyrav2 init

This commit is contained in:
h4570
2022-07-17 10:21:35 +02:00
parent 44c1ee4fe8
commit c8b22ff331
249 changed files with 18187 additions and 0 deletions
@@ -0,0 +1,59 @@
/*
# ______ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2022, tyra - https://github.com/h4570/tyra
# Licenced under Apache License 2.0
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#pragma once
#include <tamtypes.h>
#include "../renderer_3d_pipeline.hpp"
#include "./stdpip_options.hpp"
#include "renderer/core/renderer_core.hpp"
#include "renderer/3d/mesh/mesh.hpp"
#include "./core/std_pipeline_core.hpp"
namespace Tyra {
class StdPipeline : public Renderer3DPipeline {
public:
StdPipeline();
~StdPipeline();
void init(RendererCore* core);
void onUse();
/**
* Render 3D data via "meshes".
* This render() method is a bridge to core.renderer3D.render() method.
*/
void render(Mesh* mesh, const StdpipOptions* options = nullptr);
private:
StdPipelineCore core;
RendererCore* rendererCore;
Vec4* colorsCache;
void addVertices(Mesh* mesh, MeshMaterial* material, StdpipBag* bag,
MeshFrame* frameFrom, MeshFrame* frameTo) const;
StdpipInfoBag* getInfoBag(Mesh* mesh, const StdpipOptions* options,
M4x4* model) const;
StdpipColorBag* getColorBag(Mesh* mesh, MeshMaterial* material,
MeshFrame* frameFrom, MeshFrame* frameTo) const;
StdpipTextureBag* getTextureBag(Mesh* mesh, MeshMaterial* material,
MeshFrame* frameFrom, MeshFrame* frameTo);
StdpipLightingBag* getLightingBag(Mesh* mesh, MeshMaterial* material,
M4x4* model, MeshFrame* frameFrom,
MeshFrame* frameTo,
const StdpipOptions* options) const;
void deallocDrawBags(StdpipBag* bag, MeshMaterial* material) const;
void setLightingColorsCache(StdpipLightingOptions* lightingOptions);
};
} // namespace Tyra