Skip to content
This repository has been archived by the owner on Dec 24, 2020. It is now read-only.

Commit

Permalink
Add TextureDimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
mafiesto4 committed Jan 7, 2019
1 parent b03c165 commit 0f2e794
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
16 changes: 16 additions & 0 deletions FlaxEngine/API/Objects/RenderTarget.Gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ public static RenderTarget New()
#endif
}

/// <summary>
/// Gets texture dimensions.
/// </summary>
[UnmanagedCall]
public TextureDimensions Dimensions
{
#if UNIT_TEST_COMPILANT
get; set;
#else
get { return Internal_GetDimensions(unmanagedPtr); }
#endif
}

/// <summary>
/// Gets texture surface format.
/// </summary>
Expand Down Expand Up @@ -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);

Expand Down
1 change: 1 addition & 0 deletions FlaxEngine/FlaxEngine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@
<Compile Include="Rendering\RenderView.cs" />
<Compile Include="Rendering\SceneRenderTask.cs" />
<Compile Include="Rendering\TessellationMethod.cs" />
<Compile Include="Rendering\TextureDimensions.cs" />
<Compile Include="Rendering\TextureFlags.cs" />
<Compile Include="Rendering\ViewFlags.cs" />
<Compile Include="Rendering\ViewMode.cs" />
Expand Down
25 changes: 25 additions & 0 deletions FlaxEngine/Rendering/TextureDimensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright (c) 2012-2019 Wojciech Figat. All rights reserved.

namespace FlaxEngine.Rendering
{
/// <summary>
/// Defines the dimension of a texture object.
/// </summary>
public enum TextureDimensions
{
/// <summary>
/// The texture (2d).
/// </summary>
Texture,

/// <summary>
/// The volume texture (3d texture).
/// </summary>
VolumeTexture,

/// <summary>
/// The cube texture (2d texture array of 6 items).
/// </summary>
CubeTexture,
}
}

0 comments on commit 0f2e794

Please sign in to comment.