- 4.51.2.4.35. -
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.35. ogHFlip()
4.51.2.4.35. ogHFlip()
Targets: MS-DOS, Win32 console
ObjGfx40 Unit
Flips a surface across the horizontal axis.
Declaration:
procedure ogHFlip;
Remarks:
Will mirror a surface around the horizontal axis.
See also:
Sample code:
{ogHFlip.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.
- 4.51.2.4.35. -