goplane

package module
v0.0.0-...-3257b51 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2018 License: MIT Imports: 2 Imported by: 0

README

goplane

GoDoc

Implementierung des X-Plane SDKs auf der Basis von GO

Voraussetzungen

  1. GO Version 1.5 muss installiert sein
  2. Das X-Plane SDK (min. Version 2.1.3) muss heruntergeladen und in einem Ordner entpackt sein.

Beispiel-Plugin

package main
import (
	"github.com/abieberbach/goplane/extra"
	"github.com/abieberbach/goplane/extra/logging"
)

func main() {
}

func init() {
	plugin := extra.NewPlugin("TestPlugin", "com.github.abieberbach.goplane.TestPlugin", "TestPlugin")
	plugin.SetPluginStateCallback(onPluginStateChanged)
	logging.MinLevel = logging.Info_Level
}

func onPluginStateChanged(state extra.PluginState, plugin *extra.XPlanePlugin) {
	switch state {
	case extra.PluginStart:
		onPluginStart()
	case extra.PluginEnable:
		onPluginEnable()
	}
}

func onPluginStart() {
	logging.Info("Plugin start")
}


func onPluginEnable() {
	logging.Info("Plugin enable")
}

Plugin kompilieren

Damit das Plugin kompiliert werden kann, muss dem System mitgeteilt werden, wo sich die Include-Dateien des SDKs befinden. Dazu muss die Umgebungsvariable "CGO_CFLAGS" auf den Pfad des SDKs gesetzt werden.

Linux: export CGO_CFLAGS='-I <Pfad zum SDK>/CHeaders'

Im Anschluss kann das Plugin mit dem go Tool gebaut werden:

Linux: go build -o lin.xpl -buildmode=c-shared  TestPlugin.go

Unterstütze Plattformen

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromBoolToInt

func FromBoolToInt(value bool) int

func IdGenerator

func IdGenerator() string

Types

This section is empty.

Directories

Path Synopsis
Enthält zusätzliche Funktionalitäten außerhalb des offiziellen X-Plane SDKs.
Enthält zusätzliche Funktionalitäten außerhalb des offiziellen X-Plane SDKs.

Jump to

Keyboard shortcuts

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