isteamremoteplay.cs (2952B)
1 // This file is provided under The MIT License as part of Steamworks.NET. 2 // Copyright (c) 2013-2019 Riley Labrecque 3 // Please see the included LICENSE.txt for additional information. 4 5 // This file is automatically generated. 6 // Changes to this file will be reverted when you update Steamworks.NET 7 8 #if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH 9 #define DISABLESTEAMWORKS 10 #endif 11 12 #if !DISABLESTEAMWORKS 13 14 using System.Runtime.InteropServices; 15 using IntPtr = System.IntPtr; 16 17 namespace Steamworks { 18 public static class SteamRemotePlay { 19 /// <summary> 20 /// <para> Get the number of currently connected Steam Remote Play sessions</para> 21 /// </summary> 22 public static uint GetSessionCount() { 23 InteropHelp.TestIfAvailableClient(); 24 return NativeMethods.ISteamRemotePlay_GetSessionCount(CSteamAPIContext.GetSteamRemotePlay()); 25 } 26 27 /// <summary> 28 /// <para> Get the currently connected Steam Remote Play session ID at the specified index. Returns zero if index is out of bounds.</para> 29 /// </summary> 30 public static uint GetSessionID(int iSessionIndex) { 31 InteropHelp.TestIfAvailableClient(); 32 return NativeMethods.ISteamRemotePlay_GetSessionID(CSteamAPIContext.GetSteamRemotePlay(), iSessionIndex); 33 } 34 35 /// <summary> 36 /// <para> Get the SteamID of the connected user</para> 37 /// </summary> 38 public static CSteamID GetSessionSteamID(uint unSessionID) { 39 InteropHelp.TestIfAvailableClient(); 40 return (CSteamID)NativeMethods.ISteamRemotePlay_GetSessionSteamID(CSteamAPIContext.GetSteamRemotePlay(), unSessionID); 41 } 42 43 /// <summary> 44 /// <para> Get the name of the session client device</para> 45 /// <para> This returns NULL if the sessionID is not valid</para> 46 /// </summary> 47 public static string GetSessionClientName(uint unSessionID) { 48 InteropHelp.TestIfAvailableClient(); 49 return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamRemotePlay_GetSessionClientName(CSteamAPIContext.GetSteamRemotePlay(), unSessionID)); 50 } 51 52 /// <summary> 53 /// <para> Get the form factor of the session client device</para> 54 /// </summary> 55 public static ESteamDeviceFormFactor GetSessionClientFormFactor(uint unSessionID) { 56 InteropHelp.TestIfAvailableClient(); 57 return NativeMethods.ISteamRemotePlay_GetSessionClientFormFactor(CSteamAPIContext.GetSteamRemotePlay(), unSessionID); 58 } 59 60 /// <summary> 61 /// <para> Get the resolution, in pixels, of the session client device</para> 62 /// <para> This is set to 0x0 if the resolution is not available</para> 63 /// </summary> 64 public static bool BGetSessionClientResolution(uint unSessionID, out int pnResolutionX, out int pnResolutionY) { 65 InteropHelp.TestIfAvailableClient(); 66 return NativeMethods.ISteamRemotePlay_BGetSessionClientResolution(CSteamAPIContext.GetSteamRemotePlay(), unSessionID, out pnResolutionX, out pnResolutionY); 67 } 68 } 69 } 70 71 #endif // !DISABLESTEAMWORKS