-
Notifications
You must be signed in to change notification settings - Fork 18
/
steamworks.go
150 lines (123 loc) · 5.78 KB
/
steamworks.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2021 The go-steamworks Authors
//go:generate go run gen.go
package steamworks
type AppId_t uint32
type CSteamID uint64
type InputHandle_t uint64
type ESteamAPIInitResult int32
const (
ESteamAPIInitResult_OK ESteamAPIInitResult = 0
ESteamAPIInitResult_FailedGeneric ESteamAPIInitResult = 1
ESteamAPIInitResult_NoSteamClient ESteamAPIInitResult = 2
ESteamAPIInitResult_VersionMismatch ESteamAPIInitResult = 3
)
type ESteamInputType int32
const (
ESteamInputType_Unknown ESteamInputType = 0
ESteamInputType_SteamController ESteamInputType = 1
ESteamInputType_XBox360Controller ESteamInputType = 2
ESteamInputType_XBoxOneController ESteamInputType = 3
ESteamInputType_GenericXInput ESteamInputType = 4
ESteamInputType_PS4Controller ESteamInputType = 5
ESteamInputType_AppleMFiController ESteamInputType = 6 // Unused
ESteamInputType_AndroidController ESteamInputType = 7 // Unused
ESteamInputType_SwitchJoyConPair ESteamInputType = 8 // Unused
ESteamInputType_SwitchJoyConSingle ESteamInputType = 9 // Unused
ESteamInputType_SwitchProController ESteamInputType = 10
ESteamInputType_MobileTouch ESteamInputType = 11
ESteamInputType_PS3Controller ESteamInputType = 12
ESteamInputType_PS5Controller ESteamInputType = 13
ESteamInputType_SteamDeckController ESteamInputType = 14
ESteamInputType_Count ESteamInputType = 15
ESteamInputType_MaximumPossibleValue ESteamInputType = 255
)
const (
_STEAM_INPUT_MAX_COUNT = 16
)
type EFloatingGamepadTextInputMode int32
const (
EFloatingGamepadTextInputMode_ModeSingleLine EFloatingGamepadTextInputMode = 0
EFloatingGamepadTextInputMode_ModeMultipleLines EFloatingGamepadTextInputMode = 1
EFloatingGamepadTextInputMode_ModeEmail EFloatingGamepadTextInputMode = 2
EFloatingGamepadTextInputMode_ModeNumeric EFloatingGamepadTextInputMode = 3
)
type ISteamApps interface {
BGetDLCDataByIndex(iDLC int) (appID AppId_t, available bool, pchName string, success bool)
BIsDlcInstalled(appID AppId_t) bool
GetAppInstallDir(appID AppId_t) string
GetCurrentGameLanguage() string
GetDLCCount() int32
}
type ISteamInput interface {
GetConnectedControllers() []InputHandle_t
GetInputTypeForHandle(inputHandle InputHandle_t) ESteamInputType
Init(bExplicitlyCallRunFrame bool) bool
RunFrame()
}
type ISteamRemoteStorage interface {
FileWrite(file string, data []byte) bool
FileRead(file string, data []byte) int32
FileDelete(file string) bool
GetFileSize(file string) int32
}
type ISteamUser interface {
GetSteamID() CSteamID
}
type ISteamUserStats interface {
GetAchievement(name string) (achieved, success bool)
SetAchievement(name string) bool
ClearAchievement(name string) bool
StoreStats() bool
}
type ISteamUtils interface {
IsSteamRunningOnSteamDeck() bool
ShowFloatingGamepadTextInput(keyboardMode EFloatingGamepadTextInputMode, textFieldXPosition, textFieldYPosition, textFieldWidth, textFieldHeight int32) bool
}
type ISteamFriends interface {
GetPersonaName() string
SetRichPresence(string, string) bool
}
const (
flatAPI_RestartAppIfNecessary = "SteamAPI_RestartAppIfNecessary"
flatAPI_InitFlat = "SteamAPI_InitFlat"
flatAPI_RunCallbacks = "SteamAPI_RunCallbacks"
flatAPI_SteamApps = "SteamAPI_SteamApps_v008"
flatAPI_ISteamApps_BGetDLCDataByIndex = "SteamAPI_ISteamApps_BGetDLCDataByIndex"
flatAPI_ISteamApps_BIsDlcInstalled = "SteamAPI_ISteamApps_BIsDlcInstalled"
flatAPI_ISteamApps_GetAppInstallDir = "SteamAPI_ISteamApps_GetAppInstallDir"
flatAPI_ISteamApps_GetCurrentGameLanguage = "SteamAPI_ISteamApps_GetCurrentGameLanguage"
flatAPI_ISteamApps_GetDLCCount = "SteamAPI_ISteamApps_GetDLCCount"
flagAPI_SteamFriends = "SteamAPI_SteamFriends_v017"
flatAPI_ISteamFriends_GetPersonaName = "SteamAPI_ISteamFriends_GetPersonaName"
flatAPI_ISteamFriends_SetRichPresence = "SteamAPI_ISteamFriends_SetRichPresence"
flatAPI_SteamInput = "SteamAPI_SteamInput_v006"
flatAPI_ISteamInput_GetConnectedControllers = "SteamAPI_ISteamInput_GetConnectedControllers"
flatAPI_ISteamInput_GetInputTypeForHandle = "SteamAPI_ISteamInput_GetInputTypeForHandle"
flatAPI_ISteamInput_Init = "SteamAPI_ISteamInput_Init"
flatAPI_ISteamInput_RunFrame = "SteamAPI_ISteamInput_RunFrame"
flatAPI_SteamRemoteStorage = "SteamAPI_SteamRemoteStorage_v016"
flatAPI_ISteamRemoteStorage_FileWrite = "SteamAPI_ISteamRemoteStorage_FileWrite"
flatAPI_ISteamRemoteStorage_FileRead = "SteamAPI_ISteamRemoteStorage_FileRead"
flatAPI_ISteamRemoteStorage_FileDelete = "SteamAPI_ISteamRemoteStorage_FileDelete"
flatAPI_ISteamRemoteStorage_GetFileSize = "SteamAPI_ISteamRemoteStorage_GetFileSize"
flatAPI_SteamUser = "SteamAPI_SteamUser_v023"
flatAPI_ISteamUser_GetSteamID = "SteamAPI_ISteamUser_GetSteamID"
flatAPI_SteamUserStats = "SteamAPI_SteamUserStats_v013"
flatAPI_ISteamUserStats_GetAchievement = "SteamAPI_ISteamUserStats_GetAchievement"
flatAPI_ISteamUserStats_SetAchievement = "SteamAPI_ISteamUserStats_SetAchievement"
flatAPI_ISteamUserStats_ClearAchievement = "SteamAPI_ISteamUserStats_ClearAchievement"
flatAPI_ISteamUserStats_StoreStats = "SteamAPI_ISteamUserStats_StoreStats"
flatAPI_SteamUtils = "SteamAPI_SteamUtils_v010"
flatAPI_ISteamUtils_IsSteamRunningOnSteamDeck = "SteamAPI_ISteamUtils_IsSteamRunningOnSteamDeck"
flatAPI_ISteamUtils_ShowFloatingGamepadTextInput = "SteamAPI_ISteamUtils_ShowFloatingGamepadTextInput"
)
type steamErrMsg [1024]byte
func (s *steamErrMsg) String() string {
for i, b := range s {
if b == 0 {
return string(s[:i])
}
}
return ""
}