WindowProgram

open class WindowProgram(val suspend: Boolean = false) : Program(source)

Constructors

Link copied to clipboard
constructor(suspend: Boolean = false)

Types

Link copied to clipboard
Link copied to clipboard
inner class Window : Window

Simplified window interface

Properties

Link copied to clipboard
open lateinit override var application: Application
Link copied to clipboard
Link copied to clipboard
open override var assetMetadata: () -> AssetMetadata
Link copied to clipboard
open override var assetProperties: ERROR CLASS: Unresolved name: mutableMapOf
Link copied to clipboard
open override var backgroundColor: ERROR CLASS: Symbol not found for ColorRGBa??

background color that is used to clear the background every frame

Link copied to clipboard

Represents the clipboard functionality for the application.

Link copied to clipboard
open override var clock: () -> Double

clock function. defaults to returning the application time.

Link copied to clipboard

The elapsed time since the last draw loop

Link copied to clipboard
open override val dispatcher: Dispatcher
Link copied to clipboard
open lateinit override var drawer: ERROR CLASS: Symbol not found for Drawer
Link copied to clipboard
open lateinit override var driver: ERROR CLASS: Symbol not found for Driver
Link copied to clipboard
open override var ended: ERROR CLASS: Unresolved name: Event

program ended event

Link copied to clipboard
open override val extensions: ERROR CLASS: Unresolved name: mutableListOf

list of installed extensions

Link copied to clipboard
open override var frameCount: Int
Link copied to clipboard
open override var height: Int
Link copied to clipboard
open override var isNested: Boolean

This is checked at runtime to disallow nesting extend blocks.

Link copied to clipboard
open override val keyboard: ERROR CLASS: Unresolved name: getValue
Link copied to clipboard
open override val mouse: ERROR CLASS: Unresolved name: getValue
Link copied to clipboard
open override var name: String
Link copied to clipboard
open override val pointers: ERROR CLASS: Unresolved name: getValue
Link copied to clipboard
override val produceAssets: ERROR CLASS: Unresolved name: Event

An event triggered when assets need to be produced or generated.

Link copied to clipboard
open override val program: Program
Link copied to clipboard
override val requestAssets: ERROR CLASS: Unresolved name: Event

An event triggered when there is a request for assets to be accessed or provided.

Link copied to clipboard
open override val seconds: Double

The number of seconds since program start, or the time from a custom clock. value is updated at the beginning of the frame only.

Link copied to clipboard
Link copied to clipboard
open override var userProperties: MutableMap<String, Any>

A map that can be used to store arbitrary data, including functions

Link copied to clipboard
open override var width: Int
Link copied to clipboard
open override val window: WindowProgram.Window

Functions

Link copied to clipboard
fun animate(animationFunction: ERROR CLASS: Symbol not found for Animatable.() -> Unit)
Link copied to clipboard
open override fun draw()

This is the user facing draw call. It should be overridden by the user.

Link copied to clipboard
fun Program.drawImage(width: Int, height: Int, contentScale: Double? = null, format: ColorFormat = ColorFormat.RGBa, type: ColorType = defaultColorType(format), multisample: BufferMultisample? = null, drawFunction: Drawer.() -> Unit): ColorBuffer

Create an image ColorBuffer by drawing it

Link copied to clipboard
open override fun drawImpl()

This is the draw call that is called by Application. It takes care of handling extensions.

Link copied to clipboard
open override fun <T : Extension> extend(extension: T): T

install an Extension

open override fun <T : Extension> extend(extension: T, configure: T.() -> Unit): T

install an Extension and configure it

open override fun extend(stage: ExtensionStage, userDraw: Program.() -> Unit)

install an extension function for the given ExtensionStage

Link copied to clipboard
fun Program.launch(context: ERROR CLASS: Symbol not found for CoroutineContext = dispatcher, start: ERROR CLASS: Symbol not found for CoroutineStart = CoroutineStart.DEFAULT, block: suspend ERROR CLASS: Symbol not found for CoroutineScope.() -> Unit): ERROR CLASS: Symbol not found for Job

launch a coroutine in the Program context

Link copied to clipboard
fun Program.loadFont(fileOrUrl: String, size: Double, characterSet: Set<Char> = defaultFontmapCharacterSet, contentScale: Double = this.drawer.context.contentScale, fontScaler: (ERROR CLASS: Symbol not found for Face) -> Double = ::fontHeightScaler): ERROR CLASS: Symbol not found for FontImageMap

Load a FontImageMap

Link copied to clipboard
actual fun Program.namedTimestamp(extension: String, path: String?): String
expect fun Program.namedTimestamp(extension: String = "", path: String? = null): String

Generates a timestamped name for the program, optionally including a file extension and path.

actual fun Program.namedTimestamp(extension: String, path: String?): String
Link copied to clipboard
open suspend override fun setup()

This runs exactly once before the first call to draw()

Link copied to clipboard
open override fun updateFrameSecondsFromClock()
Link copied to clipboard
fun Program.window(configuration: WindowConfiguration = WindowConfiguration(), init: suspend Program.() -> Unit): ApplicationWindow