* 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.
This commit is contained in:
+7
-10
@@ -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%()
|
||||
|
||||
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
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
|
||||
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
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
|
||||
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
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/<appid>//?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
|
||||
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
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
|
||||
@@ -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
|
||||
@@ -0,0 +1 @@
|
||||
480
|
||||
@@ -1 +0,0 @@
|
||||
368720
|
||||
+14
-26
@@ -191,32 +191,20 @@
|
||||
<ClInclude Include="Helpers\Helper.h" />
|
||||
<ClInclude Include="Helpers\Memory.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="LICENSE">
|
||||
<Link>BlitzSteam.LICENSE</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="LICENSE.lesser">
|
||||
<Link>BlitzSteam.LICENSE.lesser</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Blitz\BlitzSteam.bb">
|
||||
<Link>BlitzSteam.bb</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Blitz\BlitzSteamUtility.bb">
|
||||
<Link>BlitzSteamUtility.bb</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Blitz\BlitzSteam.decls">
|
||||
<Link>BlitzSteam.decls</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="SteamworksSDK\redistributable_bin\steam_api.dll">
|
||||
<Link>steam_api.dll</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Target Name="CopyResources" AfterTargets="Build">
|
||||
<ItemGroup>
|
||||
<Resources Include="LICENSE" />
|
||||
<Resources Include="$(ProjectDir)\LICENSE.lesser" />
|
||||
<Resources Include="$(ProjectDir)\Blitz\*.*" />
|
||||
<Resources Include="$(ProjectDir)\Blitz\**\*.*" />
|
||||
<Resources Include="$(ProjectDir)\SteamworksSDK\redistributable_bin\steam_api.dll" />
|
||||
</ItemGroup>
|
||||
<Copy
|
||||
SourceFiles="@(Resources)"
|
||||
DestinationFiles="@(Resources->'$(TargetDir)%(RecursiveDir)\%(Filename)%(Extension)')"
|
||||
SkipUnchangedFiles="True"
|
||||
UseHardlinksIfPossible="True" />
|
||||
</Target>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
|
||||
+35
-35
@@ -8,16 +8,16 @@
|
||||
<Filter Include="Source Files\Wrapper">
|
||||
<UniqueIdentifier>{8f00e86e-e1bc-499e-8b2c-da93e9e8f287}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="SteamworksSDK">
|
||||
<UniqueIdentifier>{14616756-e67f-4b1c-ac90-776c00a0271d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Blitz Files">
|
||||
<UniqueIdentifier>{3072c53c-2be5-4712-b853-1bc1438cdc6e}</UniqueIdentifier>
|
||||
<Extensions>bb;decls;ipf</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\Helpers">
|
||||
<UniqueIdentifier>{a6fc08f6-97d9-4a53-a803-34b985d9ae7c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{a799678b-8efc-42a0-97b2-f3a23da99e17}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\Helpers">
|
||||
<UniqueIdentifier>{6cebc940-92bb-4a55-a125-ec97956636f2}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Wrapper\Steam.cpp">
|
||||
@@ -109,39 +109,39 @@
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Helpers\CSteamID.h">
|
||||
<Filter>Source Files\Helpers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Helpers\BlitzPointer.h">
|
||||
<Filter>Source Files\Helpers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BlitzSteam.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Helpers\Helper.h">
|
||||
<Filter>Source Files\Helpers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Helpers\Memory.h">
|
||||
<Filter>Source Files\Helpers</Filter>
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Helpers\BlitzCallback.h">
|
||||
<Filter>Source Files\Helpers</Filter>
|
||||
<Filter>Header Files\Helpers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Helpers\BlitzPointer.h">
|
||||
<Filter>Header Files\Helpers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Helpers\CSteamID.h">
|
||||
<Filter>Header Files\Helpers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Helpers\Helper.h">
|
||||
<Filter>Header Files\Helpers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Helpers\Memory.h">
|
||||
<Filter>Header Files\Helpers</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="SteamworksSDK\redistributable_bin\steam_api.dll">
|
||||
<Filter>SteamworksSDK</Filter>
|
||||
</None>
|
||||
<None Include="Blitz\BlitzSteam.bb">
|
||||
<Filter>Blitz Files</Filter>
|
||||
</None>
|
||||
<None Include="Blitz\BlitzSteamUtility.bb">
|
||||
<Filter>Blitz Files</Filter>
|
||||
</None>
|
||||
<None Include="LICENSE" />
|
||||
<None Include="LICENSE.lesser" />
|
||||
<None Include="Blitz\BlitzSteam.decls">
|
||||
<Filter>Blitz Files</Filter>
|
||||
</None>
|
||||
<None Include="$(ProjectDir)\Blitz\*.*" />
|
||||
<None Include="$(ProjectDir)\Blitz\*.*" />
|
||||
<None Include="$(ProjectDir)\Blitz\*.*" />
|
||||
<None Include="$(ProjectDir)\Blitz\*.*" />
|
||||
<None Include="$(ProjectDir)\Blitz\**\*.*" />
|
||||
<None Include="$(ProjectDir)\Blitz\**\*.*" />
|
||||
<None Include="$(ProjectDir)\Blitz\**\*.*" />
|
||||
<None Include="$(ProjectDir)\Blitz\**\*.*" />
|
||||
<None Include="$(ProjectDir)\Blitz\**\*.*" />
|
||||
<None Include="$(ProjectDir)\Blitz\**\*.*" />
|
||||
<None Include="$(ProjectDir)\Blitz\**\*.*" />
|
||||
<None Include="$(ProjectDir)\Blitz\**\*.*" />
|
||||
<None Include="$(ProjectDir)\Blitz\**\*.*" />
|
||||
<None Include="$(ProjectDir)\Blitz\**\*.*" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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]);
|
||||
@@ -137,3 +137,8 @@ DLL_FUNCTION(void) BS_Controller_TriggerHapticPulse(ISteamController* lpSteamCon
|
||||
#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);
|
||||
}
|
||||
Reference in New Issue
Block a user