MTA:Eir/functions/engineGetStreamingInfo

From Multi Theft Auto: Wiki
Jump to navigation Jump to search

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 [-]
Client

This 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
);