-
-
Save BenLubar/089abe8fd044c1b908bf9969b7f79edc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// +build windows,amd64,cgo | |
package main | |
/* | |
#cgo LDFLAGS: -L ${SRCDIR} -lsteam_api64 | |
#include <stdbool.h> | |
#include <stdint.h> | |
bool SteamAPI_Init(); | |
void SteamAPI_Shutdown(); | |
*/ | |
import "C" | |
func SteamAPI_Init() bool { | |
return bool(C.SteamAPI_Init()) | |
} | |
func SteamAPI_Shutdown() { | |
C.SteamAPI_Shutdown() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module gist.github.com/089abe8fd044c1b908bf9969b7f79edc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
func main() { | |
if !SteamAPI_Init() { | |
panic("failed to initialize Steam API") | |
} | |
defer SteamAPI_Shutdown() | |
// game would go here | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
480 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment