From 0f2e79494202805cdcc166e4ed587948a3b36ae5 Mon Sep 17 00:00:00 2001 From: mafiesto4 Date: Mon, 7 Jan 2019 21:19:15 +0100 Subject: [PATCH] Add TextureDimensions --- FlaxEngine/API/Objects/RenderTarget.Gen.cs | 16 ++++++++++++++ FlaxEngine/FlaxEngine.csproj | 1 + FlaxEngine/Rendering/TextureDimensions.cs | 25 ++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 FlaxEngine/Rendering/TextureDimensions.cs diff --git a/FlaxEngine/API/Objects/RenderTarget.Gen.cs b/FlaxEngine/API/Objects/RenderTarget.Gen.cs index a5bbd14f..e273a2ee 100644 --- a/FlaxEngine/API/Objects/RenderTarget.Gen.cs +++ b/FlaxEngine/API/Objects/RenderTarget.Gen.cs @@ -36,6 +36,19 @@ public static RenderTarget New() #endif } + /// + /// Gets texture dimensions. + /// + [UnmanagedCall] + public TextureDimensions Dimensions + { +#if UNIT_TEST_COMPILANT + get; set; +#else + get { return Internal_GetDimensions(unmanagedPtr); } +#endif + } + /// /// Gets texture surface format. /// @@ -267,6 +280,9 @@ public void Dispose() #region Internal Calls #if !UNIT_TEST_COMPILANT + [MethodImpl(MethodImplOptions.InternalCall)] + internal static extern TextureDimensions Internal_GetDimensions(IntPtr obj); + [MethodImpl(MethodImplOptions.InternalCall)] internal static extern PixelFormat Internal_GetFormat(IntPtr obj); diff --git a/FlaxEngine/FlaxEngine.csproj b/FlaxEngine/FlaxEngine.csproj index 8639c1f3..027ee38a 100644 --- a/FlaxEngine/FlaxEngine.csproj +++ b/FlaxEngine/FlaxEngine.csproj @@ -445,6 +445,7 @@ + diff --git a/FlaxEngine/Rendering/TextureDimensions.cs b/FlaxEngine/Rendering/TextureDimensions.cs new file mode 100644 index 00000000..b040b0e8 --- /dev/null +++ b/FlaxEngine/Rendering/TextureDimensions.cs @@ -0,0 +1,25 @@ +// Copyright (c) 2012-2019 Wojciech Figat. All rights reserved. + +namespace FlaxEngine.Rendering +{ + /// + /// Defines the dimension of a texture object. + /// + public enum TextureDimensions + { + /// + /// The texture (2d). + /// + Texture, + + /// + /// The volume texture (3d texture). + /// + VolumeTexture, + + /// + /// The cube texture (2d texture array of 6 items). + /// + CubeTexture, + } +}