DarkBASIC Professional Help File

DX11 CREATE IMAGE

Creates a blank image of the provided dimensions and format. You can optionally provide an initial colour to fill the image with
as well as whether to generate mip maps for your created image or not.
Note that you have to either set none of the initial colours (which will default to a completely transparent, black image) or all of them.

Syntax

    Return Dword = DX11 CREATE IMAGE(width, height, [format], [generateMipMaps], [red], [green], [blue], [alpha], [accessMode])

Parameters

    width

> Dword
> The width of the image in pixels.

    height

> Dword
> The height of the image in pixels.

    [Optional] format

> Dword
> The format of the created image. Corresponds directly to the DXGI_FORMAT enumeration that you can find on MSDN. Defaults to B8G8R8A8 which is the default used by DBPro as well.

    [Optional] generateMipMaps

> Boolean
> Set to true to generate mip maps. Defaults to false if omitted.

    [Optional] red

> Float
> The red component to fill the image with.

    [Optional] green

> Float
> The green component to fill the image with.

    [Optional] blue

> Float
> The blue component to fill the image with.

    [Optional] alpha

> Float
> The alpha component to fill the image with.

    [Optional] accessMode

> Dword
> Set to one of the ACCESSMODE_XXX constants. ACCESSMODE_DIRECT_CPUWRITABLE allows faster editing of the image from the CPU (but slower read times by the GPU), ACCESSMODE_GPUWRITABLE is needed to create an image that can be used as a read/write resource in a shader.

Returns

The created image.

See also

IMAGE Functions Menu
DX11 Function Categories