//
// Generated by Brutal.ImGui.Generator; do not edit by hand.
#nullable enable
using System.Runtime.CompilerServices;
namespace Brutal.ImGuiApi
{
///
///
/// C++:
/// imgui.h:369
///
struct ImTextureRef
///
///
///
///
/// ImTextureRef = higher-level identifier for a texture. Store a ImTextureID _or_ a ImTextureData*.
/// The identifier is valid even before the texture has been uploaded to the GPU/graphics system.
/// This is what gets passed to functions such as `ImGui::Image()`, `ImDrawList::AddImage()`.
/// This is what gets stored in draw commands (`ImDrawCmd`) to identify a texture during rendering.
/// - When a texture is created by user code (e.g. custom images), we directly stores the low-level ImTextureID.
/// Because of this, when displaying your own texture you are likely to ever only manage ImTextureID values on your side.
/// - When a texture is created by the backend, we stores a ImTextureData* which becomes an indirection
/// to extract the ImTextureID value during rendering, after texture upload has happened.
/// - To create a ImTextureRef from a ImTextureData you can use ImTextureData::GetTexRef().
/// We intentionally do not provide an ImTextureRef constructor for this: we don't expect this
/// to be frequently useful to the end-user, and it would be erroneously called by many legacy code.
/// - If you want to bind the current atlas when using custom rectangle, you can use io.Fonts->TexRef.
/// - Binding generators for languages such as C (which don't have constructors), should provide a helper, e.g.
/// inline ImTextureRef ImTextureRefFromID(ImTextureID tex_id) { ImTextureRef tex_ref = { ._TexData = NULL, .TexID = tex_id }; return tex_ref; }
/// In 1.92 we changed most drawing functions using ImTextureID to use ImTextureRef.
/// We intentionally do not provide an implicit ImTextureRef -> ImTextureID cast operator because it is technically lossy to convert ImTextureRef to ImTextureID before rendering.
///
///
[StructLayout(LayoutKind.Explicit, Size = 16)]
public partial struct ImTextureRef
{
///
///
/// A texture, generally owned by a ImFontAtlas. Will convert to ImTextureID during render loop, after
/// texture has been uploaded.
///
///
/// C++:
/// imgui.h:380
///
ImTextureData* _TexData
///
///
///
///
/// Members (either are set, never both!)
///
///
[FieldOffset(0)]
public ImTextureDataPtr _TexData;
///
///
/// _OR_ Low-level backend texture identifier, if already uploaded or created by user/app. Generally
/// provided to e.g. ImGui::Image() calls.
///
///
/// C++:
/// imgui.h:381
///
ImTextureID _TexID
///
///
///
///
/// Members (either are set, never both!)
///
///
[FieldOffset(8)]
public ImTextureID _TexID;
}
///
///
/// C++:
/// imgui.h:369
///
struct ImTextureRef
///
///
///
///
/// ImTextureRef = higher-level identifier for a texture. Store a ImTextureID _or_ a ImTextureData*.
/// The identifier is valid even before the texture has been uploaded to the GPU/graphics system.
/// This is what gets passed to functions such as `ImGui::Image()`, `ImDrawList::AddImage()`.
/// This is what gets stored in draw commands (`ImDrawCmd`) to identify a texture during rendering.
/// - When a texture is created by user code (e.g. custom images), we directly stores the low-level ImTextureID.
/// Because of this, when displaying your own texture you are likely to ever only manage ImTextureID values on your side.
/// - When a texture is created by the backend, we stores a ImTextureData* which becomes an indirection
/// to extract the ImTextureID value during rendering, after texture upload has happened.
/// - To create a ImTextureRef from a ImTextureData you can use ImTextureData::GetTexRef().
/// We intentionally do not provide an ImTextureRef constructor for this: we don't expect this
/// to be frequently useful to the end-user, and it would be erroneously called by many legacy code.
/// - If you want to bind the current atlas when using custom rectangle, you can use io.Fonts->TexRef.
/// - Binding generators for languages such as C (which don't have constructors), should provide a helper, e.g.
/// inline ImTextureRef ImTextureRefFromID(ImTextureID tex_id) { ImTextureRef tex_ref = { ._TexData = NULL, .TexID = tex_id }; return tex_ref; }
/// In 1.92 we changed most drawing functions using ImTextureID to use ImTextureRef.
/// We intentionally do not provide an implicit ImTextureRef -> ImTextureID cast operator because it is technically lossy to convert ImTextureRef to ImTextureID before rendering.
///
///
public unsafe partial struct ImTextureRefPtr(ImTextureRef* ptr) : INullable
{
private ImTextureRef* _ptr = ptr;
public ImTextureRef* Ptr => _ptr;
public bool IsNull() => _ptr is null;
public static implicit operator ImTextureRefPtr(ImTextureRef* ptr) => new(ptr);
public static implicit operator ImTextureRef*(ImTextureRefPtr wrapper) => wrapper.Ptr;
///
///
/// A texture, generally owned by a ImFontAtlas. Will convert to ImTextureID during render loop, after
/// texture has been uploaded.
///
///
/// C++:
/// imgui.h:380
///
ImTextureData* _TexData
///
///
///
///
/// Members (either are set, never both!)
///
///
public ref ImTextureDataPtr _TexData => ref Unsafe.AsRef(&_ptr->_TexData);
///
///
/// _OR_ Low-level backend texture identifier, if already uploaded or created by user/app. Generally
/// provided to e.g. ImGui::Image() calls.
///
///
/// C++:
/// imgui.h:381
///
ImTextureID _TexID
///
///
///
///
/// Members (either are set, never both!)
///
///
public ref ImTextureID _TexID => ref Unsafe.AsRef(&_ptr->_TexID);
}
}