natiny_window_bind
void natiny_window_bind(NatinyWindow id);
Binds a window as the render target until it is unbound or replaced.
Parameters
| Name | Type | Description |
|---|---|---|
id |
NatinyWindow |
Window handle from natiny_window_create |
Example
natiny_window_bind(win);
draw_frame();
natiny_window_unbind();
Notes
- Rebinding the same window inside one
natiny_backend_loopcallback preserves its earlier draws. The accumulated image is presented after the callback. - Binding the window that is already bound, from inside that bind, does nothing, and the unbind that pairs with it does nothing either. A program that binds its window in its loop and again inside whatever the loop calls is saying "draw here" about the place it is already drawing, so the surfaces open under it stay open - and a game written that way can be handed a surface to draw on instead of the window without a line of it changing.