natiny_window_create

C
NatinyWindow natiny_window_create(const char* title, uint32_t width, uint32_t height);

Creates a new application window.

Parameters

Name Type Description
title const char* Window title
width uint32_t Requested window width; its on-screen size follows OS display scaling
height uint32_t Requested window height; its on-screen size follows OS display scaling

Returns

Type Description
NatinyWindow Window handle

Example

C
NatinyWindow win = natiny_window_create("My Game", 1280, 720);

Notes

  • All three arguments are required.
  • A scaled display can give the window more pixels than the requested size. Use natiny_window_get_scale to read the scaling factor.
  • New windows use NATINY_SCALE_MODE_PIXELS, which draws pixel for pixel and does not apply the display scaling factor.
  • Desktop backends support multiple windows simultaneously.
  • Web builds support one window only; it maps to the page's <canvas> element.