Package-level declarations

Types

Link copied to clipboard
expect abstract class Application

Application interface

actual abstract class Application

Application interface

actual abstract class Application

This class is responsible for selecting and initializing the appropriate graphics backend.

Link copied to clipboard
expect abstract class ApplicationBase

This is accessible before finalizing the application in ApplicationBuilder.

actual abstract class ApplicationBase

This is accessible before finalizing the application in ApplicationBuilder.

actual abstract class ApplicationBase

This is accessible before finalizing the application in ApplicationBuilder.

Link copied to clipboard
abstract class ApplicationBuilder

Abstract class for constructing and configuring an application. The ApplicationBuilder serves as the entry point for setting up the application's program, configuration, and other components.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Application configuration object

Link copied to clipboard
class ApplicationMouse(application: () -> Application) : MouseEvents

Mouse events

Link copied to clipboard

ApplicationPreload can be used to configure Application and Program without changing user code.

Link copied to clipboard
abstract class ApplicationWindow(val program: Program)
Link copied to clipboard
class ApplicationWindowMouse(applicationWindow: () -> ApplicationWindow) : MouseEvents
Link copied to clipboard
data class AssetMetadata(val programName: String, val assetBaseName: String, val assetProperties: Map<String, String>)
Link copied to clipboard
data class CharacterEvent(val character: Char, val modifiers: Set<KeyModifier>)

Represents an event triggered by a character input, typically used in text input scenarios.

Link copied to clipboard
interface Clipboard

Interface representing a clipboard for accessing and modifying its contents.

Link copied to clipboard
interface Clock
Link copied to clipboard

Configuration class to customize the behavior, appearance, and settings of a window in an application.

Link copied to clipboard

Represents the type of cursor used within an application.

Link copied to clipboard
expect class Dispatcher
actual class Dispatcher
actual class Dispatcher : MainCoroutineDispatcher, Delay
Link copied to clipboard
abstract class Display

Any coordinates or positions are provided as screen coordinates, which may or may not be equivalent to pixel coordinates, depending on your setup.

Link copied to clipboard
data class DropEvent(val position: Vector2, val files: List<String>)

window drop item event message

Link copied to clipboard
interface Extension

Represents an interface for creating extensions to enhance the functionality of a host program. Extensions allow developers to hook into the lifecycle of the program, enabling custom behavior during setup, drawing, and shutdown phases.

Link copied to clipboard
annotation class ExtensionDslMarker
Link copied to clipboard

Represents a host for managing and executing extensions within a program. This interface provides methods for adding, configuring, and executing extensions at different stages of the program's lifecycle.

Link copied to clipboard

Represents the various stages of an extension's lifecycle in the application.

Link copied to clipboard

Fullscreen mode

Link copied to clipboard
interface InputEvents

Interface representing input events in an application. Combines events related to mouse, keyboard, and pointers.

Link copied to clipboard

The Keyboard class provides event-based interaction for keyboard inputs. It implements the KeyEvents interface to handle various types of keyboard-related events such as key presses, releases, repetitions, and character inputs. These events are typically triggered by the Application interacting with the underlying system.

Link copied to clipboard
data class KeyEvent(val type: KeyEventType, val key: Int, val name: String, val modifiers: Set<KeyModifier>)

Key event describes key events.

Link copied to clipboard
interface KeyEvents

Interface for handling keyboard events. This interface provides access to events related to keyboard interactions such as key presses, releases, repetitions, and character inputs.

Link copied to clipboard

Represents the type of a key event in an application.

Link copied to clipboard

Represents key modifiers that can be used in combination with keyboard or mouse input.

Link copied to clipboard
class KeyTracker(keyEvents: KeyEvents)

Tracks the keys currently pressed on the keyboard.

Link copied to clipboard

Represents mouse buttons commonly used in interaction with graphical user interfaces.

Link copied to clipboard
data class MouseEvent(    val position: Vector2,     val rotation: Vector2,     val dragDisplacement: Vector2,     val type: MouseEventType,     val button: MouseButton,     val modifiers: Set<KeyModifier>)

Represents a mouse event in a 2D GUI or application.

Link copied to clipboard
interface MouseEvents
Link copied to clipboard

Represents the types of mouse events that can occur in the system.

Link copied to clipboard
class MouseTracker(mouseEvents: MouseEvents)

Keeps track of which mouse buttons are currently pressed. Usage: val mt = MouseTracker(mouse), then read mt.pressedButtons. Replaces MouseEvents.pressedButtons.

Link copied to clipboard
data class Pointer(val position: Vector2, val primary: Boolean, val timestamp: Long)
Link copied to clipboard
class Pointers(application: () -> Application)
Link copied to clipboard

PresentationMode describes modes of frame presentation

Link copied to clipboard
data class ProduceAssetsEvent(val origin: Any, val program: Program, val assetMetadata: AssetMetadata)
Link copied to clipboard

Represents a program interface that combines input event handling, extension hosting, and clock functionalities. It provides common properties and methods for managing the lifecycle of a program, drawing operations, and asset management.

Link copied to clipboard

Represents an event occurring within a program.

Link copied to clipboard

program event type

Link copied to clipboard
open class ProgramImplementation(val suspend: Boolean = false) : Program

The Program class, this is where most user implementations start.

