** This project is still work in progress! **
A Steamworks SDK binding for Go
On Windows, copy one of these files on the working directory:
steam_api.dll
(For 32bit. Copyredistribution_bin/steam_api.dll
in the SDK)steam_api64.dll
(For 64bit. Copyredistribution_bin/win64/steam_api64.dll
in the SDK)
package steamapi
import (
"os"
"github.com/hajimehoshi/go-steamworks"
"golang.org/x/text/language"
)
const appID = 480 // Rewrite this
func init() {
if steamworks.RestartAppIfNecessary(appID) {
os.Exit(1)
}
if !steamworks.Init() {
panic("steamworks.Init failed")
}
}
func SystemLang() language.Tag {
switch steamworks.SteamApps().GetCurrentGameLanguage() {
case "english":
return language.English
case "japanese":
return language.Japanese
}
return language.Und
}
All the source code files are licensed under Apache License 2.0.
These binary files are copied from Steamworks SDK's redistribution_bin
directory. You must follow Valve Corporation Steamworks SDK Access Agreement for these files:
libsteam_api.dylib
(copied fromosx/libsteam_api.dylib
)libsteam_api.so
(copied fromlinux32/libsteam_api.so
)libsteam_api64.so
(copied fromlinux64/libsteam_api.so
)steam_api.dll
(copied fromsteam_api.dll
)steam_api64.dll
(copied fromsteam_api64.dll
)