SteamAPI
public final class SteamAPI: SteamBaseAPI, Sendable
An instance of the Steamworks user API
Create and retain one of these to access and use the Steamworks APIs.
Steamworks ref: steam_api.h
Topics
Lifecycle
init?(appID: AppID, fakeAppIdTxtFile: Bool)
init?(appID: AppID, fakeAppIdTxtFile: Bool)
Initialize the Steamworks API.
Calls SteamAPI_RestartAppIfNecessary()
and SteamAPI_Init()
.
If you installed a hook with installCEGHooks(initCEG:termCEG:)
then the
hook is called before SteamAPI_Init()
.
If you set fakeAppIdTxtFile
to true
then the system behaves as though you
have a steam_appid.txt
file in the correct location containing your appID:
SteamAPI_RestartAppIfNecessary()
never returnstrue
;SteamAPI_Init()
uses the passed-in App ID. …so it’s a development assist to stop you having to manage the text file.
The Steamworks API is shut down when this object goes out of scope.
Declaration
Return Value
nil
if the Steam API connection failed or app restart is necessary.
var isSteamRunning: Bool
var isSteamRunning: Bool
Interfaces
var apps: SteamApps
var apps: SteamApps
var friends: SteamFriends
var friends: SteamFriends
var gameSearch: SteamGameSearch
var gameSearch: SteamGameSearch
Access the Steamworks ISteamGameSearch
interface
Declaration
public let gameSearch: SteamGameSearch
var htmlSurface: SteamHTMLSurface
var htmlSurface: SteamHTMLSurface
Access the Steamworks ISteamHTMLSurface
interface
Declaration
public let htmlSurface: SteamHTMLSurface
var input: SteamInput
var input: SteamInput
var matchmaking: SteamMatchmaking
var matchmaking: SteamMatchmaking
Access the Steamworks ISteamMatchmaking
interface
Declaration
public let matchmaking: SteamMatchmaking
var matchmakingServers: SteamMatchmakingServers
var matchmakingServers: SteamMatchmakingServers
Access the Steamworks ISteamMatchmakingServers
interface
Declaration
public let matchmakingServers: SteamMatchmakingServers
var music: SteamMusic
var music: SteamMusic
var musicRemote: SteamMusicRemote
var musicRemote: SteamMusicRemote
Access the Steamworks ISteamMusicRemote
interface
Declaration
public let musicRemote: SteamMusicRemote
var parentalSettings: SteamParentalSettings
var parentalSettings: SteamParentalSettings
Access the Steamworks ISteamParentalSettings
interface
Declaration
public let parentalSettings: SteamParentalSettings
var parties: SteamParties
var parties: SteamParties
var remotePlay: SteamRemotePlay
var remotePlay: SteamRemotePlay
Access the Steamworks ISteamRemotePlay
interface
Declaration
public let remotePlay: SteamRemotePlay
var remoteStorage: SteamRemoteStorage
var remoteStorage: SteamRemoteStorage
Access the Steamworks ISteamRemoteStorage
interface
Declaration
public let remoteStorage: SteamRemoteStorage
var screenshots: SteamScreenshots
var screenshots: SteamScreenshots
Access the Steamworks ISteamScreenshots
interface
Declaration
public let screenshots: SteamScreenshots
var timeline: SteamTimeline
var timeline: SteamTimeline
var user: SteamUser
var user: SteamUser
var userStats: SteamUserStats
var userStats: SteamUserStats
Access the Steamworks ISteamUserStats
interface
Declaration
public let userStats: SteamUserStats
var video: SteamVideo
var video: SteamVideo
CEG
static func installCEGHooks(initCEG: () -> Bool, termCEG: () -> Void)
static func installCEGHooks(initCEG: () -> Bool, termCEG: () -> Void)
Initialize Steam DRM hooks.
You can call the hooks manually or pass them in here to let the library call them at the right time
around SteamAPI_Init()
and SteamAPI_Term()
.
Call this before actually creating a SteamAPI
or SteamGameServerAPI
.