unfortunately Beyley's program also broken on my device
unfortunately Beyley's program also broken on my device

IsContextControlDisabled is important as well, the window system will keep trying to move your context back otherwiseGameLoop class that can be configured to automatically multithread, but sadly just a pipe dream now

ClearContext in Load




NewThread({
while:
DoRender();
})
MainThread{
while:
DoUpdate();
DoEvents();
}IsContextControlDisabledGameLoopClearContextLoadbool isRunning = true;
IGLContext context;
void RenderLoop()
{
context.MakeCurrent();
context.SwapInterval(1); // for vsync
var sw = new Stopwatch();
while (isRunning)
{
var delta = sw.Elapsed.TotalSeconds;
sw.Reset();
// do rendering code
context.SwapBuffers();
}
}
void MainLoop()
{
var window = Window.Create(WindowOptions.Default with { IsContextControlDisabled = true });
window.Closing += () => isRunning = false;
window.Load += () =>
{
context = window.GLContext;
new Thread(RenderLoop).Start();
}
window.Run();
} window.Load += () =>
{
context = window.GLContext;
+ context.Clear();
new Thread(RenderLoop).Start();
}