Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update bindings to SDK 1.59 #183

Merged
merged 4 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ steamworks = "0.11.0"

| Crate | SDK | MSRV |
|--------|-------|--------|
| git | 1.58a | 1.71.1 |
| git | 1.59 | 1.71.1 |
| 0.11.0 | 1.58a | 1.71.1 |
| 0.10.0 | 1.54 | 1.56.1 |
| 0.9.0 | 1.53a | 1.56.1 |
Expand Down
8 changes: 8 additions & 0 deletions src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ impl<Manager> Input<Manager> {
}
}

/// Allows to load a specific Action Manifest File localy
pub fn set_input_action_manifest_file_path(&self, path: &str) -> bool {
let path = CString::new(path).unwrap();
unsafe {
sys::SteamAPI_ISteamInput_SetInputActionManifestFilePath(self.input, path.as_ptr())
}
}

/// Returns the associated ControllerActionSet handle for the specified controller,
pub fn get_action_set_handle(&self, action_set_name: &str) -> sys::InputActionSetHandle_t {
let name = CString::new(action_set_name).unwrap();
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ impl Client<ClientManager> {
let versions: Vec<&[u8]> = vec![
sys::STEAMUTILS_INTERFACE_VERSION,
sys::STEAMNETWORKINGUTILS_INTERFACE_VERSION,
sys::STEAMAPPLIST_INTERFACE_VERSION,
sys::STEAMAPPS_INTERFACE_VERSION,
sys::STEAMCONTROLLER_INTERFACE_VERSION,
sys::STEAMFRIENDS_INTERFACE_VERSION,
Expand Down
2 changes: 1 addition & 1 deletion src/networking_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ impl From<NetworkingConfigValue> for sys::ESteamNetworkingConfigValue {
NetworkingConfigValue::SDRClientMinPingsBeforePingAccurate => sys::ESteamNetworkingConfigValue::k_ESteamNetworkingConfig_SDRClient_MinPingsBeforePingAccurate,
NetworkingConfigValue::SDRClientSingleSocket => sys::ESteamNetworkingConfigValue::k_ESteamNetworkingConfig_SDRClient_SingleSocket,
NetworkingConfigValue::SDRClientForceRelayCluster => sys::ESteamNetworkingConfigValue::k_ESteamNetworkingConfig_SDRClient_ForceRelayCluster,
NetworkingConfigValue::SDRClientDebugTicketAddress => sys::ESteamNetworkingConfigValue::k_ESteamNetworkingConfig_SDRClient_DebugTicketAddress,
NetworkingConfigValue::SDRClientDebugTicketAddress => sys::ESteamNetworkingConfigValue::k_ESteamNetworkingConfig_SDRClient_DevTicket,
NetworkingConfigValue::SDRClientForceProxyAddr => sys::ESteamNetworkingConfigValue::k_ESteamNetworkingConfig_SDRClient_ForceProxyAddr,
NetworkingConfigValue::SDRClientFakeClusterPing => sys::ESteamNetworkingConfigValue::k_ESteamNetworkingConfig_SDRClient_FakeClusterPing,
NetworkingConfigValue::LogLevelAckRTT => sys::ESteamNetworkingConfigValue::k_ESteamNetworkingConfig_LogLevel_AckRTT,
Expand Down
8 changes: 1 addition & 7 deletions steamworks-sys/lib/steam/public/steam/isteamclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,12 @@ class ISteamClient
// Expose HTTP interface
virtual ISteamHTTP *GetISteamHTTP( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;

// Deprecated - the ISteamUnifiedMessages interface is no longer intended for public consumption.
STEAM_PRIVATE_API( virtual void *DEPRECATED_GetISteamUnifiedMessages( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0 ; )

// Exposes the ISteamController interface - deprecated in favor of Steam Input
virtual ISteamController *GetISteamController( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;

// Exposes the ISteamUGC interface
virtual ISteamUGC *GetISteamUGC( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;

// returns app list interface, only available on specially registered apps
virtual ISteamAppList *GetISteamAppList( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;

// Music Player
virtual ISteamMusic *GetISteamMusic( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;

Expand Down Expand Up @@ -162,7 +156,7 @@ class ISteamClient
STEAM_PRIVATE_API( virtual void DestroyAllInterfaces() = 0; )

};
#define STEAMCLIENT_INTERFACE_VERSION "SteamClient020"
#define STEAMCLIENT_INTERFACE_VERSION "SteamClient021"

#ifndef STEAM_API_EXPORTS

Expand Down
1 change: 0 additions & 1 deletion steamworks-sys/lib/steam/public/steam/isteamcontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,6 @@ typedef uint64 ControllerAnalogActionHandle_t;
#define ControllerAnalogActionData_t InputAnalogActionData_t
#define ControllerDigitalActionData_t InputDigitalActionData_t
#define ControllerMotionData_t InputMotionData_t
#define ControllerMotionDataV2_t InputMotionDataV2_t
#else
struct ControllerAnalogActionData_t
{
Expand Down
4 changes: 4 additions & 0 deletions steamworks-sys/lib/steam/public/steam/isteamfriends.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ struct FriendGameInfo_t
};
#pragma pack( pop )

// special values for FriendGameInfo_t::m_usQueryPort
const uint16 k_usFriendGameInfoQueryPort_NotInitialized = 0xFFFF; // We haven't asked the GS for this query port's actual value yet. Was #define QUERY_PORT_NOT_INITIALIZED in older versions of Steamworks SDK.
const uint16 k_usFriendGameInfoQueryPort_Error = 0xFFFE; // We were unable to get the query port for this server. Was #define QUERY_PORT_ERROR in older versions of Steamworks SDK.

// maximum number of characters in a user's name. Two flavors; one for UTF-8 and one for UTF-16.
// The UTF-8 version has to be very generous to accomodate characters that get large when encoded
// in UTF-8.
Expand Down
52 changes: 0 additions & 52 deletions steamworks-sys/lib/steam/public/steam/isteaminput.h
Original file line number Diff line number Diff line change
Expand Up @@ -660,58 +660,6 @@ struct InputMotionData_t
float rotVelZ;
};


struct InputMotionDataV2_t
{
//
// Gyro post processing:
//

// Drift Corrected Quaternion is calculated after steam input controller calibration values have been applied.
// Rawest _useful_ version of a quaternion.
// Most camera implementations should use this by comparing last rotation against current rotation, and applying the difference to the in game camera (plus your own sensitivity tweaks)
// It is worth viewing
float driftCorrectedQuatX;
float driftCorrectedQuatY;
float driftCorrectedQuatZ;
float driftCorrectedQuatW;

// Sensor fusion corrects using accelerometer, and "average forward over time" for "forward".
// This can "ouija" your aim, so it's not so appropriate for camera controls (sensor fusion was originally made for racing game steering )
// Same result as from old InputMotionData_t::rotQuatX/Y/Z/W
float sensorFusionQuatX;
float sensorFusionQuatY;
float sensorFusionQuatZ;
float sensorFusionQuatW;

// Deferred Sensor fusion quaternion with deferred correction
// Reduces perception of "ouija" effect by only applying correction when the controller is below "low noise" thresholds,
// while the controller rotates fast - never when the user is attempting precision aim.
float deferredSensorFusionQuatX;
float deferredSensorFusionQuatY;
float deferredSensorFusionQuatZ;
float deferredSensorFusionQuatW;

// Same as accel but values are calibrated such that 1 unit = 1G.
// X = Right
// Y = Forward out through the joystick USB port.
// Z = Up through the joystick axis.
float gravityX;
float gravityY;
float gravityZ;

//
// Same as rotVel values in GetMotionData but values are calibrated to degrees per second.
// Local Space (controller relative)
// X = Pitch = left to right axis
// Y = Roll = axis through charging port
// Z = Yaw = axis through sticks
float degreesPerSecondX;
float degreesPerSecondY;
float degreesPerSecondZ;

};

//-----------------------------------------------------------------------------
// Purpose: when callbacks are enabled this fires each time a controller action
// state changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ enum EParentalFeature
k_EFeatureLibrary = 11,
k_EFeatureTest = 12,
k_EFeatureSiteLicense = 13,
k_EFeatureKioskMode = 14,
k_EFeatureKioskMode_Deprecated = 14,
k_EFeatureMax
};

Expand Down
1 change: 1 addition & 0 deletions steamworks-sys/lib/steam/public/steam/isteamremoteplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ enum ESteamDeviceFormFactor
k_ESteamDeviceFormFactorTablet = 2,
k_ESteamDeviceFormFactorComputer = 3,
k_ESteamDeviceFormFactorTV = 4,
k_ESteamDeviceFormFactorVRHeadset = 5,
};

// Steam Remote Play session ID
Expand Down
3 changes: 2 additions & 1 deletion steamworks-sys/lib/steam/public/steam/isteamremotestorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,10 @@ enum EWorkshopFileType
k_EWorkshopFileTypeSteamworksAccessInvite = 13, // internal
k_EWorkshopFileTypeSteamVideo = 14, // Steam video
k_EWorkshopFileTypeGameManagedItem = 15, // managed completely by the game, not the user, and not shown on the web
k_EWorkshopFileTypeClip = 16, // internal

// Update k_EWorkshopFileTypeMax if you add values.
k_EWorkshopFileTypeMax = 16
k_EWorkshopFileTypeMax = 17

};

Expand Down
2 changes: 2 additions & 0 deletions steamworks-sys/lib/steam/public/steam/isteamugc.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ enum EItemState
k_EItemStateNeedsUpdate = 8, // items needs an update. Either because it's not installed yet or creator updated content
k_EItemStateDownloading = 16, // item update is currently downloading
k_EItemStateDownloadPending = 32, // DownloadItem() was called for this item, content isn't available until DownloadItemResult_t is fired
k_EItemStateDisabledLocally = 64, // Item is disabled locally, so it shouldn't be considered subscribed
};

enum EItemStatistic
Expand Down Expand Up @@ -154,6 +155,7 @@ enum EItemPreviewType
// | |Dn | |
// +---+---+---+---+
k_EItemPreviewType_EnvironmentMap_LatLong = 4, // standard image file expected
k_EItemPreviewType_Clip = 5, // clip id is stored
k_EItemPreviewType_ReservedMax = 255, // you can specify your own types above this value
};

Expand Down
3 changes: 3 additions & 0 deletions steamworks-sys/lib/steam/public/steam/isteamutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ class ISteamUtils

// Dismisses the floating keyboard.
virtual bool DismissFloatingGamepadTextInput() = 0;

// Dismisses the full-screen text input dialog.
virtual bool DismissGamepadTextInput() = 0;
};

#define STEAMUTILS_INTERFACE_VERSION "SteamUtils010"
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
44 changes: 28 additions & 16 deletions steamworks-sys/lib/steam/public/steam/steam_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include "isteamhttp.h"
#include "isteamcontroller.h"
#include "isteamugc.h"
#include "isteamapplist.h"
#include "isteamhtmlsurface.h"
#include "isteaminventory.h"
#include "isteamvideo.h"
Expand All @@ -63,9 +62,27 @@ enum ESteamAPIInitResult
k_ESteamAPIInitResult_VersionMismatch = 3, // Steam client appears to be out of date
};

// Initialize the Steamworks SDK.
// On success k_ESteamAPIInitResult_OK is returned. Otherwise, if pOutErrMsg is non-NULL,
// it will receive a non-localized message that explains the reason for the failure
// Initializing the Steamworks SDK
// -----------------------------
//
// There are three different methods you can use to initialize the Steamworks SDK, depending on
// your project's environment. You should only use one method in your project.
//
// If you are able to include this C++ header in your project, we recommend using the following
// initialization methods. They will ensure that all ISteam* interfaces defined in other
// C++ header files have versions that are supported by the user's Steam Client:
// - SteamAPI_InitEx() for new projects so you can show a detailed error message to the user
// - SteamAPI_Init() for existing projects that only display a generic error message
//
// If you are unable to include this C++ header in your project and are dynamically loading
// Steamworks SDK methods from dll/so, you can use the following method:
// - SteamAPI_InitFlat()


// See "Initializing the Steamworks SDK" above for how to choose an init method.
// On success k_ESteamAPIInitResult_OK is returned. Otherwise, returns a value that can be used
// to create a localized error message for the user. If pOutErrMsg is non-NULL,
// it will receive an example error message, in English, that explains the reason for the failure.
//
// Example usage:
//
Expand All @@ -74,14 +91,18 @@ enum ESteamAPIInitResult
// FatalError( "Failed to init Steam. %s", errMsg );
inline ESteamAPIInitResult SteamAPI_InitEx( SteamErrMsg *pOutErrMsg );

// Initialize the SDK, without worrying about the cause of failure.
// This function is included for compatibility with older SDK.
// You can use it if you don't care about decent error handling
// See "Initializing the Steamworks SDK" above for how to choose an init method.
// Returns true on success
inline bool SteamAPI_Init()
{
return SteamAPI_InitEx( NULL ) == k_ESteamAPIInitResult_OK;
}

// See "Initializing the Steamworks SDK" above for how to choose an init method.
// Same usage as SteamAPI_InitEx(), however does not verify ISteam* interfaces are
// supported by the user's client and is exported from the dll
S_API ESteamAPIInitResult S_CALLTYPE SteamAPI_InitFlat( SteamErrMsg *pOutErrMsg );

// SteamAPI_Shutdown should be called during process shutdown if possible.
S_API void S_CALLTYPE SteamAPI_Shutdown();

Expand Down Expand Up @@ -277,10 +298,6 @@ inline bool CSteamAPIContext::Init()
if ( !m_pSteamUGC )
return false;

m_pSteamAppList = ::SteamAppList();
if ( !m_pSteamAppList )
return false;

m_pSteamMusic = ::SteamMusic();
if ( !m_pSteamMusic )
return false;
Expand Down Expand Up @@ -318,17 +335,12 @@ inline bool CSteamAPIContext::Init()

// Internal implementation of SteamAPI_InitEx. This is done in a way that checks
// all of the versions of interfaces from headers being compiled into this code.
// If you are not using any of the C++ interfaces and do not need this version checking
// (for example if you are only using the "flat" interfaces, which have a different type
// of version checking), you can pass a NULL interface version string.
S_API ESteamAPIInitResult S_CALLTYPE SteamInternal_SteamAPI_Init( const char *pszInternalCheckInterfaceVersions, SteamErrMsg *pOutErrMsg );
inline ESteamAPIInitResult SteamAPI_InitEx( SteamErrMsg *pOutErrMsg )
{
const char *pszInternalCheckInterfaceVersions =
STEAMUTILS_INTERFACE_VERSION "\0"
STEAMNETWORKINGUTILS_INTERFACE_VERSION "\0"

STEAMAPPLIST_INTERFACE_VERSION "\0"
STEAMAPPS_INTERFACE_VERSION "\0"
STEAMCONTROLLER_INTERFACE_VERSION "\0"
STEAMFRIENDS_INTERFACE_VERSION "\0"
Expand Down
Loading
Loading