Stinky hacks to make progress on Linux target

This commit is contained in:
Yoshi Askharoun
2026-07-26 00:51:08 -05:00
parent 054237c01a
commit e65399ed8c
7 changed files with 39 additions and 6 deletions
@@ -102,10 +102,12 @@ namespace Microsoft.Iris.Render.OpenGL
m_silkWindow.DoRender();
}
private bool m_didWork = false;
public bool ProcessNativeEvents()
{
m_silkWindow.DoEvents();
return !m_silkWindow.IsClosing;
m_didWork = !m_didWork;
return m_didWork;
}
public void WaitForWork(uint nTimeoutInMsecs)
@@ -113,11 +115,11 @@ namespace Microsoft.Iris.Render.OpenGL
// Cooperative wait: return promptly if another thread requested a wake.
uint waited = 0;
const uint slice = 5;
while (waited < nTimeoutInMsecs && !m_wakeRequested)
{
Thread.Sleep((int)Math.Min(slice, nTimeoutInMsecs - waited));
waited += slice;
}
// while (waited < nTimeoutInMsecs && !m_wakeRequested)
// {
// Thread.Sleep((int)Math.Min(slice, nTimeoutInMsecs - waited));
// waited += slice;
// }
m_wakeRequested = false;
}
@@ -11,6 +11,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Silk.NET.Input.Sdl" Version="2.23.0" />
<PackageReference Include="Silk.NET.Windowing.Sdl" Version="2.23.0" />
<ProjectReference Include="..\UIX.RenderApi\UIX.RenderApi.csproj" />
<!-- Silk.NET provides the windowing/GL/input abstractions and OpenGL bindings.
@@ -30,7 +30,12 @@ namespace Microsoft.Iris.CodeModel.Cpp
public static void Startup()
{
DllLoadResultFactory.Startup();
#if WINDOWS
// TODO: Is this necessary if the render engine is implemented in C#?
DllProxyServices.Startup();
#endif
LoadIntrinsicTypeData();
}
+9
View File
@@ -35,7 +35,14 @@ namespace Microsoft.Iris.Debug
if (s_isInitialized)
return;
s_isInitialized = true;
#if WINDOWS
NativeApi.SpInitializeTracing();
#endif
#if DEBUG
EnableAllCategories(true);
#endif
TraceSettings.Current.Refresh();
TraceSettings.Current.ListenForRegistryUpdates();
}
@@ -45,7 +52,9 @@ namespace Microsoft.Iris.Debug
if (!s_isInitialized)
return;
TraceSettings.Current.StopListeningForRegistryUpdates();
#if WINDOWS
NativeApi.SpUninitializeTracing();
#endif
s_isInitialized = false;
}
@@ -46,7 +46,10 @@ namespace Microsoft.Iris.Debug
public void Refresh()
{
s_debugTraceFile = Environment.GetEnvironmentVariable("SPLASH_TRACE_FILE");
#if WINDOWS
NativeApi.SpUpdateTraceSettings(s_debugTraceFile, string.Empty, true, false, false);
#endif
// TODO: Persist trace settings for non-Windows targets
}
public byte GetCategoryLevel(TraceCategory cat)
+6
View File
@@ -19,14 +19,20 @@ namespace Microsoft.Iris.OS
{
ResourceManager.Instance.RegisterSource("http", s_instance);
ResourceManager.Instance.RegisterSource("https", s_instance);
#if WINDOWS
NativeApi.SpHttpStartup();
#endif
}
public static void Shutdown()
{
if (s_activationChangeHandler != null)
UISession.Default.Form.ActivationChange -= s_activationChangeHandler;
#if WINDOWS
NativeApi.SpHttpShutdown();
#endif
}
private static void OnActivationChanged(object sender, EventArgs args) => NativeApi.SpHttpFlushProxyCache();
+6
View File
@@ -51,10 +51,16 @@ namespace Microsoft.Iris.UI
_preventInterruption = false;
UpdateStyles();
SetWindowOptions(WindowOptions.FreeformResize, true);
#if WINDOWS
// Sets up callbacks for accessibility proxy
_notificationCallback = new NativeApi.NotifyWindowCallback(OnNotifyCallback);
IntPtr handle;
RendererApi.IFC(NativeApi.SpCreateNotifyWindow(out handle, _notificationCallback));
AppNotifyWindow = handle;
#else
// TODO: How to implement accessibility for non-Windows targets?
#endif
}
private void OnInitialize()