46 lines
969 B
C++
46 lines
969 B
C++
// Copyright (c) 2023 Dominic Masters
|
|
//
|
|
// This software is released under the MIT License.
|
|
// https://opensource.org/licenses/MIT
|
|
|
|
#pragma once
|
|
#include "dawn.hpp"
|
|
#include "dawnopengl.hpp"
|
|
|
|
namespace Dawn {
|
|
enum class ShaderParameterType {
|
|
VEC2,
|
|
VEC3,
|
|
VEC4,
|
|
MAT3,
|
|
MAT4,
|
|
COLOR,
|
|
FLOAT,
|
|
INT,
|
|
TEXTURE,
|
|
BOOLEAN
|
|
};
|
|
|
|
struct ShaderParameter {
|
|
std::string name;
|
|
size_t offset;
|
|
enum ShaderParameterType type;
|
|
size_t count;
|
|
GLint location = -1;
|
|
|
|
/**
|
|
* Construct a new shader parameter.
|
|
*
|
|
* @param name Name of the parameter within the shader.
|
|
* @param offset Offset, relative to the structure of the data.
|
|
* @param type Type of the parameter.
|
|
* @param count How many elements in the array (if multiple).
|
|
*/
|
|
ShaderParameter(
|
|
const std::string &name,
|
|
const void *offset,
|
|
const enum ShaderParameterType type,
|
|
const size_t count = 1
|
|
);
|
|
};
|
|
} |