Types
PPixelArray = ref TPixelArray
TPixelArray = array[0 .. 524288, uint32]
TScreen = tuple[surface: PSurface, width, height, flags, scale: int]
Procs
proc screen(): PSurface {.inline.}
- Get screen surface.
proc screenScale(): int {.inline.}
- Get screen scale rate.
proc newSurface(width, height: int; alpha: bool = false): PSurface
-
Create new surface with given width and height.
alpha = true to use alpha channel.
proc initScreenBuffer(w, h, scale: int)
proc freeScreenBuffer()
proc loadImage(filename: cstring): PSurface
- Load image from file to the new surface.
proc blitSurfaceAlpha(src: PSurface; srcrect: PRect; dst: PSurface; dstrect: PRect): int
- Blit surface preserving alpha channel.
Templates
template newSurface(width, height: uint16; alpha: bool = false): PSurface