Previous: 4.51.2.2.8. ogInit() To the Table of Contents Next: 4.51.2.2.10. ogQueryModeSettings()
4.51.2.2.8. ogInit() Table of Contents 4.51.2.2.10. ogQueryModeSettings()

- 4.51.2.2.9. -
Table of Contents
4. Standard Units
4.51. ObjGfx40 - ObjectGraphics 4.0 Unit
4.51.2. ObjGfx40 Unit Object Types
4.51.2.2. ogDisplay object
4.51.2.2.9. ogLoadPal()


4.51.2.2.9. ogLoadPal()

Targets: MS-DOS, Win32 console


ObjGfx40 Unit

Loads a palette off disk into a surface.

Declaration:
  function ogLoadPal(const palFile:string):boolean; virtual;
Remarks:

Loads a palette contained in palfile. A palette is an array of 256 RGBA byte values. For each RGB value 0 is minimum, and 255 is maximum. The A (alpha) field is used for alignment. Returns TRUE if the load was successful. Returns FALSE if the file doesn't exist or the palette couldn't be completely read in. In the event there is an error loading the palette, the original palette will be restored.

Will set the hardware palette after loading.

Restrictions:

Only relevant in 8BPP surfaces. The palette is unused for high and true colour buffers. Will allocate a new palette if none exists.

See also:


Previous: 4.51.2.2.8. ogInit() To the Table of Contents Next: 4.51.2.2.10. ogQueryModeSettings()
4.51.2.2.8. ogInit() Table of Contents 4.51.2.2.10. ogQueryModeSettings()

- 4.51.2.2.9. -