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
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>)
Link copied to clipboard
interface Clipboard
Link copied to clipboard
interface Clock
Link copied to clipboard
Link copied to clipboard

Mouse cursor types

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

Defines a Program extension. This is the interface for developers of OPENRNDR extensions.

Link copied to clipboard
annotation class ExtensionDslMarker
Link copied to clipboard
Link copied to clipboard

Indicates the stage in which the extension is

Link copied to clipboard

Fullscreen mode

Link copied to clipboard
interface InputEvents
Link copied to clipboard

Keyboard events in a single class

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
Link copied to clipboard

Key event type enumeration

Link copied to clipboard

Key modifier enumeration

Link copied to clipboard
class KeyTracker(keyEvents: KeyEvents)
Link copied to clipboard

Mouse button enumeration

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>)

Mouse event message

Link copied to clipboard
interface MouseEvents
Link copied to clipboard

Mouse event type enumeration

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
Link copied to clipboard

program event message

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
Link copied to clipboard
interface Window
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
Link copied to clipboard
sealed class WindowMultisample
Link copied to clipboard
open class WindowProgram(val suspend: Boolean = false) : Program

Functions

Link copied to clipboard
expect fun application(build: ApplicationBuilder.() -> Unit)
expect fun application(program: Program, configuration: Configuration = Configuration())
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)

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.

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
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

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