Function _IrrSetTextureCreationFlag

au3Irr2

au3Irr2 Function Reference

_IrrSetTextureCreationFlag

Sets texture creation flags controlling how textures are handled when they are created.

#Include <au3Irrlicht2.au3>
_IrrSetTextureCreationFlag($i_Flag, $i_Value)

 

Parameters

$i_Value The following flags can be set;
$ETCF_ALWAYS_16_BIT - Forces the driver to always create 16 bit textures, independently of which format the file on disk has.
$ETCF_ALWAYS_32_BIT - Forces the driver to always create 32 bit textures, independently of which format the file on disk has.
$ETCF_OPTIMIZED_FOR_QUALITY - Lets the driver decide in which format the textures are created and tries to make the textures look as good as possible.
$ETCF_OPTIMIZED_FOR_SPEED - Lets the driver decide in which format the textures are created and tries to create them maximizing render speed.
$ETCF_CREATE_MIP_MAPS - Automatically creates mip map levels for the textures.
$ETCF_NO_ALPHA_CHANNEL - Discard any alpha layer and use non-alpha color format.
$i_Flag Turn Creation Flag Off or On ($IRR_OFF or $IRR_ON)

 

Return Value

Success: True
Failure: False

 

Remarks

None.

 

Related

None.

 

Example


#include <au3Irrlicht2.au3>
Global $hTexture, $aInfo

_IrrStart()

    ; Set the Texture creation flag to load textures in 16 bit without alpha (R5G6B5 format)
    _IrrSetTextureCreationFlag( BitOR($ETCF_ALWAYS_16_BIT, $ETCF_NO_ALPHA_CHANNEL), $IRR_ON )

    ; Load a texture
    $hTexture = _IrrGetTexture("./media/cross.bmp")

    ; query some info about the loaded texture, index 3 of the returned array is Color Reference
    $aInfo = _IrrGetTextureInformation($hTexture)

    ; show the color format in a string to see the Texture creation flag was set
    MsgBox(64, "Texture color format", _TextureFormatString($aInfo[3]))

_IrrStop()


Func _TextureFormatString($iValue)
    Local $sMsg
    Switch $iValue
        Case $ECF_R5G6B5
            $sMsg &= "R5G6B5 - 16 bit without alpha channel"
        Case $ECF_A1R5G5B5
            $sMsg &= "A1R5G5B5 - 16 bit with alpha channel"
        Case $ECF_R8G8B8
            $sMsg &= "R8G8B8 - 24 bit without alpha channel"
        Case $ECF_A8R8G8B8
            $sMsg &= "A8R8G8B8 - 32 bit with alpha channel"
        Case Else
            $sMsg &= "Unknown"
    EndSwitch
    Return $sMsg
EndFunc   ;==>_TextureFormatString