Previous: 4.51.2.4.5. ogCircle() To the Table of Contents Next: 4.51.2.4.7. ogClone()
4.51.2.4.5. ogCircle() Table of Contents 4.51.2.4.7. ogClone()

- 4.51.2.4.6. -
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.6. ogClear()


4.51.2.4.6. ogClear()

Targets: MS-DOS, Win32 console


ObjGfx40 Unit

Clears the surface to a specific colour.

Declaration:
  procedure ogClear(colour:uInt32); virtual;
Remarks:

Clear will set the entire surface to colour. If the surface is aliasing another buffer, only the region that has been aliased will be affected.

See also: Sample code:
{ogClear.pas}

uses
  ObjGfx40, CRT;

var 
  buf:^ogSurface;

begin
  new(buf, ogInit);

  if not buf^.ogCreate(640, 480, OG_PIXFMT_8BPP) then
    begin
      writeln('Error creating surface');
      halt
    end;

  if not screen^.ogCreate(320, 200, OG_PIXFMT_8BPP) then
    begin
      writeln('Error setting video mode');
      halt
    end;

  buf^.ogClear(5); {Clear buf to colour 5 (which is by default magenta)}

  { the ogRGB() function will pick a "best match" for indexed colour modes}
  Screen^.ogClear(screen^.ogRGB(255,255,255)); {Clear screen to colour white}

  readKey;
  
  dispose(buf, ogDone);
end.



Previous: 4.51.2.4.5. ogCircle() To the Table of Contents Next: 4.51.2.4.7. ogClone()
4.51.2.4.5. ogCircle() Table of Contents 4.51.2.4.7. ogClone()

- 4.51.2.4.6. -