shaders are working for models

This commit is contained in:
Clément Le Bihan
2021-06-08 15:52:12 +02:00
parent 8a729414f5
commit 7bff82a5c9
4 changed files with 48 additions and 8 deletions

View File

@@ -11,6 +11,7 @@
#include "Drawables/Texture.hpp"
#include "Drawables/ADrawable3D.hpp"
#include "Model/ModelAnimation.hpp"
#include "Shaders/Shaders.hpp"
#include <raylib.h>
#include <vector>
#include <optional>
@@ -77,6 +78,12 @@ namespace RAY::Drawables::Drawables3D {
//! @return Scale
const RAY::Vector3 & getScale(void);
//! @brief Set a shader on the model
void setShader(const RAY::Shader &shader);
//! @brief Set the original shader (used to disable a shader)
void resetShader();
void drawOn(RAY::Window &) override;
private:
@@ -90,6 +97,8 @@ namespace RAY::Drawables::Drawables3D {
float _rotationAngle;
//! @brief Scale of the shape
RAY::Vector3 _scale;
//! @brief The original shaderId used to disable a shader effect
::Shader _originalShader = {};
static RAY::Cache<::Model> _modelsCache;