mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
Content browser
This commit is contained in:
@@ -19,7 +19,19 @@ namespace ImGui
|
||||
|
||||
ImGui.Image(view, size, uv0, uv1, tint_col, border_col);
|
||||
|
||||
textureViewBinding.ReleaseRef();
|
||||
textureViewBinding.Release();
|
||||
}
|
||||
|
||||
public static override bool ImageButton(TextureViewBinding textureViewBinding, Vec2 size, Vec2 uv0 = Vec2.Zero, Vec2 uv1 = Vec2.Ones, int32 frame_padding = -1, Vec4 bg_col = Vec4.Zero, Vec4 tint_col = Vec4.Ones)
|
||||
{
|
||||
var view = textureViewBinding._nativeShaderResourceView..AddRef();
|
||||
_resourceViews.Add(view);
|
||||
|
||||
bool pressed = ImGui.ImageButton(view, size, uv0, uv1, frame_padding, bg_col, tint_col);
|
||||
|
||||
textureViewBinding.Release();
|
||||
|
||||
return pressed;
|
||||
}
|
||||
|
||||
protected internal static override void CleanupFrame()
|
||||
|
||||
@@ -146,7 +146,7 @@ namespace GlitchyEngine.Renderer
|
||||
}
|
||||
|
||||
// TODO: Update Texture Arrays!
|
||||
protected override System.Result<void> PlatformSetData(void* data, uint32 elementSize, uint32 destX,
|
||||
protected override Result<void> PlatformSetData(void* data, uint32 elementSize, uint32 destX,
|
||||
uint32 destY, uint32 destWidth, uint32 destHeight, uint32 arraySlice, uint32 mipLevel, GlitchyEngine.Renderer.MapType mapType)
|
||||
{
|
||||
Debug.Profiler.ProfileResourceFunction!();
|
||||
@@ -259,7 +259,7 @@ namespace GlitchyEngine.Renderer
|
||||
|
||||
protected override TextureViewBinding PlatformGetViewBinding()
|
||||
{
|
||||
return .(_nativeResourceView, _samplerState.nativeSamplerState);
|
||||
return .(_nativeResourceView, _samplerState?.nativeSamplerState);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace GlitchyEngine.Renderer
|
||||
_nativeSamplerState?.AddRef();
|
||||
}
|
||||
|
||||
public override void ReleaseRef()
|
||||
public override void Release()
|
||||
{
|
||||
_nativeShaderResourceView?.Release();
|
||||
_nativeSamplerState?.Release();
|
||||
|
||||
Reference in New Issue
Block a user