natiny.backend.get_current

Lua
natiny.backend.get_current() -> backend, name

The backend that is actually drawing - the constant, and its name for a message. AUTO never comes back out of this: by the time init has returned, it has been resolved to a real one.

Returns

Name Type Description
backend number Active constant, or natiny.backend.AUTO before successful initialization
name string Its display name, e.g. "Direct3D 12"

Example

Lua
natiny.backend.init("auto")

local backend, name = natiny.backend.get_current()
print("drawing with " .. name)

Notes

  • Only meaningful once init has returned true.