Previous: 4.51.2.4.62. ogUnpackRGBA() To the Table of Contents Next: 4.51.2.4.64. ogVLine()
4.51.2.4.62. ogUnpackRGBA() Table of Contents 4.51.2.4.64. ogVLine()

- 4.51.2.4.63. -
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.63. ogVFlip()


4.51.2.4.63. ogVFlip()

Targets: MS-DOS, Win32 console


ObjGfx40 Unit

Flips a surface across the vertical axis.

Declaration:
  procedure ogVFlip;
Remarks:

Will mirror a surface around the vertical axis.

See also: Sample code:
{ogVFlip.pas}

uses
 ObjGfx40, CRT;

var 
  buf:^ogSurface;
  count:uInt32;

begin
  randomize;

  new(buf, ogInit);

  if not buf^.ogCreate(320, 240, OG_PIXFMT_8BPP) then
    begin
      writeln('Error allocating memory');
      halt
    end;

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

  with buf^ do
    for count:=0 to 50 do
      ogLine(random(ogGetMaxX), random(ogGetMaxY),
             random(ogGetMaxX), random(ogGetMaxY), random(255));

  {copy original to upper left}
  screen^.ogCopyBuf(0, 0, buf^, 0, 0, buf^.ogGetMaxX, buf^.ogGetMaxY);

  buf^.ogVFlip;  {Mirror the buffer}

  screen^.ogCopyBuf(320, 0, buf^, 0, 0, buf^.ogGetMaxX, buf^.ogGetMaxY);

  buf^.ogHFlip;  {Mirror on the other axis}

  screen^.ogCopyBuf(320, 240, buf^, 0, 0, buf^.ogGetMaxX, buf^.ogGetMaxY);

  buf^.ogVFlip;

  screen^.ogCopyBuf(0, 240, buf^, 0, 0, buf^.ogGetMaxX, buf^.ogGetMaxY);

  readKey;
  dispose(buf, ogDone);
end.



Previous: 4.51.2.4.62. ogUnpackRGBA() To the Table of Contents Next: 4.51.2.4.64. ogVLine()
4.51.2.4.62. ogUnpackRGBA() Table of Contents 4.51.2.4.64. ogVLine()

- 4.51.2.4.63. -