/**
 * @file mesh_controller.h
 * @author Piotr Krygier (piotr.krygier@meshsystems.com)
 * @brief
 * @version 0.1
 * @date 2023-03-29
 *
 * @copyright Copyright (c) 2023
 *
 */

#ifndef MESH_CONTROLLER_H
#define MESH_CONTROLLER_H

#include "utilities/entity.h"
#include "vulkan_commons.h"
#include "graphics_context.h"
#include "utilities/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
 */
rse_err_t mesh_create(struct graphics_context_t* context, struct vertex_t* vertices,
                     uint16_t* indices,
                     size_t vertices_count,
                     size_t indices_count, rse_id_t* mesh_id);

/**
 * @brief Create a instance for the selected mesh. Instance can have its own location, rotation and scale
 *
 * @param context Graphics context
 * @param entity Entity we wat to update
 * @param instance_data New instance information
 */
rse_err_t mesh_create_instance(struct graphics_context_t* context, entity_t entity,
                          struct 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(struct graphics_context_t* context, rse_id_t mesh_id);

/**
 * @brief Get the index count for mesh with mesh_id ID
 *
 w @param mesh_id Mesh identifier
 * @return size_t Number of indices
 */
// size_t get_indices_count(struct graphics_context_t* context, rse_id_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(struct graphics_context_t* context, rse_id_t mesh_id);

#endif /* MESH_CONTROLLER_H */
