Files
RedScarfEngine/graphics/src/mesh_controller.h
T
Piotr Krygier 42dc4d6fcd Refactor project
Crealned up some TODOs, FIXMEs etc. Added better error handling. Looks
better, feels better.
2023-10-10 10:46:12 +02:00

72 lines
1.8 KiB
C

/**
* @file mesh_controller.h
* @author Piotr Krygier (piotr.krygier@meshsystems.com)
* @brief
* @version 0.1
* @date 2023-03-29
*
* @copyright Copyright (c) 2023
*
*/
#ifndef RSE_MESH_CONTROLLER_H
#define RSE_MESH_CONTROLLER_H
#include "vulkan_commons.h"
#include "utilities/rse_commons.h"
/**
* @brief Create a new mesh for provided vertices and indices.
*
* @param vertices vector of vertices
* @param indices indices for mesh
* @param vertices_num vertices count
* @param indices_num indices count
* @return uint16_t Mesh identifier. Can be useful for getting vertices, indices and instances
*/
uint16_t create_mesh(struct rse_vertex_t* vertices,
uint16_t* indices,
size_t vertices_num,
size_t indices_num);
/**
* @brief Create a instance for the selected mesh. Instance can have its own location, rotation and scale
*
* @param mesh_id Mesh id
* @param instance_data Transformation info
*/
rse_err_t create_mesh_instance(uint16_t mesh_id,
struct rse_instance_data_t instance_data);
/**
* @brief Get the vertex count for mesh with mesh_id ID
*
* @param mesh_id Mesh identifier
* @return size_t Number of vertices
*/
size_t get_vertices_count(uint16_t mesh_id);
/**
* @brief Get the index count for mesh with mesh_id ID
*
* @param mesh_id Mesh identifier
* @return size_t Number of indices
*/
size_t get_indices_count(uint16_t mesh_id);
/**
* @brief Get the instance count for mesh with mesh_id ID
*
* @param mesh_id Mesh identifier
* @return size_t Number of instances
*/
size_t get_instances_count(uint16_t mesh_id);
/**
* @brief Get vertex offset in vertex buffer for selected mesh
*
* @param mesh_id Mesh identifies
* @return size_t Offset
*/
size_t get_vertex_offset(uint16_t mesh_id);
#endif /* RSE_MESH_CONTROLLER_H */