Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Graphics with Borland Turbo c++ 4.5?

281 views
Skip to first unread message

Jonathan Driscoll

unread,
Feb 2, 1996, 3:00:00 AM2/2/96
to
I've been learning c++ from a disk tutorial I got, and it worked
well until I got to the graphics section. Apparently, that whole
section is rather worthless, for it assumes you're using dos. When I

#include <graphics.h>

the compler gives me the error that BGI doesn't work under windows. I'm
rather new to c++, but from what I understand, certain functions
(specifically, graphics functions) aren't the same for all c++
compilers, and I have to use graphics functions specific to the Borland
Turbo c++ compiler. This brings up two problems.
First, I got into c++ programming because it was supposed to be
a new and emerging standard in programming languages. But how standard
can a language be if programs are specific to the brand of compiler
used? It's all rather disillusioning for a beginning progammer...
Second, and more importantantly, I have no idea how to use the
damn thing. Although I commend Borland for their extensive use of
online help, it's really no help at all. I would really appreciate if
someone would post a simple (really, really simple) program that does
something like set the background color and draw a rectangle.
Thanks for the help,

Jonathan Driscoll (j...@vic.com)

Chris Hudson

unread,
Feb 3, 1996, 3:00:00 AM2/3/96
to
Jonathan Driscoll <j...@gatekeeper.vic.com> wrote:

>#include <graphics.h>

> Jonathan Driscoll (j...@vic.com)

As windows is a graphical operating system it is bound to have a large
number of specific functions for producing graphics, and also
isolating these graphics from the user. To produce graphics in DOS is
quite simple (Using the BGI libraries), you simply initialise the
graphics driver, and tell it what you want to do. Within windows it
is also relatively simple (Once you have everything setup within the
Application), you simply write everything to the DC (Device context).
But this in itself is an integral part of windows, so its best to
learn windows programming using C++.

C++ Is highly standardised, but things like BGI libraries, simply by
their name are not standardised (Borland Graphical Interface), and
some things like this will be different for each compiler. As of yet,
there is not a standardised set of libraries for windows programming,
as you have Microsoft with their MFC libs, and Borland with their OWL
libs, so noone has yet devised a standard set of libs, but its getting
their (My money is on Microsoft).

Do the BGI libraries not work if you compile a DOS application, and
run it under a DOS session in windows. I used to do some work like
this, and once you get used to it, it can be quite effective.

Hope this helps

Chris (ch...@xetius.demon.co.uk)


0 new messages