/// <summary>Registers a texture and returns a handle to the texture.</summary>
/// <param name="path">The path to the file or folder that contains the texture.</param>
/// <param name="parameters">The parameters that specify how to process the texture.</param>
/// <param name="handle">Receives the handle to the texture.</param>
/// <param name="loadTexture">Whether the texture is to be pre-loaded</param>
/// <returns>Whether loading the texture was successful.</returns>
public override bool RegisterTexture(string path, TextureParameters parameters, out Texture handle, bool loadTexture = false)
{
if (File.Exists(path) || Directory.Exists(path))
{
Texture data;
if (Program.Renderer.TextureManager.RegisterTexture(path, parameters, out data))
{
handle = data;
if (loadTexture)
{
OpenBVEGame.RunInRenderThread(() =>
{
LoadTexture(data, OpenGlTextureWrapMode.ClampClamp);
});
}
return(true);
}
}
else
{
ReportProblem(ProblemType.PathNotFound, path);
}
handle = null;
return(false);
}