DxSetTestMode

From Multi Theft Auto: Wiki
Revision as of 16:32, 2 February 2014 by Myonlake (talk | contribs) (No need to ego over a few lines of code, in fact, the code doesn't make sense)
Jump to navigation Jump to search

This function is used for testing scripts written using guiCreateFont, dxCreateFont, dxCreateShader and dxCreateRenderTarget.

Each one of the 3 test modes should be used in turn to help highlight any potential problems.

Syntax

bool dxSetTestMode ( string testMode )

Required Arguments

  • testMode : The test mode to be set. It can be one of the following values:
    • none : Test mode disabled
    • no_mem: Simulate no free video memory available for MTA.
    • low_mem: Simulate little free video memory available for MTA.
    • no_shader: Simulate shaders failing validation.

Returns

Returns true if the test mode was successfully set, false otherwise.

Example

Use /setmode [param] to set the test mode.

local testValues = {
	["none"] = true,
	["no_mem"] = true,
	["low_mem"] = true,
	["no_shader"] = true
}

function testmode( cmd, value )
	if testValues[value] then
		dxSetTestMode( value )
	end
end
addCommandHandler( "setmode", testmode )

</section>

See Also