mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Updated ImGui
This commit is contained in:
@@ -120,7 +120,7 @@ class MaterialAssetPropertiesEditor : AssetPropertiesEditor
|
|||||||
|
|
||||||
value = (float3)ColorRGB.LinearToSRGB((ColorRGB)value);
|
value = (float3)ColorRGB.LinearToSRGB((ColorRGB)value);
|
||||||
|
|
||||||
if (ImGui.ColorEdit3(displayName.Ptr, *(float[3]*)&value))
|
if (ImGui.ColorEdit3(displayName.Ptr, ref *(float[3]*)&value))
|
||||||
{
|
{
|
||||||
value = (float3)ColorRGB.SRgbToLinear((ColorRGB)value);
|
value = (float3)ColorRGB.SRgbToLinear((ColorRGB)value);
|
||||||
material.SetVariable(variable.Name, value);
|
material.SetVariable(variable.Name, value);
|
||||||
@@ -132,7 +132,7 @@ class MaterialAssetPropertiesEditor : AssetPropertiesEditor
|
|||||||
|
|
||||||
value = (float4)ColorRGBA.LinearToSRGB((ColorRGBA)value);
|
value = (float4)ColorRGBA.LinearToSRGB((ColorRGBA)value);
|
||||||
|
|
||||||
if (ImGui.ColorEdit4(displayName.Ptr, *(float[4]*)&value))
|
if (ImGui.ColorEdit4(displayName.Ptr, ref *(float[4]*)&value))
|
||||||
{
|
{
|
||||||
value = (float4)ColorRGBA.SRgbToLinear((ColorRGBA)value);
|
value = (float4)ColorRGBA.SRgbToLinear((ColorRGBA)value);
|
||||||
material.SetVariable(variable.Name, value);
|
material.SetVariable(variable.Name, value);
|
||||||
@@ -149,7 +149,7 @@ class MaterialAssetPropertiesEditor : AssetPropertiesEditor
|
|||||||
|
|
||||||
value = (float3)ColorRGB.LinearToSRGB((ColorRGB)value);
|
value = (float3)ColorRGB.LinearToSRGB((ColorRGB)value);
|
||||||
|
|
||||||
if (ImGui.ColorEdit3(displayName.Ptr, *(float[3]*)&value, .HDR | .Float))
|
if (ImGui.ColorEdit3(displayName.Ptr, ref *(float[3]*)&value, .HDR | .Float))
|
||||||
{
|
{
|
||||||
value = (float3)ColorRGB.SRgbToLinear((ColorRGB)value);
|
value = (float3)ColorRGB.SRgbToLinear((ColorRGB)value);
|
||||||
material.SetVariable(variable.Name, value);
|
material.SetVariable(variable.Name, value);
|
||||||
@@ -161,7 +161,7 @@ class MaterialAssetPropertiesEditor : AssetPropertiesEditor
|
|||||||
|
|
||||||
value = (float4)ColorRGBA.LinearToSRGB((ColorRGBA)value);
|
value = (float4)ColorRGBA.LinearToSRGB((ColorRGBA)value);
|
||||||
|
|
||||||
if (ImGui.ColorEdit4(displayName.Ptr, *(float[4]*)&value, .HDR | .Float))
|
if (ImGui.ColorEdit4(displayName.Ptr, ref *(float[4]*)&value, .HDR | .Float))
|
||||||
{
|
{
|
||||||
value = (float4)ColorRGBA.SRgbToLinear((ColorRGBA)value);
|
value = (float4)ColorRGBA.SRgbToLinear((ColorRGBA)value);
|
||||||
material.SetVariable(variable.Name, value);
|
material.SetVariable(variable.Name, value);
|
||||||
|
|||||||
@@ -31,7 +31,58 @@ class AssetViewer : EditorWindow
|
|||||||
|
|
||||||
ImGui.PushStyleVar(.CellPadding, .(0, 0));
|
ImGui.PushStyleVar(.CellPadding, .(0, 0));
|
||||||
|
|
||||||
bool alt_pressed = ImGui.GetIO().KeyAlt;
|
ImGui.Columns(2);
|
||||||
|
|
||||||
|
if (ImGui.BeginChild("Assets"))
|
||||||
|
{
|
||||||
|
DrawAssetList();
|
||||||
|
|
||||||
|
ImGui.EndChild();
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui.NextColumn();
|
||||||
|
|
||||||
|
if (ImGui.BeginChild("Files"))
|
||||||
|
{
|
||||||
|
DrawAssetViewer();
|
||||||
|
|
||||||
|
ImGui.EndChild();
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui.Columns(1);
|
||||||
|
|
||||||
|
/*if (ImGui.BeginTable("AssetViewerTable", 2, .BordersInnerV | .Resizable | .Reorderable | .NoPadOuterX))
|
||||||
|
{
|
||||||
|
if (alt_pressed)
|
||||||
|
{
|
||||||
|
// Header anzeigen, damit sie neu angeordnet werden können
|
||||||
|
ImGui.TableSetupColumn("Assets");
|
||||||
|
ImGui.TableSetupColumn("Viewer");
|
||||||
|
ImGui.TableHeadersRow();
|
||||||
|
}
|
||||||
|
ImGui.TableNextRow();
|
||||||
|
ImGui.TableSetColumnIndex(0);
|
||||||
|
|
||||||
|
if (ImGui.BeginChild("Assets"))
|
||||||
|
{
|
||||||
|
//DrawAssetList();
|
||||||
|
|
||||||
|
ImGui.EndChild();
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui.TableNextColumn();
|
||||||
|
|
||||||
|
if (ImGui.BeginChild("Files"))
|
||||||
|
{
|
||||||
|
//DrawAssetViewer();
|
||||||
|
|
||||||
|
ImGui.EndChild();
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui.EndTable();
|
||||||
|
}*/
|
||||||
|
|
||||||
|
/*bool alt_pressed = ImGui.GetIO().KeyAlt;
|
||||||
|
|
||||||
if (ImGui.BeginTable("AssetViewerTable", 2, .BordersInnerV | .Resizable | .Reorderable | .NoPadOuterX))
|
if (ImGui.BeginTable("AssetViewerTable", 2, .BordersInnerV | .Resizable | .Reorderable | .NoPadOuterX))
|
||||||
{
|
{
|
||||||
@@ -42,13 +93,12 @@ class AssetViewer : EditorWindow
|
|||||||
ImGui.TableSetupColumn("Viewer");
|
ImGui.TableSetupColumn("Viewer");
|
||||||
ImGui.TableHeadersRow();
|
ImGui.TableHeadersRow();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.TableNextRow();
|
ImGui.TableNextRow();
|
||||||
ImGui.TableSetColumnIndex(0);
|
ImGui.TableSetColumnIndex(0);
|
||||||
|
|
||||||
if (ImGui.BeginChild("Assets"))
|
if (ImGui.BeginChild("Assets"))
|
||||||
{
|
{
|
||||||
DrawAssetList();
|
//DrawAssetList();
|
||||||
|
|
||||||
ImGui.EndChild();
|
ImGui.EndChild();
|
||||||
}
|
}
|
||||||
@@ -57,13 +107,13 @@ class AssetViewer : EditorWindow
|
|||||||
|
|
||||||
if (ImGui.BeginChild("Files"))
|
if (ImGui.BeginChild("Files"))
|
||||||
{
|
{
|
||||||
DrawAssetViewer();
|
//DrawAssetViewer();
|
||||||
|
|
||||||
ImGui.EndChild();
|
ImGui.EndChild();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.EndTable();
|
ImGui.EndTable();
|
||||||
}
|
}*/
|
||||||
|
|
||||||
ImGui.PopStyleVar(1);
|
ImGui.PopStyleVar(1);
|
||||||
|
|
||||||
@@ -211,7 +261,7 @@ class TexturererViewerer
|
|||||||
|
|
||||||
float maxDimension = max(width, height);
|
float maxDimension = max(width, height);
|
||||||
|
|
||||||
ImGui.SliderFloat2("Position", *(float[2]*)&_position, 2 * -maxDimension * _zoom, 2 * maxDimension * _zoom);
|
ImGui.SliderFloat2("Position", ref *(float[2]*)&_position, 2 * -maxDimension * _zoom, 2 * maxDimension * _zoom);
|
||||||
|
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
|
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ namespace GlitchyEditor.EditWindows
|
|||||||
|
|
||||||
SubTexture2D image = s_FolderTexture;
|
SubTexture2D image = s_FolderTexture;
|
||||||
|
|
||||||
ImGui.ImageButton(image, (.)(DirectoryItemSize - padding));
|
ImGui.ImageButton("", image, (.)(DirectoryItemSize - padding));
|
||||||
|
|
||||||
ImGui.PopStyleColor();
|
ImGui.PopStyleColor();
|
||||||
|
|
||||||
@@ -310,7 +310,7 @@ namespace GlitchyEditor.EditWindows
|
|||||||
// TODO: preview images
|
// TODO: preview images
|
||||||
SubTexture2D image = entry->IsDirectory ? s_FolderTexture : s_FileTexture;
|
SubTexture2D image = entry->IsDirectory ? s_FolderTexture : s_FileTexture;
|
||||||
|
|
||||||
ImGui.ImageButton(image, (.)(DirectoryItemSize - padding));
|
ImGui.ImageButton("FileImage", image, (.)(DirectoryItemSize - padding));
|
||||||
|
|
||||||
ImGui.PopStyleColor();
|
ImGui.PopStyleColor();
|
||||||
|
|
||||||
|
|||||||
@@ -130,13 +130,14 @@ class LogWindow : EditorWindow
|
|||||||
ImGui.Vec2 buttonSize = .(maxSpace, maxSpace);
|
ImGui.Vec2 buttonSize = .(maxSpace, maxSpace);
|
||||||
|
|
||||||
var col = ImGui.GetStyleColorVec4(.Button);
|
var col = ImGui.GetStyleColorVec4(.Button);
|
||||||
|
ImGui.PushStyleVar(.FramePadding, ImGui.Vec2(2, 2));
|
||||||
|
|
||||||
if (_visibleMessageTypes.HasFlag(.Trace))
|
if (_visibleMessageTypes.HasFlag(.Trace))
|
||||||
ImGui.PushStyleColor(.Button, *col);
|
ImGui.PushStyleColor(.Button, *col);
|
||||||
else
|
else
|
||||||
ImGui.PushStyleColor(.Button, .(0, 0, 0, 0));
|
ImGui.PushStyleColor(.Button, .(0, 0, 0, 0));
|
||||||
|
|
||||||
if (ImGui.ImageButtonEx(1, s_TraceIcon, buttonSize, .Zero, .Ones, .(2, 2)))
|
if (ImGui.ImageButtonEx(1, s_TraceIcon, buttonSize, .Zero, .Ones))
|
||||||
_visibleMessageTypes ^= .Trace;
|
_visibleMessageTypes ^= .Trace;
|
||||||
|
|
||||||
ImGui.PopStyleColor();
|
ImGui.PopStyleColor();
|
||||||
@@ -146,7 +147,7 @@ class LogWindow : EditorWindow
|
|||||||
else
|
else
|
||||||
ImGui.PushStyleColor(.Button, .(0, 0, 0, 0));
|
ImGui.PushStyleColor(.Button, .(0, 0, 0, 0));
|
||||||
|
|
||||||
if (ImGui.ImageButtonEx(2, s_InfoIcon, buttonSize, .Zero, .Ones, .(2, 2)))
|
if (ImGui.ImageButtonEx(2, s_InfoIcon, buttonSize, .Zero, .Ones))
|
||||||
_visibleMessageTypes ^= .Info;
|
_visibleMessageTypes ^= .Info;
|
||||||
|
|
||||||
ImGui.PopStyleColor();
|
ImGui.PopStyleColor();
|
||||||
@@ -156,7 +157,7 @@ class LogWindow : EditorWindow
|
|||||||
else
|
else
|
||||||
ImGui.PushStyleColor(.Button, .(0, 0, 0, 0));
|
ImGui.PushStyleColor(.Button, .(0, 0, 0, 0));
|
||||||
|
|
||||||
if (ImGui.ImageButtonEx(3, s_WarningIcon, buttonSize, .Zero, .Ones, .(2, 2)))
|
if (ImGui.ImageButtonEx(3, s_WarningIcon, buttonSize, .Zero, .Ones))
|
||||||
_visibleMessageTypes ^= .Warning;
|
_visibleMessageTypes ^= .Warning;
|
||||||
|
|
||||||
ImGui.PopStyleColor();
|
ImGui.PopStyleColor();
|
||||||
@@ -167,11 +168,13 @@ class LogWindow : EditorWindow
|
|||||||
ImGui.PushStyleColor(.Button, .(0, 0, 0, 0));
|
ImGui.PushStyleColor(.Button, .(0, 0, 0, 0));
|
||||||
|
|
||||||
|
|
||||||
if (ImGui.ImageButtonEx(4, s_ErrorIcon, buttonSize, .Zero, .Ones, .(2, 2)))
|
if (ImGui.ImageButtonEx(4, s_ErrorIcon, buttonSize, .Zero, .Ones))
|
||||||
_visibleMessageTypes ^= .Error;
|
_visibleMessageTypes ^= .Error;
|
||||||
|
|
||||||
ImGui.PopStyleColor();
|
ImGui.PopStyleColor();
|
||||||
|
|
||||||
|
ImGui.PopStyleVar();
|
||||||
|
|
||||||
ImGui.EndMenuBar();
|
ImGui.EndMenuBar();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -432,9 +432,13 @@ namespace GlitchyEditor
|
|||||||
|
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
ImGui.SetCursorPosX(centerX - totalWidth / 2);
|
ImGui.SetCursorPosX(centerX - totalWidth / 2);
|
||||||
|
|
||||||
|
ImGui.PushID(0);
|
||||||
|
|
||||||
if (ImGui.ImageButton(_editorIcons.Play, .(size, size), .Zero, .Ones, 0))
|
if (ImGui.ImageButton("", _editorIcons.Play, .(size, size), .Zero, .Ones))
|
||||||
OnScenePlay();
|
OnScenePlay();
|
||||||
|
|
||||||
|
ImGui.PopID();
|
||||||
|
|
||||||
ImGui.AttachTooltip("Play the game.");
|
ImGui.AttachTooltip("Play the game.");
|
||||||
|
|
||||||
@@ -442,7 +446,7 @@ namespace GlitchyEditor
|
|||||||
|
|
||||||
ImGui.PushID(1);
|
ImGui.PushID(1);
|
||||||
|
|
||||||
if (ImGui.ImageButton(_editorIcons.Simulate, .(size, size), .Zero, .Ones, 0))
|
if (ImGui.ImageButton("", _editorIcons.Simulate, .(size, size), .Zero, .Ones))
|
||||||
OnSceneSimulate();
|
OnSceneSimulate();
|
||||||
|
|
||||||
ImGui.PopID();
|
ImGui.PopID();
|
||||||
@@ -461,7 +465,7 @@ namespace GlitchyEditor
|
|||||||
//ImGui.SameLine(penX += size + 2 * padding);
|
//ImGui.SameLine(penX += size + 2 * padding);
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
|
|
||||||
if (ImGui.ImageButton(_editorIcons.Pause, .(size, size), .Zero, .Ones, 0))
|
if (ImGui.ImageButton("", _editorIcons.Pause, .(size, size), .Zero, .Ones))
|
||||||
_isPaused = !_isPaused;
|
_isPaused = !_isPaused;
|
||||||
|
|
||||||
ImGui.PopID();
|
ImGui.PopID();
|
||||||
@@ -485,7 +489,7 @@ namespace GlitchyEditor
|
|||||||
|
|
||||||
SubTexture2D pauseButtonIcon = _isPaused ? _editorIcons.Play : _editorIcons.Pause;
|
SubTexture2D pauseButtonIcon = _isPaused ? _editorIcons.Play : _editorIcons.Pause;
|
||||||
|
|
||||||
if (ImGui.ImageButton(pauseButtonIcon, .(size, size), .Zero, .Ones, 0))
|
if (ImGui.ImageButton("PlayPause", pauseButtonIcon, .(size, size), .Zero, .Ones))
|
||||||
{
|
{
|
||||||
if (_isPaused)
|
if (_isPaused)
|
||||||
OnSceneResume();
|
OnSceneResume();
|
||||||
@@ -503,7 +507,7 @@ namespace GlitchyEditor
|
|||||||
|
|
||||||
SubTexture2D singleStepButtonIcon = _editorIcons.SingleStep;
|
SubTexture2D singleStepButtonIcon = _editorIcons.SingleStep;
|
||||||
|
|
||||||
if (ImGui.ImageButton(singleStepButtonIcon, .(size, size), .Zero, .Ones, 0))
|
if (ImGui.ImageButton("Step", singleStepButtonIcon, .(size, size), .Zero, .Ones))
|
||||||
{
|
{
|
||||||
DoSingleStep();
|
DoSingleStep();
|
||||||
}
|
}
|
||||||
@@ -534,7 +538,7 @@ namespace GlitchyEditor
|
|||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
ImGui.PushID(1);
|
ImGui.PushID(1);
|
||||||
|
|
||||||
if (ImGui.ImageButton(_editorIcons.Stop, .(size, size), .Zero, .Ones, 0))
|
if (ImGui.ImageButton("Stop", _editorIcons.Stop, .(size, size), .Zero, .Ones))
|
||||||
OnSceneStop();
|
OnSceneStop();
|
||||||
|
|
||||||
ImGui.PopID();
|
ImGui.PopID();
|
||||||
|
|||||||
@@ -87,10 +87,10 @@ namespace GlitchyEditor
|
|||||||
|
|
||||||
ImGui.Combo("Sampler", (.)&_sampleMode, items.Ptr, (.)items.Count);
|
ImGui.Combo("Sampler", (.)&_sampleMode, items.Ptr, (.)items.Count);
|
||||||
|
|
||||||
ImGui.SliderFloat2("Color offset and scale", *(float[2]*)&_colorOffset, -1.0f, 1.0f);
|
ImGui.SliderFloat2("Color offset and scale", ref *(float[2]*)&_colorOffset, -1.0f, 1.0f);
|
||||||
ImGui.SliderFloat2("Alpha offset and scale", *(float[2]*)&_alphaOffset, -1.0f, 1.0f);
|
ImGui.SliderFloat2("Alpha offset and scale", ref *(float[2]*)&_alphaOffset, -1.0f, 1.0f);
|
||||||
|
|
||||||
ImGui.SliderFloat2("Position", *(float[2]*)&_position, 2 * -Math.Max(viewedTexture.Width, viewedTexture.Height) * _zoom, 2 * Math.Max(viewedTexture.Width, viewedTexture.Height) * _zoom);
|
ImGui.SliderFloat2("Position", ref *(float[2]*)&_position, 2 * -Math.Max(viewedTexture.Width, viewedTexture.Height) * _zoom, 2 * Math.Max(viewedTexture.Width, viewedTexture.Height) * _zoom);
|
||||||
|
|
||||||
ImGui.BeginChild("imageChild");
|
ImGui.BeginChild("imageChild");
|
||||||
|
|
||||||
|
|||||||
@@ -87,29 +87,29 @@ namespace ImGui
|
|||||||
|
|
||||||
public static extern void Image(TextureViewBinding textureViewBinding, Vec2 size, Vec2 uv0 = Vec2.Zero, Vec2 uv1 = Vec2.Ones, Vec4 tint_col = Vec4.Ones, Vec4 border_col = Vec4.Zero);
|
public static extern void Image(TextureViewBinding textureViewBinding, Vec2 size, Vec2 uv0 = Vec2.Zero, Vec2 uv1 = Vec2.Ones, Vec4 tint_col = Vec4.Ones, Vec4 border_col = Vec4.Zero);
|
||||||
|
|
||||||
public static bool ImageButton(SubTexture2D subTexture, Vec2 size, Vec2 uv0 = Vec2.Zero, Vec2 uv1 = Vec2.Ones, int32 frame_padding = -1, Vec4 bg_col = Vec4.Zero, Vec4 tint_col = Vec4.Ones)
|
public static bool ImageButton(char8* id, SubTexture2D subTexture, Vec2 size, Vec2 uv0 = Vec2.Zero, Vec2 uv1 = Vec2.Ones, Vec4 bg_col = Vec4.Zero, Vec4 tint_col = Vec4.Ones)
|
||||||
{
|
{
|
||||||
if (uv0 != .Zero || uv1 != .Ones)
|
if (uv0 != .Zero || uv1 != .Ones)
|
||||||
Runtime.NotImplemented();
|
Runtime.NotImplemented();
|
||||||
|
|
||||||
float2 v = (.)subTexture.TexCoords.XY + subTexture.TexCoords.ZW;
|
float2 v = (.)subTexture.TexCoords.XY + subTexture.TexCoords.ZW;
|
||||||
|
|
||||||
return ImageButton(subTexture.Texture.GetViewBinding(), size, (.)subTexture.TexCoords.XY, (.)v, frame_padding, bg_col, tint_col);
|
return ImageButton(id, subTexture.Texture.GetViewBinding(), size, (.)subTexture.TexCoords.XY, (.)v, bg_col, tint_col);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static extern 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);
|
public static extern bool ImageButton(char8* id, TextureViewBinding textureViewBinding, Vec2 size, Vec2 uv0 = Vec2.Zero, Vec2 uv1 = Vec2.Ones, Vec4 bg_col = Vec4.Zero, Vec4 tint_col = Vec4.Ones);
|
||||||
|
|
||||||
public static bool ImageButtonEx(uint32 id, SubTexture2D subTexture, Vec2 size, Vec2 uv0 = Vec2.Zero, Vec2 uv1 = Vec2.Ones, Vec2 frame_padding = .Zero, Vec4 bg_col = Vec4.Zero, Vec4 tint_col = Vec4.Ones)
|
public static bool ImageButtonEx(uint32 id, SubTexture2D subTexture, Vec2 size, Vec2 uv0 = Vec2.Zero, Vec2 uv1 = Vec2.Ones, Vec4 bg_col = Vec4.Zero, Vec4 tint_col = Vec4.Ones)
|
||||||
{
|
{
|
||||||
if (uv0 != .Zero || uv1 != .Ones)
|
if (uv0 != .Zero || uv1 != .Ones)
|
||||||
Runtime.NotImplemented();
|
Runtime.NotImplemented();
|
||||||
|
|
||||||
float2 v = (.)subTexture.TexCoords.XY + subTexture.TexCoords.ZW;
|
float2 v = (.)subTexture.TexCoords.XY + subTexture.TexCoords.ZW;
|
||||||
|
|
||||||
return ImageButtonEx(id, subTexture.Texture.GetViewBinding(), size, (.)subTexture.TexCoords.XY, (.)v, frame_padding, bg_col, tint_col);
|
return ImageButtonEx(id, subTexture.Texture.GetViewBinding(), size, (.)subTexture.TexCoords.XY, (.)v, bg_col, tint_col);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static extern bool ImageButtonEx(uint32 id, TextureViewBinding textureViewBinding, Vec2 size, Vec2 uv0 = Vec2.Zero, Vec2 uv1 = Vec2.Ones, Vec2 frame_padding = .Zero, Vec4 bg_col = Vec4.Zero, Vec4 tint_col = Vec4.Ones);
|
public static extern bool ImageButtonEx(uint32 id, TextureViewBinding textureViewBinding, Vec2 size, Vec2 uv0 = Vec2.Zero, Vec2 uv1 = Vec2.Ones, Vec4 bg_col = Vec4.Zero, Vec4 tint_col = Vec4.Ones);
|
||||||
|
|
||||||
public static void TextUnformatted(StringView text) => TextUnformattedImpl(text.Ptr, text.Ptr + text.Length);
|
public static void TextUnformatted(StringView text) => TextUnformattedImpl(text.Ptr, text.Ptr + text.Length);
|
||||||
|
|
||||||
|
|||||||
@@ -22,24 +22,24 @@ namespace ImGui
|
|||||||
textureViewBinding.Release();
|
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)
|
public static override bool ImageButton(char8* id, TextureViewBinding textureViewBinding, Vec2 size, Vec2 uv0 = Vec2.Zero, Vec2 uv1 = Vec2.Ones, Vec4 bg_col = Vec4.Zero, Vec4 tint_col = Vec4.Ones)
|
||||||
{
|
{
|
||||||
var view = textureViewBinding._nativeShaderResourceView..AddRef();
|
var view = textureViewBinding._nativeShaderResourceView..AddRef();
|
||||||
_resourceViews.Add(view);
|
_resourceViews.Add(view);
|
||||||
|
|
||||||
bool pressed = ImGui.ImageButton(view, size, uv0, uv1, frame_padding, bg_col, tint_col);
|
bool pressed = ImGui.ImageButton(id, view, size, uv0, uv1, bg_col, tint_col);
|
||||||
|
|
||||||
textureViewBinding.Release();
|
textureViewBinding.Release();
|
||||||
|
|
||||||
return pressed;
|
return pressed;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static override bool ImageButtonEx(uint32 id, TextureViewBinding textureViewBinding, Vec2 size, Vec2 uv0 = Vec2.Zero, Vec2 uv1 = Vec2.Ones, Vec2 frame_padding = .Zero, Vec4 bg_col = Vec4.Zero, Vec4 tint_col = Vec4.Ones)
|
public static override bool ImageButtonEx(uint32 id, TextureViewBinding textureViewBinding, Vec2 size, Vec2 uv0 = Vec2.Zero, Vec2 uv1 = Vec2.Ones, Vec4 bg_col = Vec4.Zero, Vec4 tint_col = Vec4.Ones)
|
||||||
{
|
{
|
||||||
var view = textureViewBinding._nativeShaderResourceView..AddRef();
|
var view = textureViewBinding._nativeShaderResourceView..AddRef();
|
||||||
_resourceViews.Add(view);
|
_resourceViews.Add(view);
|
||||||
|
|
||||||
bool pressed = ImGui.ImageButtonEx(id, view, size, uv0, uv1, frame_padding, bg_col, tint_col);
|
bool pressed = ImGui.ImageButtonEx(id, view, size, uv0, uv1, bg_col, tint_col);
|
||||||
|
|
||||||
textureViewBinding.Release();
|
textureViewBinding.Release();
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
-1
Submodule GlitchyEngine/vendor/imgui updated: 827764b98c...21c9c3225a
@@ -86,10 +86,10 @@ namespace Sandbox
|
|||||||
|
|
||||||
ImGui.Combo("Sampler", (.)&_sampleMode, items.Ptr, (.)items.Count);
|
ImGui.Combo("Sampler", (.)&_sampleMode, items.Ptr, (.)items.Count);
|
||||||
|
|
||||||
ImGui.SliderFloat2("Color offset and scale", *(float[2]*)&_colorOffset, -1.0f, 1.0f);
|
ImGui.SliderFloat2("Color offset and scale", ref *(float[2]*)&_colorOffset, -1.0f, 1.0f);
|
||||||
ImGui.SliderFloat2("Alpha offset and scale", *(float[2]*)&_alphaOffset, -1.0f, 1.0f);
|
ImGui.SliderFloat2("Alpha offset and scale", ref *(float[2]*)&_alphaOffset, -1.0f, 1.0f);
|
||||||
|
|
||||||
ImGui.SliderFloat2("Position", *(float[2]*)&_position, 2 * -Math.Max(viewedTexture.Width, viewedTexture.Height) * _zoom, 2 * Math.Max(viewedTexture.Width, viewedTexture.Height) * _zoom);
|
ImGui.SliderFloat2("Position", ref *(float[2]*)&_position, 2 * -Math.Max(viewedTexture.Width, viewedTexture.Height) * _zoom, 2 * Math.Max(viewedTexture.Width, viewedTexture.Height) * _zoom);
|
||||||
|
|
||||||
ImGui.BeginChild("imageChild");
|
ImGui.BeginChild("imageChild");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user