Skip to content

Commit

Permalink
Define API for handling uniform data
Browse files Browse the repository at this point in the history
  • Loading branch information
SirBob01 committed Oct 25, 2024
1 parent 494b192 commit 7acf7e3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Graphics/Material.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ namespace Dynamo::Graphics {
*/
DYN_DEFINE_ID_TYPE(Material);

/**
* @brief Uniform variable handle.
*
*/
DYN_DEFINE_ID_TYPE(Uniform);

/**
* @brief Topology modes.
*
Expand Down
19 changes: 19 additions & 0 deletions src/Graphics/Renderer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,25 @@ namespace Dynamo::Graphics::Vulkan {
*/
Material build_material(const MaterialDescriptor &descriptor);

/**
* @brief Get a reference to a uniform from a material.
*
* @param material
* @param name
* @return Uniform
*/
Uniform get_uniform(Material material, const std::string &name);

/**
* @brief Write to a uniform.
*
* Data must match the size of the uniform variable.
*
* @param uniform
* @param data
*/
void write_uniform(Uniform uniform, void *data);

/**
* @brief Draw a model in the current frame.
*
Expand Down

0 comments on commit 7acf7e3

Please sign in to comment.