GlWindow.activate

GlScope activate() nothrow @nogc

Returns a scoped context activator.

The returned struct makes this window's GL context current and can be used with scope(exit) or RAII patterns.

Example:

{
   auto ctx = window.activate();
   // GL calls here are safe
   glClear(GL_COLOR_BUFFER_BIT);
} // context scope ends

Returns

GlScope struct that manages context activation