4#include "Utilities/Strings.h"
57 COGSCORE_DLL_API
void finalize(
Context* context);
63 uint32_t value = data ? 1 : 0;
64 return addProperty(
sizeof(uint32_t),
sizeof(uint32_t),
reinterpret_cast<const uint8_t *
>(&value));
69 return addProperty(
sizeof(
float),
sizeof(
float),
reinterpret_cast<const uint8_t *
>(&data));
74 return addProperty(
sizeof(
int),
sizeof(
int),
reinterpret_cast<const uint8_t *
>(&data));
79 return addProperty(
sizeof(glm::ivec2),
sizeof(glm::ivec2),
reinterpret_cast<const uint8_t *
>(&data));
84 return addProperty(
sizeof(glm::ivec4),
sizeof(glm::ivec3),
reinterpret_cast<const uint8_t *
>(&data));
89 return addProperty(
sizeof(glm::ivec4),
sizeof(glm::ivec4),
reinterpret_cast<const uint8_t *
>(&data));
94 return addProperty(
sizeof(glm::vec2),
sizeof(glm::vec2),
reinterpret_cast<const uint8_t *
>(&data));
99 return addProperty(
sizeof(glm::vec4),
sizeof(glm::vec3),
reinterpret_cast<const uint8_t *
>(&data));
104 return addProperty(
sizeof(glm::vec4),
sizeof(glm::vec4),
reinterpret_cast<const uint8_t *
>(&data));
109 return addProperty(
sizeof(glm::vec4),
sizeof(glm::mat4),
reinterpret_cast<const uint8_t *
>(&data));
114 return addProperty(
sizeof(uint32_t),
sizeof(uint32_t),
reinterpret_cast<const uint8_t *
>(&data));
119 return addProperty(
sizeof(glm::uvec2),
sizeof(glm::uvec2),
reinterpret_cast<const uint8_t *
>(&data));
124 return addProperty(
sizeof(glm::uvec4),
sizeof(glm::uvec3),
reinterpret_cast<const uint8_t *
>(&data));
129 return addProperty(
sizeof(glm::uvec4),
sizeof(glm::uvec4),
reinterpret_cast<const uint8_t *
>(&data));
140 COGSCORE_DLL_API
void setValue(
size_t offset,
size_t propertySize,
const uint8_t * data);
144 setValue(descriptor.offset, descriptor.size, data);
159 setValue(offset,
sizeof(T),
reinterpret_cast<const uint8_t *
>(&value));
174 return *
reinterpret_cast<const T *
>(&
content[offset]);
198 inline void MaterialPropertyBuffer::setValue<bool>(
size_t offset,
const bool & boolValue)
200 uint32_t intValue = boolValue ? 1 : 0;
201 setValue(offset,
sizeof(uint32_t),
reinterpret_cast<const uint8_t *
>(&intValue));
205 inline const bool & MaterialPropertyBuffer::getValue<bool>(
size_t offset)
const
207 static bool temp =
false;
208 uint32_t intValue = getValue<uint32_t>(offset);
209 temp = intValue != 0;
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
std::string PropertyName
Typedef for property names.
Material property buffer instances are created from MaterialPropertyBuffers, and have the same set of...
Material property buffers contain properties for a material, such as color, reflectiveness or other v...
bool isPerInstance
If the buffer is updated per instance.
ConstantBufferKey index
Index of the buffer in the set of buffers owned by the same Material.
size_t size
Total size of the buffer in bytes.
COGSCORE_DLL_API void setValue(size_t offset, size_t propertySize, const uint8_t *data)
Set the property value for the property located at offset to that pointed to by data.
PropertyName name
Name used to refer to the buffer in shaders.
void setValue(size_t offset, const T &value)
Set the property value for the property located at offset to the value given.
std::vector< uint8_t > content
Default content for property buffer instances created from this buffer.
size_t generation
Generation counter.
COGSCORE_DLL_API MaterialPropertyDescriptor addProperty(size_t propertyAlignment, size_t propertySize, const uint8_t *data)
Add the value pointed to by data, with the given propertySize, to the buffer.
const T & getValue(size_t offset) const
Get the property value of type T located at offset.
Contains location/size information for a property.