Add GetTextureData function to texture API in C#
This commit is contained in:
@@ -753,6 +753,17 @@ bool TextureBase::InitCSharp(void* ptr)
|
||||
return Init(initData);
|
||||
}
|
||||
|
||||
TextureData* TextureBase::GetTextureData()
|
||||
{
|
||||
auto result = New<TextureData>();
|
||||
if (GetTextureData(*result, false))
|
||||
{
|
||||
Delete(result);
|
||||
result = nullptr;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
uint64 TextureBase::GetMemoryUsage() const
|
||||
|
||||
@@ -36,6 +36,16 @@ namespace FlaxEngine
|
||||
/// </summary>
|
||||
public const int MaxArraySize = 512;
|
||||
|
||||
/// <summary>
|
||||
/// Loads the texture data from the asset.
|
||||
/// </summary>
|
||||
/// <remarks>Use with caution as this operation loads texture data from the file.</remarks>
|
||||
/// <returns>The loaded texture data or null if failed.</returns>
|
||||
public TextureData GetTextureData()
|
||||
{
|
||||
return Internal_GetTextureData(__unmanagedPtr);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The texture data initialization container.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user