Microsoft DirectX 8.1 (Visual Basic)

Direct3DDevice8.SetPaletteEntries

Sets palette entries.

object.SetPaletteEntries( _ 
    PaletteNumber As Long, _ 
    ArrayOfEntries As Any)

Parts

object
Object expression that resolves to a Direct3DDevice8 object.
PaletteNumber
An ordinal value identifying the particular palette upon which the operation is to be performed.
ArrayOfEntries
First element of an array of PALETTEENTRY types, containing the palette entries to set. The number of PALETTEENTRY types in this array is assumed to be 256.

Error Codes

If the method fails, an error is raised and Err.Number can be set to D3DERR_INVALIDCALL.

For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.

Remarks

For Microsoft® DirectX® 8.1 applications, any palette sent to this method must conform to the D3DPTEXTURECAPS_ALPHAPALETTE capability bit. If D3DPTEXTURECAPS_ALPHAPALETTE is not set, every entry in the palette must have alpha set to 1.0 or this method will fail with D3DERR_INVALIDCALL. If D3DPTEXTUECAPS_ALPHAPALETTE is set, then any set of alpha values are allowed. Note that the debug runtime will print a warning message if all palette entries have alpha set to 0.

A single logical palette is associated with the device and is shared by all texture stages.

The following code fragment shows how to call SetPaletteEntries.

Dim device As Direct3DDevice8
Dim pal(255) As PALETTEENTRY

'Pass the first element of the array of palette entries
device.SetPaletteEntries 255, pal(0) 

Ensure that PaletteNumber matches the size of the passed array of palette entries.

See Also

Direct3DDevice8.GetCurrentTexturePalette, Direct3DDevice8.GetPaletteEntries, Direct3DDevice8.SetCurrentTexturePalette, Texture Palettes