From f0b7cd14712d1a62e63056351eb377c82fdd8f2a Mon Sep 17 00:00:00 2001 From: Michael Dirks Date: Tue, 23 Feb 2016 23:39:40 +0100 Subject: [PATCH] * Update to Steamworks 1.36 - SteamClient and SteamController changes implemented. * Add Examples for SteamAPI, SteamAppList, SteamApps and SteamController. * Update SteamHTMLSurface example. * Update Project file to automatically add & copy resources after successful build. --- Blitz/BlitzSteam.decls | 17 +- Blitz/Examples/SteamAPI_Example.bb | 66 +++++++ Blitz/Examples/SteamAppList_Example.bb | 128 +++++++++++++ Blitz/Examples/SteamApps_Example.bb | 179 ++++++++++++++++++ Blitz/Examples/SteamController_Example.bb | 68 +++++++ .../SteamHTMLSurface_Example.bb} | 4 +- Blitz/Examples/steam_appid.txt | 1 + Blitz/steam_appid.txt | 1 - BlitzSteam.vcxproj | 40 ++-- BlitzSteam.vcxproj.filters | 70 +++---- Wrapper/SteamClient.cpp | 20 -- Wrapper/SteamController.cpp | 17 +- 12 files changed, 510 insertions(+), 101 deletions(-) create mode 100644 Blitz/Examples/SteamAPI_Example.bb create mode 100644 Blitz/Examples/SteamAppList_Example.bb create mode 100644 Blitz/Examples/SteamApps_Example.bb create mode 100644 Blitz/Examples/SteamController_Example.bb rename Blitz/{HTMLSurface_Example.bb => Examples/SteamHTMLSurface_Example.bb} (99%) create mode 100644 Blitz/Examples/steam_appid.txt delete mode 100644 Blitz/steam_appid.txt diff --git a/Blitz/BlitzSteam.decls b/Blitz/BlitzSteam.decls index fd01df8..023129f 100644 --- a/Blitz/BlitzSteam.decls +++ b/Blitz/BlitzSteam.decls @@ -35,8 +35,8 @@ BS_AppList%() BS_AppList_GetNumInstalledApps%(lpSteamAppList%) BS_AppList_GetInstalledApps%(lpSteamAppList%, pvecAppID*, unMaxIDs%) BS_AppList_GetInstalledAppsEx%(lpSteamAppList%, pvecAppID%, unMaxIDs%) : "BS_AppList_GetInstalledApps" -BS_AppList_GetAppNameEx%(lpSteamAppList%, nAppId%, pchName%, cchNameMax%) : "BS_AppList_GetAppName" -BS_AppList_GetAppName%(lpSteamAppList%, nAppId%, pchName*, cchNameMax%) +BS_AppList_GetAppName%(lpSteamAppList%, nAppId%, pchNameBuffer*, cchNameMax%) +BS_AppList_GetAppNameEx%(lpSteamAppList%, nAppId%, pchNameBuffer%, cchNameMax%) : "BS_AppList_GetAppName" BS_AppList_GetAppInstallDir%(lpSteamAppList%, nAppId%, pchDirectoryBuffer*, cchDirectoryMax%) BS_AppList_GetAppInstallDirEx%(lpSteamAppList%, nAppId%, pchDirectoryBuffer%, cchDirectoryMax%) : "BS_AppList_GetAppInstallDir" BS_AppList_GetAppBuildId%(lpSteamAppList%, nAppId%) @@ -81,7 +81,6 @@ BS_Client_ConnectToGlobalUser%(lpSteamClient%, hSteamPipe%) BS_Client_SetLocalIPBinding(lpSteamClient, unIP%, usPort%) BS_Client_CreateLocalUser%(lpSteamClient%, phSteamPipe%, eAccountType%) BS_Client_ReleaseUser(lpSteamClient%, hSteamPipe%, hSteamUser%) -BS_Client_RunFrame(lpSteamClient%) BS_Client_GetIPCCallCount%(lpSteamClient%) BS_Client_ShutdownIfAllPipesClosed%(lpSteamClient%) BS_Client_GetSteamAppList%(lpSteamClient%, hSteamUser%, hSteamPipe%, pchVersion$) @@ -107,19 +106,16 @@ BS_Client_GetSteamUserStats%(lpSteamClient%, hSteamUser%, hSteamPipe%, pchVersio BS_Client_GetSteamUtils%(lpSteamClient%, hSteamPipe%, pchVersion$) BS_Client_GetSteamVideo%(lpSteamClient%, hSteamUser%, hSteamPipe%, pchVersion$) BS_Client_SetWarningMessageHook(lpSteamClient%, fpFunction%) -BS_Client_Set_SteamAPI_CPostAPIResultInProcess(lpSteamClient%, fpFunction%) -BS_Client_Remove_SteamAPI_CPostAPIResultInProcess(lpSteamClient%, fpFunction%) -BS_Client_Set_SteamAPI_CCheckCallbackRegisteredInProcess(lpSteamClient%, fpFunction%) ; Controller ------------------------------------------------------------------ BS_Controller%() BS_Controller_Init%(lpSteamController%, pchAbsolutePathToControllerConfigVDF$) BS_Controller_Shutdown%(lpSteamController%) BS_Controller_RunFrame(lpSteamController%) -BS_Controller_GetConnectedControllersEx%(lpSteamController%, pHandlesOut*) -BS_Controller_GetConnectedControllersExEx%(lpSteamController%, pHandlesOut%) : "BS_Controller_GetConnectedControllersEx" -BS_Controller_GetConnectedControllers%(lpSteamController%) -BS_Controller_GetConnectedControllers_Index%(index%) +BS_Controller_GetConnectedControllers%(lpSteamController%, pHandlesOut*) +BS_Controller_GetConnectedControllersEx%(lpSteamController%, pHandlesOut%) : "BS_Controller_GetConnectedControllersEx" +BS_Controller_GetConnectedControllersSimple%(lpSteamController%) +BS_Controller_GetConnectedControllersSimple_Index%(index%) BS_Controller_ShowBindingPanel%(lpSteamController%, pControllerHandle%) BS_Controller_GetActionSetHandle%(lpSteamController%, pszActionSetName$) ;! Function above returns a ControllerActionSetHandle_t*, clean it up afterwards! @@ -140,6 +136,7 @@ BS_Controller_GetAnalogActionOrigins%(lpSteamController%, pControllerHandle%, pA BS_Controller_GetAnalogActionOriginsEx%(lpSteamController%, pControllerHandle%, pActionSetHandle%, pAnalogActionHandle%, pEControllerActionOrigin*) : "BS_Controller_GetAnalogActionOrigins" BS_Controller_StopAnalogActionMomentum(lpSteamController%, pControllerHandle%, pAnalogActionHandle%) BS_Controller_TriggerHapticPulse(lpSteamController%, pControllerHandle%, ESteamControllerPad%, usDurationMicroSec%) +BS_Controller_TriggerRepeatedHapticPulse(lpSteamController%, pControllerHandle%, ESteamControllerPad%, usDurationMicroSec%, osOffMicroSec%, unRepeat%, nFlags%) ; Friends --------------------------------------------------------------------- BS_Friends%() diff --git a/Blitz/Examples/SteamAPI_Example.bb b/Blitz/Examples/SteamAPI_Example.bb new file mode 100644 index 0000000..accdebb --- /dev/null +++ b/Blitz/Examples/SteamAPI_Example.bb @@ -0,0 +1,66 @@ +; BlitzSteam - Steam wrapper for Blitz +; Copyright (C) 2015 Xaymar (Michael Fabian Dirks) +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU Lesser General Public License as +; published by the Free Software Foundation, either version 3 of the +; License, or (at your option) any later version. +; +; This program is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU Lesser General Public License +; along with this program. If not, see . + +Include "../BlitzSteam.bb" + +; Initialize Steam before your next call to Graphics. +If BS_Steam_Init() = False Then + RuntimeError "Steam: Failed to initialize!" +EndIf + +Const FPS = 30 +Const FPS_MULT# = 1.0 / FPS + +; Demo Scene +Graphics3D 1024, 768, 32, 2 +SetBuffer BackBuffer() + +Local tickTimer = CreateTimer(FPS) + +Local demoRoot = CreatePivot() + +Local demoCameraRoot = CreatePivot(demoRoot) +Local demoCamera = CreateCamera(demoCameraRoot) +MoveEntity demoCamera, 0, 0, -10 + +Local demoCube = CreateCube(demoRoot) + +Local EndGame = False +Repeat + Cls + + ;! Update + ; End on Escape + EndGame = KeyHit(1) + + TurnEntity demoCube, 1 * FPS_MULT, 3 * FPS_MULT, 2.332 * FPS_MULT + + ;! Render 3D + RenderWorld + + ;! Render 2D + Text 0, 0, "Escape to Quit" + + ;! Update Window + Flip 0 + WaitTimer(demoTimer) +Until EndGame = True + +; Shut down Steam as the last action of your program. +BS_Steam_Shutdown() +End +;~IDEal Editor Parameters: +;~C#Blitz3D \ No newline at end of file diff --git a/Blitz/Examples/SteamAppList_Example.bb b/Blitz/Examples/SteamAppList_Example.bb new file mode 100644 index 0000000..6c4ce66 --- /dev/null +++ b/Blitz/Examples/SteamAppList_Example.bb @@ -0,0 +1,128 @@ +; BlitzSteam - Steam wrapper for Blitz +; Copyright (C) 2015 Xaymar (Michael Fabian Dirks) +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU Lesser General Public License as +; published by the Free Software Foundation, either version 3 of the +; License, or (at your option) any later version. +; +; This program is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU Lesser General Public License +; along with this program. If not, see . + +Include "../BlitzSteam.bb" + +; Initialize Steam before your next call to Graphics. +If BS_Steam_Init() = False Then + RuntimeError "Steam: Failed to initialize!" +EndIf + +Const FPS = 30 +Const FPS_MULT# = 1.0 / FPS + +; Demo Scene +Graphics3D 1024, 768, 32, 2 +SetBuffer BackBuffer() + +Local demoTimer = CreateTimer(FPS) + +Local demoRoot = CreatePivot() + +Local demoCameraRoot = CreatePivot(demoRoot) +Local demoCamera = CreateCamera(demoCameraRoot) +MoveEntity demoCamera, 0, 0, -10 + +Local demoCube = CreateCube(demoRoot) + +; SteamAppList stuff +Type SteamAppList + Field AppId% + Field Name$ + Field InstallDir$ + Field BuildId% +End Type +Global SteamAppList_Count% + +Function SteamAppList_Fill() + SteamAppList_Count = BS_AppList_GetNumInstalledApps(BS_AppList()) + + Local Buffer = CreateBank(4 * SteamAppList_Count) + Local AppNameBuffer = CreateBank(1024) + Local PathBuffer = CreateBank(260) + + Local AppIdCount = BS_AppList_GetInstalledApps(BS_AppList(), Buffer, SteamAppList_Count) + Delete Each SteamAppList + For Index = 0 To AppIdCount - 1 + Local AppId = PeekInt(Buffer, Index*4) + + Local SAL.SteamAppList = New SteamAppList + SAL\AppId = AppId + Local AppNameLen = BS_AppList_GetAppName(BS_AppList(), AppId, AppNameBuffer, 1024) + SAL\Name = PeekCString(AppNameBuffer, 0, AppNameLen) + Local PathLen = BS_AppList_GetAppInstallDir(BS_AppList(), AppId, PathBuffer, 260) + SAL\InstallDir = PeekCString(PathBuffer, 0, PathLen) + SAL\BuildId = BS_AppList_GetAppBuildId(BS_AppList(), AppId) + Next + + FreeBank AppNameBuffer + FreeBank PathBuffer + FreeBank Buffer +End Function + +Function PeekCString$(Bank, Offset=0, Length=-1) + Local Out$ = "", Pos = Offset + While Abs(Length) > 0 + Length = Length - 1 + + Local by = PeekByte(Bank, Pos) + If by = 0 Then + Length = 0 + Else + Out = Out + Chr(by) + EndIf + + Pos = Pos + 1 + Wend + Return Out +End Function + +SteamAppList_Fill() + +; Main Loop +Local EndGame = False +Repeat + Cls + + ;! Update + ; End on Escape + EndGame = KeyHit(1) + + TurnEntity demoCube, 1 * FPS_MULT, 3 * FPS_MULT, 2.332 * FPS_MULT + + ;! Render 3D + RenderWorld + + ;! Render 2D + Text 0, 0, "Escape to Quit" + + Text 0,15, "Installed Apps: " + SteamAppList_Count + Local SAL.SteamAppList, Index = 0 + For SAL.SteamAppList = Each SteamAppList + Index = Index + 1 + Text 0, 30 + Index* 15, RSet(SAL\AppId, 6) + "/" + RSet(SAL\BuildId, 8) + ": " + SAL\Name + " (Installed: '" + SAL\InstallDir + "')" + Next + + ;! Update Window + Flip 0 + WaitTimer(demoTimer) +Until EndGame = True + +; Shut down Steam as the last action of your program. +BS_Steam_Shutdown() +End +;~IDEal Editor Parameters: +;~C#Blitz3D \ No newline at end of file diff --git a/Blitz/Examples/SteamApps_Example.bb b/Blitz/Examples/SteamApps_Example.bb new file mode 100644 index 0000000..8e8e9cc --- /dev/null +++ b/Blitz/Examples/SteamApps_Example.bb @@ -0,0 +1,179 @@ +; BlitzSteam - Steam wrapper for Blitz +; Copyright (C) 2015 Xaymar (Michael Fabian Dirks) +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU Lesser General Public License as +; published by the Free Software Foundation, either version 3 of the +; License, or (at your option) any later version. +; +; This program is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU Lesser General Public License +; along with this program. If not, see . + +Include "../BlitzSteam.bb" + +; Initialize Steam before your next call to Graphics. +If BS_Steam_Init() = False Then + RuntimeError "Steam: Failed to initialize!" +EndIf + +Const FPS = 30 +Const FPS_MULT# = 1.0 / FPS + +; Demo Scene +Graphics3D 1024, 768, 32, 2 +SetBuffer BackBuffer() + +Local demoTimer = CreateTimer(FPS) +Local demoRoot = CreatePivot() +Local demoCameraRoot = CreatePivot(demoRoot) +Local demoCamera = CreateCamera(demoCameraRoot) +MoveEntity demoCamera, 0, 0, -10 +Local demoCube = CreateCube(demoRoot) + +; SteamApps Stuff +Type SteamAppsDLC + Field Id% + Field Available% + Field Name$ +End Type +Global SteamAppsDLC_Count + +Function SteamAppsDLC_Fill() + Local IdBuffer = CreateBank(4) + Local AvailableBuffer = CreateBank(4) + Local NameBuffer = CreateBank(1024) + + SteamAppsDLC_Count = BS_Apps_GetDLCCount(BS_Apps()) + Delete Each SteamAppsDLC + For Index = 0 To SteamAppsDLC_Count - 1 + If BS_Apps_GetDLCDataByIndex(BS_Apps(), Index, IdBuffer, AvailableBuffer, NameBuffer, 1024) + Local SAD.SteamAppsDLC = New SteamAppsDLC + SAD\Id = PeekInt(IdBuffer, 0) + SAD\Available = PeekInt(AvailableBuffer, 0) + SAD\Name = PeekCString(NameBuffer, 0, 1024) + Else + SteamAppsDLC_Count = SteamAppsDLC_Count - 1 + EndIf + Next + + FreeBank NameBuffer + FreeBank AvailableBuffer + FreeBank IdBuffer +End Function + +Type SteamAppsDepots + Field DepotId +End Type +Global SteamAppsDepots_Count + +Function SteamAppsDepots_Fill() + Local DepotsBuffer + ; Exercise: Do this one yourself with the above Type. It's not that hard. +End Function + +Function PeekCString$(Bank, Offset=0, Length=-1) + Local Out$ = "", Pos = Offset + While Abs(Length) > 0 + Length = Length - 1 + + Local by = PeekByte(Bank, Pos) + If by = 0 Then + Length = 0 + Else + Out = Out + Chr(by) + EndIf + + Pos = Pos + 1 + Wend + Return Out +End Function + +Local BetaBuffer = CreateBank(1024) +BS_Apps_GetCurrentBetaName(BS_Apps(), BetaBuffer, 1024) +Local Beta$ = PeekCString(BetaBuffer, 0, 1024) +FreeBank BetaBuffer + +Local AppInstallDir$, AppInstallDirBuffer = CreateBank(260) +BS_Apps_GetAppInstallDir(BS_Apps(), 480, AppInstallDirBuffer, 260) +AppInstallDir = PeekCString(AppInstallDirBuffer, 0, 260) +FreeBank AppInstallDirBuffer + +Local llOwner = BS_Apps_GetAppOwner(BS_Apps()) +Local OwnerId$ = "[U:" + BS_CSteamID_GetAccountInstance(llOwner) + ":" + BS_CSteamID_GetAccountID(llOwner) + "] STEAM_" + (BS_CSteamID_GetEAccountType(llOwner) - 1) + ":" + (BS_CSteamID_GetEUniverse(llOwner) - 1) + ":" + (BS_CSteamID_GetAccountID(llOwner) / 2) +BS_CSteamID_Destroy llOwner + +; Main Loop +Local EndGame = False +Repeat + Cls + + ;! Update + ; End on Escape + EndGame = KeyHit(1) + + TurnEntity demoCube, 1 * FPS_MULT, 3 * FPS_MULT, 2.332 * FPS_MULT + + ;! Render 3D + RenderWorld + + ;! Render 2D + Text 0, 0, "Escape to Quit" + + Text 0, 30, "Is Subscribed? " + BS_Apps_IsSubscribed(BS_Apps()) + Text 0, 45, "Is Low Violence? " + BS_Apps_IsLowViolence(BS_Apps()) + Text 0, 60, "Is Cybercafe? " + BS_Apps_IsCybercafe(BS_Apps()) + Text 0, 75, "Is VAC Banned? " + BS_Apps_IsVACBanned(BS_Apps()) + Text 0, 90, "Current Game Language: " + BS_Apps_GetCurrentGameLanguage(BS_Apps()) + Text 0,105, "Available Game Languages: " + BS_Apps_GetAvailableGameLanguages(BS_Apps()) + Text 0,120, "Is Subscribed App (480)? " + BS_Apps_IsSubscribedApp(BS_Apps(), 480) + Text 0,135, "Is DLC (323180) Installed? " + BS_Apps_IsDlcInstalled(BS_Apps(), 323180) ; Portal 2 Soundtrack DLC + Text 0,150, "Earliest Purchase Unix Time (480): " + BS_Apps_GetEarliestPurchaseUnixTime(BS_Apps(), 480) + Text 0,165, "Is Subscribed from Free Weekend? " + BS_Apps_IsSubscribedFromFreeWeekend(BS_Apps()) + Text 0,180, "DLC Count: " + BS_Apps_GetDLCCount(BS_Apps()) + Text 0,195, "Current Beta Name: " + Beta + Text 0,210, "App Install Dir: " + AppInstallDir$ + Text 0,225, "Is App Installed (480): " + BS_Apps_IsAppInstalled(BS_Apps(), 480) + Text 0,240, "App Owner Id: " + OwnerId + Text 0,255, "App Built Id: " + BS_Apps_GetAppBuildId(BS_Apps()) + + ; BS_Apps_GetLanchQueryParam$(BS_Apps(), pchKey$) + ; // Returns the associated launch param if the game is run via steam://run///?param1=value1;param2=value2;param3=value3 etc. + ; // Parameter names starting with the character '@' are reserved for internal use and will always return and empty string. + ; // Parameter names starting with an underscore '_' are reserved for steam features -- they can be queried by the game, + ; // but it is advised that you not param names beginning with an underscore for your own features. + + ; BS_Apps_MarkContentCorrupt signals steam that game files are corrupt or missing. Forces a validation after quit and before next start. + + ; How To Use: BS_Apps_RequestProofOfPurchaseKey(BS_Apps(), nAppId) + ; // Request cd-key for yourself or owned DLC. If you are interested in this + ; // data then make sure you provide us with a list of valid keys to be distributed + ; // to users when they purchase the game, before the game ships. + ; // You'll receive an AppProofOfPurchaseKeyResponse_t callback when + ; // the key is available (which may be immediately). + ; Example (Spacewar) does not have CD-Keys. + + Text 512, 0, "DLCs: " + SteamAppsDLC_Count + Local Index = 0, SAD.SteamAppsDLC + For SAD = Each SteamAppsDLC + Text 512, 15 + Index * 15, SAD\Id + "(" + SAD\Available + "): " + SAD\Name + ; You could install DLCs from the app itself, BS_Apps_InstallDLC, BS_Apps_UninstallDLC + ; BS_Apps_GetDlcDownloadProgress allows you to check the progress, BlitzUtility's LongLong stuff is useful here. + + Index = Index + 1 + Next + + ;! Update Window + Flip 0 + WaitTimer(demoTimer) +Until EndGame = True + +; Shut down Steam as the last action of your program. +BS_Steam_Shutdown() +End +;~IDEal Editor Parameters: +;~C#Blitz3D \ No newline at end of file diff --git a/Blitz/Examples/SteamController_Example.bb b/Blitz/Examples/SteamController_Example.bb new file mode 100644 index 0000000..8341644 --- /dev/null +++ b/Blitz/Examples/SteamController_Example.bb @@ -0,0 +1,68 @@ +; BlitzSteam - Steam wrapper for Blitz +; Copyright (C) 2015 Xaymar (Michael Fabian Dirks) +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU Lesser General Public License as +; published by the Free Software Foundation, either version 3 of the +; License, or (at your option) any later version. +; +; This program is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU Lesser General Public License +; along with this program. If not, see . + +Include "../BlitzSteam.bb" + +;! Example is incomplete, I do not own a Steam Controller. + +; Initialize Steam before your next call to Graphics. +If BS_Steam_Init() = False Then + RuntimeError "Steam: Failed to initialize!" +EndIf + +Const FPS = 30 +Const FPS_MULT# = 1.0 / FPS + +; Demo Scene +Graphics3D 1024, 768, 32, 2 +SetBuffer BackBuffer() + +Local tickTimer = CreateTimer(FPS) + +Local demoRoot = CreatePivot() + +Local demoCameraRoot = CreatePivot(demoRoot) +Local demoCamera = CreateCamera(demoCameraRoot) +MoveEntity demoCamera, 0, 0, -10 + +Local demoCube = CreateCube(demoRoot) + +Local EndGame = False +Repeat + Cls + + ;! Update + ; End on Escape + EndGame = KeyHit(1) + + TurnEntity demoCube, 1 * FPS_MULT, 3 * FPS_MULT, 2.332 * FPS_MULT + + ;! Render 3D + RenderWorld + + ;! Render 2D + Text 0, 0, "Escape to Quit" + + ;! Update Window + Flip 0 + WaitTimer(demoTimer) +Until EndGame = True + +; Shut down Steam as the last action of your program. +BS_Steam_Shutdown() +End +;~IDEal Editor Parameters: +;~C#Blitz3D \ No newline at end of file diff --git a/Blitz/HTMLSurface_Example.bb b/Blitz/Examples/SteamHTMLSurface_Example.bb similarity index 99% rename from Blitz/HTMLSurface_Example.bb rename to Blitz/Examples/SteamHTMLSurface_Example.bb index 0ca704f..5102e5a 100644 --- a/Blitz/HTMLSurface_Example.bb +++ b/Blitz/Examples/SteamHTMLSurface_Example.bb @@ -1,4 +1,4 @@ -Include "BlitzSteam.bb" +Include "../BlitzSteam.bb" ;---------------------------------------------------------------- ;! Steam Stuff @@ -119,7 +119,6 @@ Function Browser_HTMLSurface_StartRequest(pvParam%) BS_HTMLSurface_AllowStartRequest BS_HTMLSurface(), PeekMemoryInt(pvParam), True End Function:Browser_HTMLSurface_StartRequest(0) - Function Browser_Create.Browser(Width%, Height, UserAgent$="BlitzSteam", UserCSS$="") DebugLog "[Browser::Create] Creating with UserAgent '"+UserAgent+"' and CSS '"+UserCSS+"'." @@ -264,5 +263,4 @@ EndGraphics End ;~IDEal Editor Parameters: -;~F#8#19#3C#50 ;~C#Blitz3D \ No newline at end of file diff --git a/Blitz/Examples/steam_appid.txt b/Blitz/Examples/steam_appid.txt new file mode 100644 index 0000000..7ad8022 --- /dev/null +++ b/Blitz/Examples/steam_appid.txt @@ -0,0 +1 @@ +480 \ No newline at end of file diff --git a/Blitz/steam_appid.txt b/Blitz/steam_appid.txt deleted file mode 100644 index 37f10e0..0000000 --- a/Blitz/steam_appid.txt +++ /dev/null @@ -1 +0,0 @@ -368720 \ No newline at end of file diff --git a/BlitzSteam.vcxproj b/BlitzSteam.vcxproj index 0a85d9c..5c21f67 100644 --- a/BlitzSteam.vcxproj +++ b/BlitzSteam.vcxproj @@ -191,32 +191,20 @@ - - - BlitzSteam.LICENSE - PreserveNewest - - - BlitzSteam.LICENSE.lesser - PreserveNewest - - - BlitzSteam.bb - PreserveNewest - - - BlitzSteamUtility.bb - PreserveNewest - - - BlitzSteam.decls - PreserveNewest - - - steam_api.dll - PreserveNewest - - + + + + + + + + + + diff --git a/BlitzSteam.vcxproj.filters b/BlitzSteam.vcxproj.filters index 6f33e01..ca50e07 100644 --- a/BlitzSteam.vcxproj.filters +++ b/BlitzSteam.vcxproj.filters @@ -8,16 +8,16 @@ {8f00e86e-e1bc-499e-8b2c-da93e9e8f287} - - {14616756-e67f-4b1c-ac90-776c00a0271d} - - - {3072c53c-2be5-4712-b853-1bc1438cdc6e} - bb;decls;ipf - {a6fc08f6-97d9-4a53-a803-34b985d9ae7c} + + {a799678b-8efc-42a0-97b2-f3a23da99e17} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {6cebc940-92bb-4a55-a125-ec97956636f2} + @@ -109,39 +109,39 @@ - - Source Files\Helpers - - - Source Files\Helpers - - Source Files - - - Source Files\Helpers - - - Source Files\Helpers + Header Files - Source Files\Helpers + Header Files\Helpers + + + Header Files\Helpers + + + Header Files\Helpers + + + Header Files\Helpers + + + Header Files\Helpers - - SteamworksSDK - - - Blitz Files - - - Blitz Files - - - - - Blitz Files - + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Wrapper/SteamClient.cpp b/Wrapper/SteamClient.cpp index 4e32518..732b7d1 100644 --- a/Wrapper/SteamClient.cpp +++ b/Wrapper/SteamClient.cpp @@ -51,11 +51,6 @@ DLL_FUNCTION(void) BS_Client_ReleaseUser(ISteamClient* lpSteamClient, HSteamPipe return lpSteamClient->ReleaseUser(hSteamPipe, hSteamUser); } -DLL_FUNCTION(void) BS_Client_RunFrame(ISteamClient* lpSteamClient) { -#pragma comment(linker, "/EXPORT:BS_Client_RunFrame=_BS_Client_RunFrame@4") - lpSteamClient->RunFrame(); -} - DLL_FUNCTION(uint32_t) BS_Client_GetIPCCallCount(ISteamClient* lpSteamClient) { #pragma comment(linker, "/EXPORT:BS_Client_GetIPCCallCount=_BS_Client_GetIPCCallCount@4") return lpSteamClient->GetIPCCallCount(); @@ -182,18 +177,3 @@ DLL_FUNCTION(void) BS_Client_SetWarningMessageHook(ISteamClient* lpSteamClient, #pragma comment(linker, "/EXPORT:BS_Client_SetWarningMessageHook=_BS_Client_SetWarningMessageHook@8") lpSteamClient->SetWarningMessageHook(fpfunction); } - -DLL_FUNCTION(void) BS_Client_Set_SteamAPI_CPostAPIResultInProcess(ISteamClient* lpSteamClient, SteamAPI_PostAPIResultInProcess_t fpFunction) { -#pragma comment(linker, "/EXPORT:BS_Client_Set_SteamAPI_CPostAPIResultInProcess=_BS_Client_Set_SteamAPI_CPostAPIResultInProcess@8") - lpSteamClient->Set_SteamAPI_CPostAPIResultInProcess(fpFunction); -} - -DLL_FUNCTION(void) BS_Client_Remove_SteamAPI_CPostAPIResultInProcess(ISteamClient* lpSteamClient, SteamAPI_PostAPIResultInProcess_t fpFunction) { -#pragma comment(linker, "/EXPORT:BS_Client_Remove_SteamAPI_CPostAPIResultInProcess=_BS_Client_Remove_SteamAPI_CPostAPIResultInProcess@8") - lpSteamClient->Remove_SteamAPI_CPostAPIResultInProcess(fpFunction); -} - -DLL_FUNCTION(void) BS_Client_Set_SteamAPI_CCheckCallbackRegisteredInProcess(ISteamClient* lpSteamClient, SteamAPI_CheckCallbackRegistered_t fpFunction) { -#pragma comment(linker, "/EXPORT:BS_Client_Set_SteamAPI_CCheckCallbackRegisteredInProcess=_BS_Client_Set_SteamAPI_CCheckCallbackRegisteredInProcess@8") - lpSteamClient->Set_SteamAPI_CCheckCallbackRegisteredInProcess(fpFunction); -} diff --git a/Wrapper/SteamController.cpp b/Wrapper/SteamController.cpp index 6d45c68..9cdaa3f 100644 --- a/Wrapper/SteamController.cpp +++ b/Wrapper/SteamController.cpp @@ -43,19 +43,19 @@ DLL_FUNCTION(void) BS_Controller_RunFrame(ISteamController* lpSteamController) { // Enumerate currently connected controllers // handlesOut should point to a STEAM_CONTROLLER_MAX_COUNT sized array of ControllerHandle_t handles // Returns the number of handles written to handlesOut -DLL_FUNCTION(uint32_t) BS_Controller_GetConnectedControllersEx(ISteamController* lpSteamController, ControllerHandle_t* pHandlesOut) { -#pragma comment(linker, "/EXPORT:BS_Controller_GetConnectedControllersEx=_BS_Controller_GetConnectedControllersEx@8") +DLL_FUNCTION(uint32_t) BS_Controller_GetConnectedControllers(ISteamController* lpSteamController, ControllerHandle_t* pHandlesOut) { +#pragma comment(linker, "/EXPORT:BS_Controller_GetConnectedControllers=_BS_Controller_GetConnectedControllers@8") return lpSteamController->GetConnectedControllers(pHandlesOut); } ControllerHandle_t* pControllerHandles = new ControllerHandle_t[STEAM_CONTROLLER_MAX_COUNT]; -DLL_FUNCTION(uint32_t) BS_Controller_GetConnectedControllers(ISteamController* lpSteamController) { -#pragma comment(linker, "/EXPORT:BS_Controller_GetConnectedControllers=_BS_Controller_GetConnectedControllers@4") +DLL_FUNCTION(uint32_t) BS_Controller_GetConnectedControllersSimple(ISteamController* lpSteamController) { +#pragma comment(linker, "/EXPORT:BS_Controller_GetConnectedControllersSimple=_BS_Controller_GetConnectedControllersSimple@4") return lpSteamController->GetConnectedControllers(pControllerHandles); } -DLL_FUNCTION(ControllerHandle_t*) BS_Controller_GetConnectedControllers_Index(uint32_t index) { -#pragma comment(linker, "/EXPORT:BS_Controller_GetConnectedControllers_Index=_BS_Controller_GetConnectedControllers_Index@4") +DLL_FUNCTION(ControllerHandle_t*) BS_Controller_GetConnectedControllersSimple_Index(uint32_t index) { +#pragma comment(linker, "/EXPORT:BS_Controller_GetConnectedControllersSimple_Index=_BS_Controller_GetConnectedControllersSimple_Index@4") if (index >= STEAM_CONTROLLER_MAX_COUNT) index = STEAM_CONTROLLER_MAX_COUNT - 1; return &(pControllerHandles[index]); @@ -136,4 +136,9 @@ DLL_FUNCTION(void) BS_Controller_StopAnalogActionMomentum(ISteamController* lpSt DLL_FUNCTION(void) BS_Controller_TriggerHapticPulse(ISteamController* lpSteamController, ControllerHandle_t* pControllerHandle, ESteamControllerPad eTargetPad, uint32_t usDurationMicroSec) { #pragma comment(linker, "/EXPORT:BS_Controller_TriggerHapticPulse=_BS_Controller_TriggerHapticPulse@16") lpSteamController->TriggerHapticPulse(*pControllerHandle, eTargetPad, (uint16_t)usDurationMicroSec); +} + +DLL_FUNCTION(void) BS_Controller_TriggerRepeatedHapticPulse(ISteamController* lpSteamController, ControllerHandle_t* pControllerHandle, ESteamControllerPad eTargetPad, uint32_t usDurationMicroSec, uint32_t usOffMicroSec, uint32_t unRepeat, uint32_t nFlags) { +#pragma comment(linker, "/EXPORT:BS_Controller_TriggerRepeatedHapticPulse=_BS_Controller_TriggerRepeatedHapticPulse@28") + lpSteamController->TriggerRepeatedHapticPulse(*pControllerHandle, eTargetPad, usDurationMicroSec, usOffMicroSec, unRepeat, nFlags); } \ No newline at end of file