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 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 ¶
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 }
Types ¶
This section is empty.