startup

package
v0.0.0-...-357ca8a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2025 License: MIT Imports: 21 Imported by: 1

Documentation

Overview

Package startup provides a runtime for connecting to the graphics engine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsExtension

func AsExtension()

AsExtension requests graphics.gd to startup the library as a GDExtension suitable for inclusion in Godot engine projects. Please note that only a single Go runtime can be active within an OS process, so all Go extensions within a project should be built together into a single library.

func Engine deprecated

func Engine()

Deprecated: Use Scene instead.

func Loader deprecated

func Loader()

Deprecated: Use LoadingScene instead.

func LoadingScene

func LoadingScene()

LoadingScene starts up loading the main scene after this function is called, all graphics functions will be available to use.

A subsequent call to Scene is required to startup the scene.

Blocks indefinitely if the editor is running. As such, make sure to register all editor-accessible classes before calling this function if you want them to be available in the editor.

func MainLoop

func MainLoop(loop MainLoopClass.Interface)

MainLoop uses the given struct as the main loop implementation. This will take care of initialising the Go runtime correctly, blocks until the main loop has shutdown.

func OnRestore

func OnRestore(func(Dictionary.Any))

OnRestore registers a function to be called when the application is being restored, the dictionary dictionary will be sourced from a previous call to OnSuspend (potentially a different version) Individual classes can also implement their own Restore(Dictionary.Any) method.

func OnSuspend

func OnSuspend(func(Dictionary.Any))

OnSuspend registers a function to be called when the application is suspended, the dictionary populated by this function will be available to future OnRestore calls. Individual classes can also implement their own Suspend(Dictionary.Any) method. This function should not mutate any internal state and the application may continue to run after this has been called.

func Rendering

func Rendering() iter.Seq[Float.X]

Rendering waits for the engine to startup and returns a frame iterator for the primary viewport that is ready for rendering. The iterator will block until the engine shuts down.

	func main() {
		frames := startup.Rendering()
    	// init.
		for frame := range frames {
			// render frame
		}
		// finalize
	}

func Scene

func Scene()

Scene starts up the SceneTree and blocks until the engine shuts down.

Types

This section is empty.

Directories

Path Synopsis
internal
cmd/generate command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL