https://github.com/hajimehoshi/go-steamworks
A Steamworks SDK binding for Go
https://github.com/hajimehoshi/go-steamworks
Last synced: 6 months ago
JSON representation
A Steamworks SDK binding for Go
- Host: GitHub
- URL: https://github.com/hajimehoshi/go-steamworks
- Owner: hajimehoshi
- License: apache-2.0
- Created: 2021-08-28T15:25:34.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-11-12T12:59:18.000Z (11 months ago)
- Last Synced: 2025-03-29T12:09:16.463Z (6 months ago)
- Language: Go
- Size: 2.19 MB
- Stars: 111
- Watchers: 5
- Forks: 18
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-steamworks
** This project is still work in progress! **
A Steamworks SDK binding for Go
## Steamworks SDK version
161
## How to use
On Windows, copy one of these files on the working directory:
* `steam_api.dll` (For 32bit. Copy `redistribution_bin\steam_api.dll` in the SDK)
* `steam_api64.dll` (For 64bit. Copy `redistribution_bin\win64\steam_api64.dll` in the SDK)```go
package steamapiimport (
"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
}
```## License
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](https://partner.steamgames.com/documentation/sdk_access_agreement) for these files:
* `libsteam_api.dylib` (copied from `redistribution_bin/osx/libsteam_api.dylib`)
* `libsteam_api.so` (copied from `redistribution_bin/linux32/libsteam_api.so`)
* `libsteam_api64.so` (copied from `redistribution_bin/linux64/libsteam_api.so`)## Resources
* [Steamworks SDK](https://partner.steamgames.com/doc/sdk)