Previous: 4.51.2.4.11. ogCopyBuf() To the Table of Contents Next: 4.51.2.4.13. ogCreate()
4.51.2.4.11. ogCopyBuf() Table of Contents 4.51.2.4.13. ogCreate()

- 4.51.2.4.12. -
Table of Contents
4. Standard Units
4.51. ObjGfx40 - ObjectGraphics 4.0 Unit
4.51.2. ObjGfx40 Unit Object Types
4.51.2.4. ogSurface object
4.51.2.4.12. ogCopyPal()


4.51.2.4.12. ogCopyPal()

Targets: MS-DOS, Win32 console


ObjGfx40 Unit

Copies the palette from one surface to another.

Declaration:
  procedure ogCopyPal(var srcObject:ogSurface); virtual;
Remarks:

Copies the palette structure from srcObject.

Restrictions:

Palettes only apply to 8BPP surfaces.

See also: Sample code:
{ogCopyPal.pas}

uses
  ObjGfx40;

var 
  buf1, buf2:^ogSurface;

begin
  new(buf1, ogInit);
  new(buf2, ogInit);

  {Create an 8bpp surface}
  if not buf1^.ogCreate(200, 200, OG_PIXFMT_8BPP) then
    begin
      writeln('Error creating buf1');
      halt
    end;

  {Create another 8bpp surface}
  if not buf2^.ogCreate(400, 400, OG_PIXFMT_8BPP) then
    begin
      writeln('Error creating buf2');
      halt
    end;

  buf1^.ogCopyPal(buf2^);
  
  dispose(buf2, ogDone);
  dispose(buf1, ogDone);
end.



Previous: 4.51.2.4.11. ogCopyBuf() To the Table of Contents Next: 4.51.2.4.13. ogCreate()
4.51.2.4.11. ogCopyBuf() Table of Contents 4.51.2.4.13. ogCreate()

- 4.51.2.4.12. -