EngineStreamingSetBufferSize: Difference between revisions
Jump to navigation
Jump to search
(Created page with "__NOTOC__ {{Client function}} {{New feature/item|3.0160|1.6.0|21874|Get the streaming buffer size. The larger it is, the more models can be loaded in one go BUT increases the RAM ['''not''' streaming memory!] usage. Can help with custom IMG loading speed by reducing pop-in.}} {{Important Note|'''This function is meant for advanced users only, as it can lead to stability issues'''. Using a very high value might result in more crashes, while using a value too low might le...") |
Fernando187 (talk | contribs) (Remove obsolete Requirements section) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Client function}} | {{Client function}} | ||
{{New feature/item|3.0160|1.6.0|21874| | {{New feature/item|3.0160|1.6.0|21874|Set the streaming buffer size. The larger it is, the more models can be loaded in one go BUT increases the RAM ['''not''' streaming memory!] usage. Can help with custom IMG loading speed by reducing pop-in.}} | ||
{{Important Note|'''This function is meant for advanced users only, as it can lead to stability issues'''. Using a very high value might result in more crashes, while using a value too low might lead to frequent pop-in!}} | {{Important Note|'''This function is meant for advanced users only, as it can lead to stability issues'''. Using a very high value might result in more crashes, while using a value too low might lead to frequent pop-in!}} | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool engineStreamingSetBufferSize( | bool engineStreamingSetBufferSize( int sizeBytes ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[EngineStreaming]]:setBufferSize|bufferSize|engineStreamingGetBufferSize}} | {{OOP||[[EngineStreaming]]:setBufferSize|bufferSize|engineStreamingGetBufferSize}} | ||
Line 30: | Line 30: | ||
end, false, false) | end, false, false) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Engine functions}} | {{Engine functions}} |
Latest revision as of 17:33, 7 November 2024
Set the streaming buffer size. The larger it is, the more models can be loaded in one go BUT increases the RAM [not streaming memory!] usage. Can help with custom IMG loading speed by reducing pop-in.
Important Note: This function is meant for advanced users only, as it can lead to stability issues. Using a very high value might result in more crashes, while using a value too low might lead to frequent pop-in! |
Syntax
bool engineStreamingSetBufferSize( int sizeBytes )
OOP Syntax Help! I don't understand this!
- Method: EngineStreaming:setBufferSize(...)
- Variable: .bufferSize
- Counterpart: engineStreamingGetBufferSize
Required Arguments
- sizeBytes : The streaming buffer size. Must be a positive non-zero number.
Returns
True if there was enough memory to allocate the buffer, false otherwise.
Example
This example adds a command that can be used to change the streaming buffer size, and display the previous value.
addCommandHandler("sbs", function(_, sizeMB) if tonumber(sizeMB) then if engineStreamingSetBufferSize(tonumber(sizeMB) * 1024 * 1024) then -- Convert MB to Bytes outputChatbox("The streaming buffer size has been changed from " .. math.floor(engineStreamingGetBufferSize() / 1024 / 1024) .. " MB to " .. sizeMB .. " MB") else outputChatbox("Not enough memory!") end else outputChatbox("Please enter a numeric value!") end end, false, false)
See Also
- engineAddImage
- engineApplyShaderToWorldTexture
- engineFreeModel
- engineGetModelFlags
- engineGetModelIDFromName
- engineGetModelLODDistance
- engineGetModelNameFromID
- engineGetModelPhysicalPropertiesGroup
- engineGetModelTextureNames
- engineGetModelTextures
- engineGetModelTXDID
- engineGetModelVisibleTime
- engineGetObjectGroupPhysicalProperty
- engineGetSurfaceProperties
- engineGetVisibleTextureNames
- engineImageGetFilesCount
- engineImageGetFiles
- engineImageGetFile
- engineImageLinkDFF
- engineImageLinkTXD
- engineImportTXD
- engineLoadCOL
- engineLoadDFF
- engineLoadIMG
- engineLoadIFP
- engineLoadTXD
- engineRemoveImage
- engineRemoveShaderFromWorldTexture
- engineReplaceAnimation
- engineReplaceCOL
- engineReplaceModel
- engineRequestModel
- engineResetModelFlags
- engineResetModelLODDistance
- engineResetSurfaceProperties
- engineRestoreAnimation
- engineRestoreCOL
- engineRestoreDFFImage
- engineRestoreModel
- engineRestoreModelPhysicalPropertiesGroup
- engineRestoreObjectGroupPhysicalProperties
- engineRestoreTXDImage
- engineRestreamWorld
- engineSetAsynchronousLoading
- engineSetModelFlag
- engineSetModelFlags
- engineSetModelLODDistance
- engineSetModelPhysicalPropertiesGroup
- engineSetModelVisibleTime
- engineSetObjectGroupPhysicalProperty
- engineSetSurfaceProperties
- engineStreamingFreeUpMemory
- engineStreamingGetUsedMemory