76 lines
2.1 KiB
C++
76 lines
2.1 KiB
C++
// Copyright (c) 2022 Dominic Masters
|
|
//
|
|
// This software is released under the MIT License.
|
|
// https://opensource.org/licenses/MIT
|
|
|
|
#pragma once
|
|
#include "display/Texture.hpp"
|
|
|
|
namespace Dawn {
|
|
// class Material;
|
|
// enum ShaderParameterType {
|
|
// SHADER_PARAMETER_TYPE_MATRIX,
|
|
// SHADER_PARAMETER_TYPE_BOOLEAN,
|
|
// SHADER_PARAMETER_TYPE_COLOR,
|
|
// SHADER_PARAMETER_TYPE_VECTOR3,
|
|
// SHADER_PARAMETER_TYPE_TEXTURE,
|
|
// SHADER_PARAMETER_TYPE_FLOAT
|
|
// };
|
|
|
|
template<typename T>
|
|
class IShaderProgram {
|
|
public:
|
|
/**
|
|
* Attaches the supplied shader as the current shader.
|
|
*/
|
|
virtual void bind() = 0;
|
|
|
|
/**
|
|
* Set's a specific shader parameter to a matrix.
|
|
*
|
|
* @param parameter parameter on the shader to set.
|
|
* @param matrix Matrix to apply.
|
|
*/
|
|
virtual void setMatrix(T parameter, glm::mat4 matrix) = 0;
|
|
|
|
/**
|
|
* Attaches a boolean to a shader.
|
|
*
|
|
* @param parameter parameter to set.
|
|
* @param value Value to set.
|
|
*/
|
|
virtual void setBoolean(T parameter, bool_t value) = 0;
|
|
|
|
/**
|
|
* Set a color on to the shader.
|
|
*
|
|
* @param parameter parameter to set the color to.
|
|
* @param color Color to set.
|
|
*/
|
|
virtual void setColor(T parameter, struct Color color) = 0;
|
|
|
|
/**
|
|
* Set a 3D vector on to the shader.
|
|
*
|
|
* @param parameter parameter to set the vector to.
|
|
* @param vector Vector to set.
|
|
*/
|
|
virtual void setVector3(T parameter, glm::vec3 vector) = 0;
|
|
|
|
/**
|
|
* Attaches a texture to the currently bound shader.
|
|
*
|
|
* @param parameter parameter to set the texture on to.
|
|
* @param texture Texture slot to bind to the parameter.
|
|
*/
|
|
virtual void setTexture(T parameter, textureslot_t texture) = 0;
|
|
|
|
/**
|
|
* Sets a floating point value to the shader.
|
|
*
|
|
* @param parameter Paramater to set the float ont o.
|
|
* @param Float to bind.
|
|
*/
|
|
virtual void setFloat(T parameter, float_t value) = 0;
|
|
};
|
|
} |