beginFrame

Begin drawing a new frame.

Calls to NanoVega drawing API should be wrapped in beginFrame and endFrame

beginFrame defines the size of the window to render to in relation currently set viewport (i.e. glViewport on GL backends). Device pixel ration allows to control the rendering on Hi-DPI devices.

For example, GLFW returns two dimension for an opened window: window size and frame buffer size. In that case you would set windowWidth/windowHeight to the window size, devicePixelRatio to: windowWidth/windowHeight.

Default ratio is 1.

Note that fractional ratio can (and will) distort your fonts and images.

This call also resets pick marks (see picking API for non-rasterized paths), path recording, and GPU affine transformatin matrix.

see also glNVGClearFlags, which returns necessary flags for glClear.

nothrow @trusted @nogc
void
beginFrame

See Also

Meta