Call SetupInterface on startup

This commit is contained in:
Garry Newman 2020-02-11 11:28:30 +00:00
parent 4daf43891a
commit ead761fe04
22 changed files with 133 additions and 0 deletions

View File

@ -11,6 +11,12 @@ internal class ISteamApps : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamApps(); public override IntPtr GetInterfacePointer() => GetApi.SteamApps();
internal ISteamApps()
{
SetupInterface();
}
#region FunctionMeta #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_BIsSubscribed")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_BIsSubscribed")]
[return: MarshalAs( UnmanagedType.I1 )] [return: MarshalAs( UnmanagedType.I1 )]

View File

@ -11,6 +11,12 @@ internal class ISteamFriends : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamFriends(); public override IntPtr GetInterfacePointer() => GetApi.SteamFriends();
internal ISteamFriends()
{
SetupInterface();
}
#region FunctionMeta #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetPersonaName")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetPersonaName")]
private static extern Utf8StringPointer _GetPersonaName( IntPtr self ); private static extern Utf8StringPointer _GetPersonaName( IntPtr self );

View File

@ -11,6 +11,12 @@ internal class ISteamGameServer : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamGameServer(); public override IntPtr GetInterfacePointer() => GetApi.SteamGameServer();
internal ISteamGameServer()
{
SetupInterface();
}
#region FunctionMeta #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_InitGameServer")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_InitGameServer")]
[return: MarshalAs( UnmanagedType.I1 )] [return: MarshalAs( UnmanagedType.I1 )]

View File

@ -11,6 +11,12 @@ internal class ISteamGameServerStats : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamGameServerStats(); public override IntPtr GetInterfacePointer() => GetApi.SteamGameServerStats();
internal ISteamGameServerStats()
{
SetupInterface();
}
#region FunctionMeta #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_RequestUserStats")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_RequestUserStats")]
private static extern SteamAPICall_t _RequestUserStats( IntPtr self, SteamId steamIDUser ); private static extern SteamAPICall_t _RequestUserStats( IntPtr self, SteamId steamIDUser );

View File

@ -11,6 +11,12 @@ internal class ISteamInput : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamInput(); public override IntPtr GetInterfacePointer() => GetApi.SteamInput();
internal ISteamInput()
{
SetupInterface();
}
#region FunctionMeta #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_Init")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_Init")]
[return: MarshalAs( UnmanagedType.I1 )] [return: MarshalAs( UnmanagedType.I1 )]

View File

@ -11,6 +11,12 @@ internal class ISteamInventory : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamInventory(); public override IntPtr GetInterfacePointer() => GetApi.SteamInventory();
internal ISteamInventory()
{
SetupInterface();
}
#region FunctionMeta #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetResultStatus")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetResultStatus")]
private static extern Result _GetResultStatus( IntPtr self, SteamInventoryResult_t resultHandle ); private static extern Result _GetResultStatus( IntPtr self, SteamInventoryResult_t resultHandle );

View File

@ -11,6 +11,12 @@ internal class ISteamMatchmaking : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamMatchmaking(); public override IntPtr GetInterfacePointer() => GetApi.SteamMatchmaking();
internal ISteamMatchmaking()
{
SetupInterface();
}
#region FunctionMeta #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetFavoriteGameCount")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetFavoriteGameCount")]
private static extern int _GetFavoriteGameCount( IntPtr self ); private static extern int _GetFavoriteGameCount( IntPtr self );

View File

@ -11,6 +11,12 @@ internal class ISteamMatchmakingServers : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamMatchmakingServers(); public override IntPtr GetInterfacePointer() => GetApi.SteamMatchmakingServers();
internal ISteamMatchmakingServers()
{
SetupInterface();
}
#region FunctionMeta #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_RequestInternetServerList")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_RequestInternetServerList")]
private static extern HServerListRequest _RequestInternetServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); private static extern HServerListRequest _RequestInternetServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse );

View File

@ -11,6 +11,12 @@ internal class ISteamMusic : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamMusic(); public override IntPtr GetInterfacePointer() => GetApi.SteamMusic();
internal ISteamMusic()
{
SetupInterface();
}
#region FunctionMeta #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusic_BIsEnabled")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusic_BIsEnabled")]
[return: MarshalAs( UnmanagedType.I1 )] [return: MarshalAs( UnmanagedType.I1 )]

View File

@ -11,6 +11,12 @@ internal class ISteamNetworking : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamNetworking(); public override IntPtr GetInterfacePointer() => GetApi.SteamNetworking();
internal ISteamNetworking()
{
SetupInterface();
}
#region FunctionMeta #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_SendP2PPacket")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_SendP2PPacket")]
[return: MarshalAs( UnmanagedType.I1 )] [return: MarshalAs( UnmanagedType.I1 )]

View File

@ -11,5 +11,11 @@ internal class ISteamNetworkingSockets : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamNetworkingSockets(); public override IntPtr GetInterfacePointer() => GetApi.SteamNetworkingSockets();
internal ISteamNetworkingSockets()
{
SetupInterface();
}
} }
} }

View File

@ -11,5 +11,11 @@ internal class ISteamNetworkingUtils : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamNetworkingUtils(); public override IntPtr GetInterfacePointer() => GetApi.SteamNetworkingUtils();
internal ISteamNetworkingUtils()
{
SetupInterface();
}
} }
} }

View File