Link copied to clipboard
data class RequestAssetsEvent(val origin: Any, val program: Program)
Link copied to clipboard

Specifies the behavior applied when an application window loses focus.

Link copied to clipboard
interface Window

Represents a window with configurable properties and behavior.

Link copied to clipboard
data class WindowConfiguration(    val title: String = "OPENRNDR",     val position: IntVector2? = null,     val width: Int = 640,     val height: Int = 480,     val resizable: Boolean = false,     val closable: Boolean = true,     val alwaysOnTop: Boolean = false,     val hideDecorations: Boolean = false,     val multisample: WindowMultisample = WindowMultisample.Disabled)
Link copied to clipboard
data class WindowEvent(val type: WindowEventType, val position: Vector2, val size: Vector2, val focused: Boolean)

window event message

Link copied to clipboard

Represents the types of events that can occur on a window.

Link copied to clipboard
sealed class WindowMultisample
Link copied to clipboard
open class WindowProgram(val suspend: Boolean = false) : Program

Properties

Link copied to clipboard
Link copied to clipboard
const val KEY_ARROW_DOWN: Int = 264
Link copied to clipboard
const val KEY_ARROW_LEFT: Int = 263
Link copied to clipboard
const val KEY_ARROW_RIGHT: Int = 262
Link copied to clipboard
const val KEY_ARROW_UP: Int = 265
Link copied to clipboard
const val KEY_BACKSPACE: Int = 259
Link copied to clipboard
const val KEY_CAPSLOCK: Int = 280
Link copied to clipboard
const val KEY_DELETE: Int = 261
Link copied to clipboard
const val KEY_END: Int = 269
Link copied to clipboard
const val KEY_ENTER: Int = 257
Link copied to clipboard
const val KEY_ESCAPE: Int = 256
Link copied to clipboard
const val KEY_F1: Int = 290
Link copied to clipboard
const val KEY_F10: Int = 299
Link copied to clipboard
const val KEY_F11: Int = 300
Link copied to clipboard
const val KEY_F12: Int = 301
Link copied to clipboard
const val KEY_F2: Int = 291
Link copied to clipboard
const val KEY_F3: Int = 292
Link copied to clipboard
const val KEY_F4: Int = 293
Link copied to clipboard
const val KEY_F5: Int = 294
Link copied to clipboard
const val KEY_F6: Int = 295
Link copied to clipboard
const val KEY_F7: Int = 296
Link copied to clipboard
const val KEY_F8: Int = 297
Link copied to clipboard
const val KEY_F9: Int = 298
Link copied to clipboard
const val KEY_HOME: Int = 268
Link copied to clipboard
const val KEY_INSERT: Int = 260
Link copied to clipboard
const val KEY_LEFT_SHIFT: Int = 340
Link copied to clipboard
const val KEY_PAGE_DOWN: Int = 267
Link copied to clipboard
const val KEY_PAGE_UP: Int = 266
Link copied to clipboard
const val KEY_PRINT_SCREEN: Int = 283
Link copied to clipboard
const val KEY_RIGHT_SHIFT: Int = 344
Link copied to clipboard
const val KEY_SPACEBAR: Int = 32
Link copied to clipboard
const val KEY_TAB: Int = 258

Functions

Link copied to clipboard
expect fun application(build: ApplicationBuilder.() -> Unit)

Constructs and configures an application using the provided builder block.

expect fun application(program: Program, configuration: Configuration = Configuration())

Configures and initializes an application using the specified program and optional configuration settings.

actual fun application(build: ApplicationBuilder.() -> Unit)

Creates and runs a synchronous OPENRNDR application using the provided ApplicationBuilder.

actual fun application(program: Program, configuration: Configuration)

Runs program as a synchronous application with the given configuration.

actual fun application(build: ApplicationBuilder.() -> Unit)
actual fun application(program: Program, configuration: Configuration)

Runs program as a synchronous application with the given configuration.

Link copied to clipboard

Convenience function for building a new Configuration.

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
fun launch(block: suspend () -> Unit)
Link copied to clipboard
fun Dispatcher.launch(start: CoroutineStart = CoroutineStart.DEFAULT, block: suspend CoroutineScope.() -> Unit): Job

fun Program.launch(    context: CoroutineContext = dispatcher,     start: CoroutineStart = CoroutineStart.DEFAULT,     block: suspend CoroutineScope.() -> Unit): Job

launch a coroutine in the Program context

Link copied to clipboard
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
actual fun Program.namedTimestamp(extension: String, path: String?): String
Link copied to clipboard
expect fun resourceText(name: String, class: KClass<*> = Application::class): String
actual fun resourceText(name: String, class: KClass<*>): String
actual fun resourceText(name: String, class: KClass<*>): String
Link copied to clipboard
expect fun resourceUrl(name: String, class: KClass<*> = Application::class): String

Resolves resource named name relative to class as a String based URL.

actual fun resourceUrl(name: String, class: KClass<*>): String
actual fun resourceUrl(name: String, class: KClass<*>): String
Link copied to clipboard
expect fun rootClassName(): String
actual fun rootClassName(): String
actual fun rootClassName(): String
Link copied to clipboard
suspend fun throttle(timeMillis: Long)
Link copied to clipboard
fun Program.window(configuration: WindowConfiguration = WindowConfiguration(), init: suspend Program.() -> Unit): ApplicationWindow