Skip to content

Using Silk.NET windowing outside of the normal render loop #1160

Answered by Perksey
desiwko asked this question in Q&A
Discussion options

You must be logged in to vote

Rationale, I'd like to use Silk.NET for what it is - 3D API bindings - and not for it's implementation of the main loop.

You probably don't want to use Silk.NET.Windowing then.

You can use our OpenGL bindings with your own windowing system, you just need to provide a GetProcAddress method:

var gl = GL.GetApi(functionName => myWindowSystem.GetProcAddress(functionName) /* returning nint/IntPtr */);

You can also use your own game loop with Silk.NET windowing to an extent, we provide the Run method which can be used like so:

window.Initialize();
window.Run(() => {
    // your code here
});
window.Reset();

But this still has a "loop" controlled by silk, as this is required on some platforms …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@desiwko
Comment options

Answer selected by desiwko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants