Linking BGI driver into .exe file.??????????? 
Author Message
 Linking BGI driver into .exe file.???????????

Hi there. I am trying to get a silly game program I have written to
include graphics so I can send it to some friends. Obviously it will be an
exe file. I have followed the instructions for linking graphics drivers
into .exe files in the Borland documentation but there appears to be
a problem or two. (Might I add that the whole process seems incredibly
convoluted!)

Can anyone out there explain the process for linking a BGI graphics driver
into an .exe file in simple terms that work?

Thanks in advance.



Wed, 18 Jun 1902 08:00:00 GMT  
 Linking BGI driver into .exe file.???????????

Quote:

> Hi there. I am trying to get a silly game program I have written to
> include graphics so I can send it to some friends. Obviously it will be an
> exe file. I have followed the instructions for linking graphics drivers
> into .exe files in the Borland documentation but there appears to be
> a problem or two. (Might I add that the whole process seems incredibly
> convoluted!)

What sort of problems?  I've done this and have never had any real problems
with it (except for maybe that it eats a lot of memory -- in which case you
can modify the source so it uses only EGAVGA.BGI and links one or two fonts).

Quote:
> Can anyone out there explain the process for linking a BGI graphics driver
> into an .exe file in simple terms that work?

1.)  Change to the directory where the example files are.  From your main TP
directory, it will usually be .\EXAMPLES\DOS\BGI.

2.)  Type:

make -fbgilink.mak

This will create a demo program, as well as the units that contain the linked
drivers.

3.)  Study the code to BGILINK.PAS to see how drivers are initialized.  
Duplicate in your own program.

Quote:
> Thanks in advance.

--
Scott Earnest                      | _,-""-_,-""-_,-""-_,-""-_,-""-_,-" |




Wed, 18 Jun 1902 08:00:00 GMT  
 Linking BGI driver into .exe file.???????????

 105100 Sep 14 1996 ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip
 tsfaqp.zip Common Turbo Pascal Questions and Timo's answers

24. *****
 Q: How can I link graphics drivers directly into my executable?

 A: This is a complicated, yet a very useful task, because then you
won't need any separate graphics drivers (or fonts) to go separately
along with your program. Unfortunately, Turbo Pascal documentation
on this task is a bit confusing.
   1) The very first step is to get the necessary files from the
Turbo Pascal disks to your working directory. To start with, you'll
need binobj.exe and all the .bgi files.
   2) Run the following commands (best to place them in a batch,
call it e.g. makeobj.bat):
     binobj cga.bgi cga CGADriverProc
     binobj egavga.bgi egavga EGAVGADriverProc
     binobj herc.bgi herc HercDriverProc
     binobj pc3270.bgi pc3270 PC3270DriverProc
     binobj att.bgi att ATTDriverProc
     rem binobj ibm8514.bgi 8514 IBM8514DriverProc
   3) Get drivers.pas from the Turbo Pascal disk and compile it with
Turbo Pascal. Now you have a drivers.tpu unit which contains all the
graphics drivers.
   4) Now you won't need the .bgi and the .obj files any more. You
may delete them from your working directory.
   5) Write your graphics program in the usual manner. But before
putting your program in the graphics mode use the following
procedure if you want to link e.g. the EGAVGA graphics driver
directly into your executable. (Link just the driver(s) you'll need,
since the drivers take up a lot of space.)
     uses Graph, Drivers;
     :
     procedure EGAVGA2EXE;
     begin

         begin
           writeln ('EGA/VGA: ', GraphErrorMsg(GraphResult));
           halt(1);
         end;
     end; (* egavga2exe *)
     :
   Linking the .bgi and .chr drivers is also covered in Swan (1989),
Mastering Turbo Pascal 5.5 pp. 355-359 and Mitchell (1993), Borland
Pascal Developer's Guide , pp. 221-229.
   If you have Turbo Pascal 7.0 its help function gives you an
example code. One way of getting at it is the following. In the
Turbo Pascal IDE (that is in the editor) type RegisterBGIdriver.
Then place the cursor on it and press alt-F1 for help of that
keyword. Press alt-F10 and select "Copy example". Press first <ESC>
then alt-F10 and select Paste. The example code is pasted within
your program for you to study.
   Incidentally, although this is a slightly different matter, you
can link any data material into your executable. See Stephen
O'Brien, (1988), Turbo Pascal, Advanced Programmer's Guide, pp. 31 -
35 for more details.
--------------------------------------------------------------------

   All the best, Timo

....................................................................

Moderating at ftp:// & http://garbo.uwasa.fi archives  193.166.120.5
Department of Accounting and Business Finance  ; University of Vaasa



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. BGI file linked in EXE file?

2. Including .chr and .bgi files in a program compiled into .exe

3. Incorporating BGI fonts in EXE file

4. Building BGI files into an EXE

5. Linking BGI files into Executables

6. Linking BGI files - Help!

7. BGI driver's file structure needed

8. Link 2 exe and/or com files

9. How to link a .GIF file into the .EXE

10. Linking an .EXE file in my program

11. Linking EXE and OVL files

12. Linking several exe-files

 

 
Powered by phpBB® Forum Software