texture_global_scale

Used to control the scaling of the texture pages on load from the WAD file.

Syntax:

texture_global_scale(pow2integer);


Argument Description
pow2integer The scale factor to use (1, no scale, 2, half scale, 4, quarter scale, etc...)


Returns: N/A


Description

This function allows you to control the scaling of the texture pages on load from the WAD file that is part of your final game executable. The input value must be a power of two value and will work such that:

In this way you can better control texture page memory usage on platforms with low memory issues, although note that for Windows, you will need to have checked the Create Textures On Demand option in the Global Game Settings - Graphics and then call the function draw_texture_flush before loading any scaled textures.


Example:

draw_texture_flush();
texture_global_scale(2);
sprite_prefetch(spr_Trees);

The above code will flush all textures from memory, then set the texture scaling to 2 (so texture pages are half size) and then finally pre-fetch the texture page that the sprite "spr_Trees" is contained within.


Back: Drawing
Next: draw_texture_flush
© Copyright YoYo Games Ltd. 2018 All Rights Reserved