natiny.surface.get_texture
natiny.surface.get_texture(surf) -> texture
Returns the surface's color attachment as a texture handle.
The handle stays valid until the surface is destroyed - or until a resize, which replaces the attachment, after which this has to be asked again.
Parameters
| Name | Type | Description |
|---|---|---|
surf |
number |
Surface handle |
Returns
| Type | Description |
|---|---|
number |
Texture handle, or 0 if the surface is not valid |
Example
local texture = natiny.surface.get_texture(surface)