@ -11,6 +11,12 @@ internal class ISteamParentalSettings : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamParentalSettings(); public override IntPtr GetInterfacePointer() => GetApi.SteamParentalSettings();
internal ISteamParentalSettings()
{
SetupInterface();
}
#region FunctionMeta #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParentalSettings_BIsParentalLockEnabled")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParentalSettings_BIsParentalLockEnabled")]
[return: MarshalAs( UnmanagedType.I1 )] [return: MarshalAs( UnmanagedType.I1 )]

View File

@ -11,6 +11,12 @@ internal class ISteamParties : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamParties(); public override IntPtr GetInterfacePointer() => GetApi.SteamParties();
internal ISteamParties()
{
SetupInterface();
}
#region FunctionMeta #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_GetNumActiveBeacons")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_GetNumActiveBeacons")]
private static extern uint _GetNumActiveBeacons( IntPtr self ); private static extern uint _GetNumActiveBeacons( IntPtr self );

View File

@ -11,6 +11,12 @@ internal class ISteamRemoteStorage : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamRemoteStorage(); public override IntPtr GetInterfacePointer() => GetApi.SteamRemoteStorage();
internal ISteamRemoteStorage()
{
SetupInterface();
}
#region FunctionMeta #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWrite")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWrite")]
[return: MarshalAs( UnmanagedType.I1 )] [return: MarshalAs( UnmanagedType.I1 )]

View File

@ -11,6 +11,12 @@ internal class ISteamScreenshots : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamScreenshots(); public override IntPtr GetInterfacePointer() => GetApi.SteamScreenshots();
internal ISteamScreenshots()
{
SetupInterface();
}
#region FunctionMeta #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamScreenshots_WriteScreenshot")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamScreenshots_WriteScreenshot")]
private static extern ScreenshotHandle _WriteScreenshot( IntPtr self, IntPtr pubRGB, uint cubRGB, int nWidth, int nHeight ); private static extern ScreenshotHandle _WriteScreenshot( IntPtr self, IntPtr pubRGB, uint cubRGB, int nWidth, int nHeight );

View File

@ -11,6 +11,12 @@ internal class ISteamUGC : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamUGC(); public override IntPtr GetInterfacePointer() => GetApi.SteamUGC();
internal ISteamUGC()
{
SetupInterface();
}
#region FunctionMeta #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_CreateQueryUserUGCRequest")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_CreateQueryUserUGCRequest")]
private static extern UGCQueryHandle_t _CreateQueryUserUGCRequest( IntPtr self, AccountID_t unAccountID, UserUGCList eListType, UgcType eMatchingUGCType, UserUGCListSortOrder eSortOrder, AppId nCreatorAppID, AppId nConsumerAppID, uint unPage ); private static extern UGCQueryHandle_t _CreateQueryUserUGCRequest( IntPtr self, AccountID_t unAccountID, UserUGCList eListType, UgcType eMatchingUGCType, UserUGCListSortOrder eSortOrder, AppId nCreatorAppID, AppId nConsumerAppID, uint unPage );

View File

@ -11,6 +11,12 @@ internal class ISteamUser : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamUser(); public override IntPtr GetInterfacePointer() => GetApi.SteamUser();
internal ISteamUser()
{
SetupInterface();
}
#region FunctionMeta #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetHSteamUser")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetHSteamUser")]
private static extern HSteamUser _GetHSteamUser( IntPtr self ); private static extern HSteamUser _GetHSteamUser( IntPtr self );

View File

@ -11,6 +11,12 @@ internal class ISteamUserStats : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamUserStats(); public override IntPtr GetInterfacePointer() => GetApi.SteamUserStats();
internal ISteamUserStats()
{
SetupInterface();
}
#region FunctionMeta #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_RequestCurrentStats")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_RequestCurrentStats")]
[return: MarshalAs( UnmanagedType.I1 )] [return: MarshalAs( UnmanagedType.I1 )]

View File

@ -11,6 +11,12 @@ internal class ISteamUtils : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamUtils(); public override IntPtr GetInterfacePointer() => GetApi.SteamUtils();
internal ISteamUtils()
{
SetupInterface();
}
#region FunctionMeta #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetSecondsSinceAppActive")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetSecondsSinceAppActive")]
private static extern uint _GetSecondsSinceAppActive( IntPtr self ); private static extern uint _GetSecondsSinceAppActive( IntPtr self );

View File

@ -11,6 +11,12 @@ internal class ISteamVideo : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamVideo(); public override IntPtr GetInterfacePointer() => GetApi.SteamVideo();
internal ISteamVideo()
{
SetupInterface();
}
#region FunctionMeta #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamVideo_GetVideoURL")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamVideo_GetVideoURL")]
private static extern void _GetVideoURL( IntPtr self, AppId unVideoAppID ); private static extern void _GetVideoURL( IntPtr self, AppId unVideoAppID );

View File

@ -27,6 +27,13 @@ public void GenerateVTableClass( string className, string filename )
{ {
WriteLine( $"public override IntPtr GetInterfacePointer() => GetApi.{className.Substring( 1 )}();" ); WriteLine( $"public override IntPtr GetInterfacePointer() => GetApi.{className.Substring( 1 )}();" );
WriteLine(); WriteLine();
WriteLine();
StartBlock( $"internal {className}()" );
{
WriteLine( $"SetupInterface();" );
}
EndBlock();
WriteLine();
var functions = def.methods.Where( x => x.ClassName == className ); var functions = def.methods.Where( x => x.ClassName == className );