mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-08 01:39:36 +00:00
change steam_api headers
This commit is contained in:
+135
-391
@@ -23,17 +23,14 @@
|
||||
#include "isteammusic.h"
|
||||
#include "isteammusicremote.h"
|
||||
#include "isteamhttp.h"
|
||||
#include "isteamunifiedmessages.h"
|
||||
#include "isteamcontroller.h"
|
||||
#include "isteamugc.h"
|
||||
#include "isteamapplist.h"
|
||||
#include "isteamhtmlsurface.h"
|
||||
#include "isteaminventory.h"
|
||||
#include "isteamvideo.h"
|
||||
#include "isteamparentalsettings.h"
|
||||
|
||||
#if defined( _PS3 )
|
||||
#include "steamps3params.h"
|
||||
#endif
|
||||
|
||||
// Steam API export macro
|
||||
#if defined( _WIN32 ) && !defined( _X360 )
|
||||
@@ -65,79 +62,126 @@
|
||||
//
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
// S_API void SteamAPI_Init(); (see below)
|
||||
|
||||
// SteamAPI_Init must be called before using any other API functions. If it fails, an
|
||||
// error message will be output to the debugger (or stderr) with further information.
|
||||
S_API bool S_CALLTYPE SteamAPI_Init();
|
||||
|
||||
// SteamAPI_Shutdown should be called during process shutdown if possible.
|
||||
S_API void S_CALLTYPE SteamAPI_Shutdown();
|
||||
|
||||
// checks if a local Steam client is running
|
||||
S_API bool S_CALLTYPE SteamAPI_IsSteamRunning();
|
||||
|
||||
// Detects if your executable was launched through the Steam client, and restarts your game through
|
||||
// the client if necessary. The Steam client will be started if it is not running.
|
||||
// SteamAPI_RestartAppIfNecessary ensures that your executable was launched through Steam.
|
||||
//
|
||||
// Returns: true if your executable was NOT launched through the Steam client. This function will
|
||||
// then start your application through the client. Your current process should exit.
|
||||
// Returns true if the current process should terminate. Steam is now re-launching your application.
|
||||
//
|
||||
// false if your executable was started through the Steam client or a steam_appid.txt file
|
||||
// is present in your game's directory (for development). Your current process should continue.
|
||||
// Returns false if no action needs to be taken. This means that your executable was started through
|
||||
// the Steam client, or a steam_appid.txt file is present in your game's directory (for development).
|
||||
// Your current process should continue if false is returned.
|
||||
//
|
||||
// NOTE: This function should be used only if you are using CEG or not using Steam's DRM. Once applied
|
||||
// to your executable, Steam's DRM will handle restarting through Steam if necessary.
|
||||
// NOTE: If you use the Steam DRM wrapper on your primary executable file, this check is unnecessary
|
||||
// since the DRM wrapper will ensure that your application was launched properly through Steam.
|
||||
S_API bool S_CALLTYPE SteamAPI_RestartAppIfNecessary( uint32 unOwnAppID );
|
||||
|
||||
// Many Steam API functions allocate a small amount of thread-local memory for parameter storage.
|
||||
// SteamAPI_ReleaseCurrentThreadMemory() will free API memory associated with the calling thread.
|
||||
// This function is also called automatically by SteamAPI_RunCallbacks(), so a single-threaded
|
||||
// program never needs to explicitly call this function.
|
||||
S_API void S_CALLTYPE SteamAPI_ReleaseCurrentThreadMemory();
|
||||
|
||||
|
||||
// crash dump recording functions
|
||||
S_API void S_CALLTYPE SteamAPI_WriteMiniDump( uint32 uStructuredExceptionCode, void* pvExceptionInfo, uint32 uBuildID );
|
||||
S_API void S_CALLTYPE SteamAPI_SetMiniDumpComment( const char *pchMsg );
|
||||
|
||||
// interface pointers, configured by SteamAPI_Init()
|
||||
S_API ISteamClient *S_CALLTYPE SteamClient();
|
||||
|
||||
|
||||
//
|
||||
// VERSION_SAFE_STEAM_API_INTERFACES is usually not necessary, but it provides safety against releasing
|
||||
// new steam_api.dll's without recompiling/rereleasing modules that use it.
|
||||
//
|
||||
// If you use VERSION_SAFE_STEAM_API_INTERFACES, then you should call SteamAPI_InitSafe(). Also, to get the
|
||||
// Steam interfaces, you must create and Init() a CSteamAPIContext (below) and use the interfaces in there.
|
||||
//
|
||||
// If you don't use VERSION_SAFE_STEAM_API_INTERFACES, then you can use SteamAPI_Init() and the SteamXXXX()
|
||||
// functions below to get at the Steam interfaces.
|
||||
//
|
||||
#ifdef VERSION_SAFE_STEAM_API_INTERFACES
|
||||
S_API bool S_CALLTYPE SteamAPI_InitSafe();
|
||||
#else
|
||||
|
||||
#if defined(_PS3)
|
||||
S_API bool S_CALLTYPE SteamAPI_Init( SteamPS3Params_t *pParams );
|
||||
#else
|
||||
S_API bool S_CALLTYPE SteamAPI_Init();
|
||||
#endif
|
||||
|
||||
S_API ISteamUser *S_CALLTYPE SteamUser();
|
||||
S_API ISteamFriends *S_CALLTYPE SteamFriends();
|
||||
S_API ISteamUtils *S_CALLTYPE SteamUtils();
|
||||
S_API ISteamMatchmaking *S_CALLTYPE SteamMatchmaking();
|
||||
S_API ISteamUserStats *S_CALLTYPE SteamUserStats();
|
||||
S_API ISteamApps *S_CALLTYPE SteamApps();
|
||||
S_API ISteamNetworking *S_CALLTYPE SteamNetworking();
|
||||
S_API ISteamMatchmakingServers *S_CALLTYPE SteamMatchmakingServers();
|
||||
S_API ISteamRemoteStorage *S_CALLTYPE SteamRemoteStorage();
|
||||
S_API ISteamScreenshots *S_CALLTYPE SteamScreenshots();
|
||||
S_API ISteamHTTP *S_CALLTYPE SteamHTTP();
|
||||
S_API ISteamUnifiedMessages *S_CALLTYPE SteamUnifiedMessages();
|
||||
S_API ISteamController *S_CALLTYPE SteamController();
|
||||
S_API ISteamUGC *S_CALLTYPE SteamUGC();
|
||||
S_API ISteamAppList *S_CALLTYPE SteamAppList();
|
||||
S_API ISteamMusic *S_CALLTYPE SteamMusic();
|
||||
S_API ISteamMusicRemote *S_CALLTYPE SteamMusicRemote();
|
||||
S_API ISteamHTMLSurface *S_CALLTYPE SteamHTMLSurface();
|
||||
S_API ISteamInventory *S_CALLTYPE SteamInventory();
|
||||
S_API ISteamVideo *S_CALLTYPE SteamVideo();
|
||||
#ifdef _PS3
|
||||
S_API ISteamPS3OverlayRender *S_CALLTYPE SteamPS3OverlayRender();
|
||||
#endif
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// Global accessors for Steamworks C++ APIs. See individual isteam*.h files for details.
|
||||
// You should not cache the results of these accessors or pass the result pointers across
|
||||
// modules! Different modules may be compiled against different SDK header versions, and
|
||||
// the interface pointers could therefore be different across modules. Every line of code
|
||||
// which calls into a Steamworks API should retrieve the interface from a global accessor.
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
#if !defined( STEAM_API_EXPORTS )
|
||||
inline ISteamClient *SteamClient();
|
||||
inline ISteamUser *SteamUser();
|
||||
inline ISteamFriends *SteamFriends();
|
||||
inline ISteamUtils *SteamUtils();
|
||||
inline ISteamMatchmaking *SteamMatchmaking();
|
||||
inline ISteamUserStats *SteamUserStats();
|
||||
inline ISteamApps *SteamApps();
|
||||
inline ISteamNetworking *SteamNetworking();
|
||||
inline ISteamMatchmakingServers *SteamMatchmakingServers();
|
||||
inline ISteamRemoteStorage *SteamRemoteStorage();
|
||||
inline ISteamScreenshots *SteamScreenshots();
|
||||
inline ISteamHTTP *SteamHTTP();
|
||||
inline ISteamController *SteamController();
|
||||
inline ISteamUGC *SteamUGC();
|
||||
inline ISteamAppList *SteamAppList();
|
||||
inline ISteamMusic *SteamMusic();
|
||||
inline ISteamMusicRemote *SteamMusicRemote();
|
||||
inline ISteamHTMLSurface *SteamHTMLSurface();
|
||||
inline ISteamInventory *SteamInventory();
|
||||
inline ISteamVideo *SteamVideo();
|
||||
inline ISteamParentalSettings *SteamParentalSettings();
|
||||
#endif // VERSION_SAFE_STEAM_API_INTERFACES
|
||||
|
||||
|
||||
// CSteamAPIContext encapsulates the Steamworks API global accessors into
|
||||
// a single object. This is DEPRECATED and only remains for compatibility.
|
||||
class CSteamAPIContext
|
||||
{
|
||||
public:
|
||||
// DEPRECATED - there is no benefit to using this over the global accessors
|
||||
CSteamAPIContext() { Clear(); }
|
||||
void Clear();
|
||||
bool Init();
|
||||
ISteamClient* SteamClient() const { return m_pSteamClient; }
|
||||
ISteamUser* SteamUser() const { return m_pSteamUser; }
|
||||
ISteamFriends* SteamFriends() const { return m_pSteamFriends; }
|
||||
ISteamUtils* SteamUtils() const { return m_pSteamUtils; }
|
||||
ISteamMatchmaking* SteamMatchmaking() const { return m_pSteamMatchmaking; }
|
||||
ISteamUserStats* SteamUserStats() const { return m_pSteamUserStats; }
|
||||
ISteamApps* SteamApps() const { return m_pSteamApps; }
|
||||
ISteamMatchmakingServers* SteamMatchmakingServers() const { return m_pSteamMatchmakingServers; }
|
||||
ISteamNetworking* SteamNetworking() const { return m_pSteamNetworking; }
|
||||
ISteamRemoteStorage* SteamRemoteStorage() const { return m_pSteamRemoteStorage; }
|
||||
ISteamScreenshots* SteamScreenshots() const { return m_pSteamScreenshots; }
|
||||
ISteamHTTP* SteamHTTP() const { return m_pSteamHTTP; }
|
||||
ISteamController* SteamController() const { return m_pController; }
|
||||
ISteamUGC* SteamUGC() const { return m_pSteamUGC; }
|
||||
ISteamAppList* SteamAppList() const { return m_pSteamAppList; }
|
||||
ISteamMusic* SteamMusic() const { return m_pSteamMusic; }
|
||||
ISteamMusicRemote* SteamMusicRemote() const { return m_pSteamMusicRemote; }
|
||||
ISteamHTMLSurface* SteamHTMLSurface() const { return m_pSteamHTMLSurface; }
|
||||
ISteamInventory* SteamInventory() const { return m_pSteamInventory; }
|
||||
ISteamVideo* SteamVideo() const { return m_pSteamVideo; }
|
||||
ISteamParentalSettings* SteamParentalSettings() const { return m_pSteamParentalSettings; }
|
||||
// DEPRECATED - there is no benefit to using this over the global accessors
|
||||
private:
|
||||
ISteamClient *m_pSteamClient;
|
||||
ISteamUser *m_pSteamUser;
|
||||
ISteamFriends *m_pSteamFriends;
|
||||
ISteamUtils *m_pSteamUtils;
|
||||
ISteamMatchmaking *m_pSteamMatchmaking;
|
||||
ISteamUserStats *m_pSteamUserStats;
|
||||
ISteamApps *m_pSteamApps;
|
||||
ISteamMatchmakingServers *m_pSteamMatchmakingServers;
|
||||
ISteamNetworking *m_pSteamNetworking;
|
||||
ISteamRemoteStorage *m_pSteamRemoteStorage;
|
||||
ISteamScreenshots *m_pSteamScreenshots;
|
||||
ISteamHTTP *m_pSteamHTTP;
|
||||
ISteamController *m_pController;
|
||||
ISteamUGC *m_pSteamUGC;
|
||||
ISteamAppList *m_pSteamAppList;
|
||||
ISteamMusic *m_pSteamMusic;
|
||||
ISteamMusicRemote *m_pSteamMusicRemote;
|
||||
ISteamHTMLSurface *m_pSteamHTMLSurface;
|
||||
ISteamInventory *m_pSteamInventory;
|
||||
ISteamVideo *m_pSteamVideo;
|
||||
ISteamParentalSettings *m_pSteamParentalSettings;
|
||||
};
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// steam callback and call-result helpers
|
||||
//
|
||||
@@ -160,10 +204,13 @@ S_API ISteamPS3OverlayRender *S_CALLTYPE SteamPS3OverlayRender();
|
||||
// delivered/executed when your application calls SteamAPI_RunCallbacks().
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
// SteamAPI_RunCallbacks is safe to call from multiple threads simultaneously,
|
||||
// but if you choose to do this, callback code could be executed on any thread.
|
||||
// One alternative is to call SteamAPI_RunCallbacks from the main thread only,
|
||||
// and call SteamAPI_ReleaseCurrentThreadMemory regularly on other threads.
|
||||
S_API void S_CALLTYPE SteamAPI_RunCallbacks();
|
||||
|
||||
|
||||
|
||||
// Declares a callback member function plus a helper member variable which
|
||||
// registers the callback on object creation and unregisters on destruction.
|
||||
// The optional fourth 'var' param exists only for backwards-compatibility
|
||||
@@ -236,66 +283,18 @@ class CCallResult : private CCallbackBase
|
||||
public:
|
||||
typedef void (T::*func_t)( P*, bool );
|
||||
|
||||
CCallResult()
|
||||
{
|
||||
m_hAPICall = k_uAPICallInvalid;
|
||||
m_pObj = NULL;
|
||||
m_Func = NULL;
|
||||
m_iCallback = P::k_iCallback;
|
||||
}
|
||||
|
||||
void Set( SteamAPICall_t hAPICall, T *p, func_t func )
|
||||
{
|
||||
if ( m_hAPICall )
|
||||
SteamAPI_UnregisterCallResult( this, m_hAPICall );
|
||||
|
||||
m_hAPICall = hAPICall;
|
||||
m_pObj = p;
|
||||
m_Func = func;
|
||||
|
||||
if ( hAPICall )
|
||||
SteamAPI_RegisterCallResult( this, hAPICall );
|
||||
}
|
||||
|
||||
bool IsActive() const
|
||||
{
|
||||
return ( m_hAPICall != k_uAPICallInvalid );
|
||||
}
|
||||
|
||||
void Cancel()
|
||||
{
|
||||
if ( m_hAPICall != k_uAPICallInvalid )
|
||||
{
|
||||
SteamAPI_UnregisterCallResult( this, m_hAPICall );
|
||||
m_hAPICall = k_uAPICallInvalid;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
~CCallResult()
|
||||
{
|
||||
Cancel();
|
||||
}
|
||||
CCallResult();
|
||||
~CCallResult();
|
||||
|
||||
void Set( SteamAPICall_t hAPICall, T *p, func_t func );
|
||||
bool IsActive() const;
|
||||
void Cancel();
|
||||
|
||||
void SetGameserverFlag() { m_nCallbackFlags |= k_ECallbackFlagsGameServer; }
|
||||
private:
|
||||
virtual void Run( void *pvParam )
|
||||
{
|
||||
m_hAPICall = k_uAPICallInvalid; // caller unregisters for us
|
||||
(m_pObj->*m_Func)( (P *)pvParam, false );
|
||||
}
|
||||
virtual void Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall )
|
||||
{
|
||||
if ( hSteamAPICall == m_hAPICall )
|
||||
{
|
||||
m_hAPICall = k_uAPICallInvalid; // caller unregisters for us
|
||||
(m_pObj->*m_Func)( (P *)pvParam, bIOFailure );
|
||||
}
|
||||
}
|
||||
virtual int GetCallbackSizeBytes()
|
||||
{
|
||||
return sizeof( P );
|
||||
}
|
||||
virtual void Run( void *pvParam );
|
||||
virtual void Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall );
|
||||
virtual int GetCallbackSizeBytes() { return sizeof( P ); }
|
||||
|
||||
SteamAPICall_t m_hAPICall;
|
||||
T *m_pObj;
|
||||
@@ -317,42 +316,14 @@ public:
|
||||
|
||||
// NOTE: If you can't provide the correct parameters at construction time, you should
|
||||
// use the CCallbackManual callback object (STEAM_CALLBACK_MANUAL macro) instead.
|
||||
CCallback( T *pObj, func_t func ) : m_pObj( NULL ), m_Func( NULL )
|
||||
{
|
||||
if ( bGameserver )
|
||||
{
|
||||
this->SetGameserverFlag();
|
||||
}
|
||||
Register( pObj, func );
|
||||
}
|
||||
CCallback( T *pObj, func_t func );
|
||||
|
||||
// manual registration of the callback
|
||||
void Register( T *pObj, func_t func )
|
||||
{
|
||||
if ( !pObj || !func )
|
||||
return;
|
||||
|
||||
if ( this->m_nCallbackFlags & CCallbackBase::k_ECallbackFlagsRegistered )
|
||||
Unregister();
|
||||
|
||||
m_pObj = pObj;
|
||||
m_Func = func;
|
||||
// SteamAPI_RegisterCallback sets k_ECallbackFlagsRegistered
|
||||
SteamAPI_RegisterCallback( this, P::k_iCallback );
|
||||
}
|
||||
|
||||
void Unregister()
|
||||
{
|
||||
// SteamAPI_UnregisterCallback removes k_ECallbackFlagsRegistered
|
||||
SteamAPI_UnregisterCallback( this );
|
||||
}
|
||||
void Register( T *pObj, func_t func );
|
||||
void Unregister();
|
||||
|
||||
protected:
|
||||
virtual void Run( void *pvParam )
|
||||
{
|
||||
(m_pObj->*m_Func)( (P *)pvParam );
|
||||
}
|
||||
|
||||
virtual void Run( void *pvParam );
|
||||
|
||||
T *m_pObj;
|
||||
func_t m_Func;
|
||||
};
|
||||
@@ -373,26 +344,6 @@ public:
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// The following macros are implementation details, not intended for public use
|
||||
//-----------------------------------------------------------------------------
|
||||
#define _STEAM_CALLBACK_AUTO_HOOK( thisclass, func, param )
|
||||
#define _STEAM_CALLBACK_HELPER( _1, _2, SELECTED, ... ) _STEAM_CALLBACK_##SELECTED
|
||||
#define _STEAM_CALLBACK_SELECT( X, Y ) _STEAM_CALLBACK_HELPER X Y
|
||||
#define _STEAM_CALLBACK_3( extra_code, thisclass, func, param ) \
|
||||
struct CCallbackInternal_ ## func : private CCallbackImpl< sizeof( param ) > { \
|
||||
CCallbackInternal_ ## func () { extra_code SteamAPI_RegisterCallback( this, param::k_iCallback ); } \
|
||||
CCallbackInternal_ ## func ( const CCallbackInternal_ ## func & ) { extra_code SteamAPI_RegisterCallback( this, param::k_iCallback ); } \
|
||||
CCallbackInternal_ ## func & operator=( const CCallbackInternal_ ## func & ) { return *this; } \
|
||||
private: virtual void Run( void *pvParam ) { _STEAM_CALLBACK_AUTO_HOOK( thisclass, func, param ) \
|
||||
thisclass *pOuter = reinterpret_cast<thisclass*>( reinterpret_cast<char*>(this) - offsetof( thisclass, m_steamcallback_ ## func ) ); \
|
||||
pOuter->func( reinterpret_cast<param*>( pvParam ) ); \
|
||||
} \
|
||||
} m_steamcallback_ ## func ; void func( param *pParam )
|
||||
#define _STEAM_CALLBACK_4( _, thisclass, func, param, var ) \
|
||||
CCallback< thisclass, param > var; void func( param *pParam )
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
// disable this warning; this pattern need for steam callback registration
|
||||
#pragma warning( disable: 4355 ) // 'this' : used in base member initializer list
|
||||
@@ -405,7 +356,11 @@ public:
|
||||
// The following functions are part of abstracting API access to the steamclient.dll, but should only be used in very specific cases
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
// pumps out all the steam messages, calling the register callback
|
||||
// SteamAPI_IsSteamRunning() returns true if Steam is currently running
|
||||
S_API bool S_CALLTYPE SteamAPI_IsSteamRunning();
|
||||
|
||||
// Pumps out all the steam messages, calling registered callbacks.
|
||||
// NOT THREADSAFE - do not call from multiple threads simultaneously.
|
||||
S_API void Steam_RunCallbacks( HSteamPipe hSteamPipe, bool bGameServerCallbacks );
|
||||
|
||||
// register the callback funcs to use to interact with the steam dll
|
||||
@@ -414,7 +369,8 @@ S_API void Steam_RegisterInterfaceFuncs( void *hModule );
|
||||
// returns the HSteamUser of the last user to dispatch a callback
|
||||
S_API HSteamUser Steam_GetHSteamUserCurrent();
|
||||
|
||||
// returns the filename path of the current running Steam process, used if you need to load an explicit steam dll by name
|
||||
// returns the filename path of the current running Steam process, used if you need to load an explicit steam dll by name.
|
||||
// DEPRECATED - implementation is Windows only, and the path returned is a UTF-8 string which must be converted to UTF-16 for use with Win32 APIs
|
||||
S_API const char *SteamAPI_GetSteamInstallPath();
|
||||
|
||||
// returns the pipe we are communicating to Steam with
|
||||
@@ -427,224 +383,12 @@ S_API void SteamAPI_SetTryCatchCallbacks( bool bTryCatchCallbacks );
|
||||
S_API HSteamPipe GetHSteamPipe();
|
||||
S_API HSteamUser GetHSteamUser();
|
||||
|
||||
#ifdef VERSION_SAFE_STEAM_API_INTERFACES
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// VERSION_SAFE_STEAM_API_INTERFACES uses CSteamAPIContext to provide interfaces to each module in a way that
|
||||
// lets them each specify the interface versions they are compiled with.
|
||||
//
|
||||
// It's important that these stay inlined in the header so the calling module specifies the interface versions
|
||||
// for whatever Steam API version it has.
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
S_API HSteamUser SteamAPI_GetHSteamUser();
|
||||
|
||||
class CSteamAPIContext
|
||||
{
|
||||
public:
|
||||
CSteamAPIContext();
|
||||
void Clear();
|
||||
|
||||
bool Init();
|
||||
|
||||
ISteamUser* SteamUser() { return m_pSteamUser; }
|
||||
ISteamFriends* SteamFriends() { return m_pSteamFriends; }
|
||||
ISteamUtils* SteamUtils() { return m_pSteamUtils; }
|
||||
ISteamMatchmaking* SteamMatchmaking() { return m_pSteamMatchmaking; }
|
||||
ISteamUserStats* SteamUserStats() { return m_pSteamUserStats; }
|
||||
ISteamApps* SteamApps() { return m_pSteamApps; }
|
||||
ISteamMatchmakingServers* SteamMatchmakingServers() { return m_pSteamMatchmakingServers; }
|
||||
ISteamNetworking* SteamNetworking() { return m_pSteamNetworking; }
|
||||
ISteamRemoteStorage* SteamRemoteStorage() { return m_pSteamRemoteStorage; }
|
||||
ISteamScreenshots* SteamScreenshots() { return m_pSteamScreenshots; }
|
||||
ISteamHTTP* SteamHTTP() { return m_pSteamHTTP; }
|
||||
ISteamUnifiedMessages* SteamUnifiedMessages() { return m_pSteamUnifiedMessages; }
|
||||
ISteamController* SteamController() { return m_pController; }
|
||||
ISteamUGC* SteamUGC() { return m_pSteamUGC; }
|
||||
ISteamAppList* SteamAppList() { return m_pSteamAppList; }
|
||||
ISteamMusic* SteamMusic() { return m_pSteamMusic; }
|
||||
ISteamMusicRemote* SteamMusicRemote() { return m_pSteamMusicRemote; }
|
||||
ISteamHTMLSurface* SteamHTMLSurface() { return m_pSteamHTMLSurface; }
|
||||
ISteamInventory* SteamInventory() { return m_pSteamInventory; }
|
||||
ISteamVideo* SteamVideo() { return m_pSteamVideo; }
|
||||
#ifdef _PS3
|
||||
ISteamPS3OverlayRender* SteamPS3OverlayRender() { return m_pSteamPS3OverlayRender; }
|
||||
#if defined( VERSION_SAFE_STEAM_API_INTERFACES )
|
||||
// exists only for backwards compat with code written against older SDKs
|
||||
S_API bool S_CALLTYPE SteamAPI_InitSafe();
|
||||
#endif
|
||||
|
||||
private:
|
||||
ISteamUser *m_pSteamUser;
|
||||
ISteamFriends *m_pSteamFriends;
|
||||
ISteamUtils *m_pSteamUtils;
|
||||
ISteamMatchmaking *m_pSteamMatchmaking;
|
||||
ISteamUserStats *m_pSteamUserStats;
|
||||
ISteamApps *m_pSteamApps;
|
||||
ISteamMatchmakingServers *m_pSteamMatchmakingServers;
|
||||
ISteamNetworking *m_pSteamNetworking;
|
||||
ISteamRemoteStorage *m_pSteamRemoteStorage;
|
||||
ISteamScreenshots *m_pSteamScreenshots;
|
||||
ISteamHTTP *m_pSteamHTTP;
|
||||
ISteamUnifiedMessages*m_pSteamUnifiedMessages;
|
||||
ISteamController *m_pController;
|
||||
ISteamUGC *m_pSteamUGC;
|
||||
ISteamAppList *m_pSteamAppList;
|
||||
ISteamMusic *m_pSteamMusic;
|
||||
ISteamMusicRemote *m_pSteamMusicRemote;
|
||||
ISteamHTMLSurface *m_pSteamHTMLSurface;
|
||||
ISteamInventory *m_pSteamInventory;
|
||||
ISteamVideo *m_pSteamVideo;
|
||||
#ifdef _PS3
|
||||
ISteamPS3OverlayRender *m_pSteamPS3OverlayRender;
|
||||
#endif
|
||||
};
|
||||
|
||||
inline CSteamAPIContext::CSteamAPIContext()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
inline void CSteamAPIContext::Clear()
|
||||
{
|
||||
m_pSteamUser = NULL;
|
||||
m_pSteamFriends = NULL;
|
||||
m_pSteamUtils = NULL;
|
||||
m_pSteamMatchmaking = NULL;
|
||||
m_pSteamUserStats = NULL;
|
||||
m_pSteamApps = NULL;
|
||||
m_pSteamMatchmakingServers = NULL;
|
||||
m_pSteamNetworking = NULL;
|
||||
m_pSteamRemoteStorage = NULL;
|
||||
m_pSteamHTTP = NULL;
|
||||
m_pSteamScreenshots = NULL;
|
||||
m_pSteamMusic = NULL;
|
||||
m_pSteamUnifiedMessages = NULL;
|
||||
m_pController = NULL;
|
||||
m_pSteamUGC = NULL;
|
||||
m_pSteamAppList = NULL;
|
||||
m_pSteamMusic = NULL;
|
||||
m_pSteamMusicRemote= NULL;
|
||||
m_pSteamHTMLSurface = NULL;
|
||||
m_pSteamInventory = NULL;
|
||||
#ifdef _PS3
|
||||
m_pSteamPS3OverlayRender = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
// This function must be inlined so the module using steam_api.dll gets the version names they want.
|
||||
inline bool CSteamAPIContext::Init()
|
||||
{
|
||||
if ( !SteamClient() )
|
||||
return false;
|
||||
|
||||
HSteamUser hSteamUser = SteamAPI_GetHSteamUser();
|
||||
HSteamPipe hSteamPipe = SteamAPI_GetHSteamPipe();
|
||||
|
||||
m_pSteamUser = SteamClient()->GetISteamUser( hSteamUser, hSteamPipe, STEAMUSER_INTERFACE_VERSION );
|
||||
if ( !m_pSteamUser )
|
||||
return false;
|
||||
|
||||
m_pSteamFriends = SteamClient()->GetISteamFriends( hSteamUser, hSteamPipe, STEAMFRIENDS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamFriends )
|
||||
return false;
|
||||
|
||||
m_pSteamUtils = SteamClient()->GetISteamUtils( hSteamPipe, STEAMUTILS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamUtils )
|
||||
return false;
|
||||
|
||||
m_pSteamMatchmaking = SteamClient()->GetISteamMatchmaking( hSteamUser, hSteamPipe, STEAMMATCHMAKING_INTERFACE_VERSION );
|
||||
if ( !m_pSteamMatchmaking )
|
||||
return false;
|
||||
|
||||
m_pSteamMatchmakingServers = SteamClient()->GetISteamMatchmakingServers( hSteamUser, hSteamPipe, STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamMatchmakingServers )
|
||||
return false;
|
||||
|
||||
m_pSteamUserStats = SteamClient()->GetISteamUserStats( hSteamUser, hSteamPipe, STEAMUSERSTATS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamUserStats )
|
||||
return false;
|
||||
|
||||
m_pSteamApps = SteamClient()->GetISteamApps( hSteamUser, hSteamPipe, STEAMAPPS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamApps )
|
||||
return false;
|
||||
|
||||
m_pSteamNetworking = SteamClient()->GetISteamNetworking( hSteamUser, hSteamPipe, STEAMNETWORKING_INTERFACE_VERSION );
|
||||
if ( !m_pSteamNetworking )
|
||||
return false;
|
||||
|
||||
m_pSteamRemoteStorage = SteamClient()->GetISteamRemoteStorage( hSteamUser, hSteamPipe, STEAMREMOTESTORAGE_INTERFACE_VERSION );
|
||||
if ( !m_pSteamRemoteStorage )
|
||||
return false;
|
||||
|
||||
m_pSteamScreenshots = SteamClient()->GetISteamScreenshots( hSteamUser, hSteamPipe, STEAMSCREENSHOTS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamScreenshots )
|
||||
return false;
|
||||
|
||||
m_pSteamHTTP = SteamClient()->GetISteamHTTP( hSteamUser, hSteamPipe, STEAMHTTP_INTERFACE_VERSION );
|
||||
if ( !m_pSteamHTTP )
|
||||
return false;
|
||||
|
||||
m_pSteamUnifiedMessages = SteamClient()->GetISteamUnifiedMessages( hSteamUser, hSteamPipe, STEAMUNIFIEDMESSAGES_INTERFACE_VERSION );
|
||||
if ( !m_pSteamUnifiedMessages )
|
||||
return false;
|
||||
|
||||
m_pController = SteamClient()->GetISteamController( hSteamUser, hSteamPipe, STEAMCONTROLLER_INTERFACE_VERSION );
|
||||
if ( !m_pController )
|
||||
return false;
|
||||
|
||||
m_pSteamUGC = SteamClient()->GetISteamUGC( hSteamUser, hSteamPipe, STEAMUGC_INTERFACE_VERSION );
|
||||
if ( !m_pSteamUGC )
|
||||
return false;
|
||||
|
||||
m_pSteamAppList = SteamClient()->GetISteamAppList( hSteamUser, hSteamPipe, STEAMAPPLIST_INTERFACE_VERSION );
|
||||
if ( !m_pSteamAppList )
|
||||
return false;
|
||||
|
||||
m_pSteamMusic = SteamClient()->GetISteamMusic( hSteamUser, hSteamPipe, STEAMMUSIC_INTERFACE_VERSION );
|
||||
if ( !m_pSteamMusic )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
m_pSteamMusicRemote = SteamClient()->GetISteamMusicRemote( hSteamUser, hSteamPipe, STEAMMUSICREMOTE_INTERFACE_VERSION );
|
||||
if ( !m_pSteamMusicRemote )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
m_pSteamHTMLSurface = SteamClient()->GetISteamHTMLSurface( hSteamUser, hSteamPipe, STEAMHTMLSURFACE_INTERFACE_VERSION );
|
||||
if ( !m_pSteamHTMLSurface )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
m_pSteamInventory = SteamClient()->GetISteamInventory( hSteamUser, hSteamPipe, STEAMINVENTORY_INTERFACE_VERSION );
|
||||
if ( !m_pSteamInventory )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
m_pSteamVideo = SteamClient()->GetISteamVideo( hSteamUser, hSteamPipe, STEAMVIDEO_INTERFACE_VERSION );
|
||||
if ( !m_pSteamVideo )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef _PS3
|
||||
m_pSteamPS3OverlayRender = SteamClient()->GetISteamPS3OverlayRender();
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // VERSION_SAFE_STEAM_API_INTERFACES
|
||||
|
||||
#if defined(USE_BREAKPAD_HANDLER) || defined(STEAM_API_EXPORTS)
|
||||
// this should be called before the game initialized the steam APIs
|
||||
// pchDate should be of the format "Mmm dd yyyy" (such as from the __DATE__ macro )
|
||||
// pchTime should be of the format "hh:mm:ss" (such as from the __TIME__ macro )
|
||||
// bFullMemoryDumps (Win32 only) -- writes out a uuid-full.dmp in the client/dumps folder
|
||||
// pvContext-- can be NULL, will be the void * context passed into m_pfnPreMinidumpCallback
|
||||
// PFNPreMinidumpCallback m_pfnPreMinidumpCallback -- optional callback which occurs just before a .dmp file is written during a crash. Applications can hook this to allow adding additional information into the .dmp comment stream.
|
||||
S_API void S_CALLTYPE SteamAPI_UseBreakpadCrashHandler( char const *pchVersion, char const *pchDate, char const *pchTime, bool bFullMemoryDumps, void *pvContext, PFNPreMinidumpCallback m_pfnPreMinidumpCallback );
|
||||
S_API void S_CALLTYPE SteamAPI_SetBreakpadAppID( uint32 unAppID );
|
||||
#endif
|
||||
#include "steam_api_internal.h"
|
||||
|
||||
#endif // STEAM_API_H
|
||||
|
||||
Reference in New Issue
Block a user