Added API method for (re)setting texture search paths.

Was only possible on startup before, changing the paths required recreating the whole projectM instance. Now, the method will only reset the texture manager, but not the shaders and presets.
This commit is contained in:
Kai Blaschke
2022-12-30 16:07:50 +01:00
parent 22b0ccc423
commit bbfc4f7170
7 changed files with 63 additions and 22 deletions

View File

@ -176,6 +176,22 @@ void projectm_reset_gl(projectm_handle instance, int width, int height)
projectMInstance->ResetOpenGL(width, height);
}
void projectm_set_texture_search_paths(projectm_handle instance,
const char** texture_search_paths,
size_t count)
{
auto projectMInstance = handle_to_instance(instance);
std::vector<std::string> texturePaths;
for (size_t index = 0; index < count; index++)
{
texturePaths.emplace_back(texture_search_paths[index]);
}
projectMInstance->SetTexturePaths(texturePaths);
}
void projectm_reset_textures(projectm_handle instance)
{
auto projectMInstance = handle_to_instance(instance);