home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C++ Games Programming
/
CPPGAMES.ISO
/
fgl
/
fglight
/
expas.arj
/
TEMP
/
10-19.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1995-01-20
|
1KB
|
66 lines
program main;
{$IFDEF DPMI}
uses fgmain, fgbitmap, fgmisc, fgpcx, fgvb, WinAPI;
{$ELSE}
{$M 16384,0,16384}
uses fgmain, fgbitmap, fgmisc, fgpcx, fgvb;
{$ENDIF}
var
status : integer;
handle1, handle2 : integer;
buffer1, buffer2 : pointer;
begin
fg_initpm;
fg_setmode(19);
fg_vbinit;
{$IFDEF DPMI}
buffer1 := GlobalAllocPtr(gmem_Fixed,Longint(64000));
buffer2 := GlobalAllocPtr(gmem_Fixed,Longint(4000));
if (buffer1 = NIL) or (buffer2 = NIL) then
begin
fg_setmode(3);
fg_reset;
writeln('Could not create the virtual buffers.');
exit;
end;
handle1 := fg_vbdefine(buffer1,320,200);
handle2 := fg_vbdefine(buffer2,80,50);
{$ELSE}
handle1 := fg_vballoc(320,200);
handle2 := fg_vballoc(80,50);
if (handle1 < 0) or (handle2 < 0) then
begin
fg_setmode(3);
fg_reset;
writeln('Could not create the virtual buffers.');
exit;
end;
buffer1 := fg_vbaddr(handle1);
buffer2 := fg_vbaddr(handle2);
{$ENDIF}
status := fg_vbopen(handle1);
status := fg_loadpcx('CORAL.PCX'+chr(0),0);
fg_vbpaste(0,319,0,199,0,199);
fg_waitkey;
fg_scale(buffer1,buffer2,320,200,80,50);
status := fg_vbopen(handle2);
fg_vbpaste(0,79,0,49,0,199);
fg_waitkey;
fg_vbclose;
{$IFDEF dpmi}
GlobalFreePtr(buffer1);
GlobalFreePtr(buffer2);
{$ELSE}
fg_vbfree(handle1);
fg_vbfree(handle2);
{$ENDIF}
fg_setmode(3);
fg_reset;
end.