MTA:Eir/functions/engineGetStreamingInfo: Difference between revisions
Jump to navigation
Jump to search
(Created page with "__NOTOC__ This function returns a dictionary which is a snapshot of the current GTA:SA Streaming System status. Since the streaming status changes ...") |
(Renamed template) |
||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
{{MTA:Eir/Client_function}} | |||
__NOTOC__ | __NOTOC__ | ||
This function returns a dictionary which is a snapshot of the current [[GTA:SA_Resource_Streaming|GTA:SA Streaming System status]]. Since the streaming status changes rapidly every frame, it is recommended to draw it on the screen. | This function returns a dictionary which is a snapshot of the current [[GTA:SA_Resource_Streaming|GTA:SA Streaming System status]]. Since the streaming status changes rapidly every frame, it is recommended to draw it on the screen. | ||
| Line 17: | Line 18: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
table | table engineGetStreamingInfo () | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===Returns=== | ===Returns=== | ||
Returns a ''' | Returns a '''dictionary''' holding the Streaming system status. | ||
==Example== | ==Example== | ||
Latest revision as of 08:10, 28 September 2023
This function returns a dictionary which is a snapshot of the current GTA:SA Streaming System status. Since the streaming status changes rapidly every frame, it is recommended to draw it on the screen.
{
usedMemory = 40985576,
maxMemory = 533725184,
numberOfRequests = 0,
numberOfPriorityRequests = 0,
numberOfSlicers = 2,
numberOfRequestsPerSlicer = 16,
activeStreamingThread = 0,
isBusy = false,
isLoadingBigModel = false
}
Syntax
table engineGetStreamingInfo ()
Returns
Returns a dictionary holding the Streaming system status.
Example
Click to collapse [-]
ClientThis snippet draws the engine streaming information on the screen.
local streamingEntryNames =
{
"usedMemory", "maxMemory", "numberOfRequests",
"numberOfPriorityRequests", "numberOfSlicers",
"numberOfRequestsPerSlicer", "activeStreamingThread",
"isBusy", "isLoadingBigModel"
};
local screenWidth, screenHeight = guiGetScreenSize();
addEventHandler( "onClientRender", root,
function()
local streamingInfo = engineGetStreamingInfo();
local x, y = screenWidth - 200, 300;
for m,n in ipairs(streamingEntryNames) do
local entry = streamingInfo[n];
if not ( entry == nil ) then
dxDrawText( n .. ": " .. tostring( entry ), x, y );
end
y = y + 20;
end
end
);