ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
conio.h is a DOS specific header, and graphics.h is a TC++ specific header. Graphics programming itself is not limited to TC++, though. TC++ itself is an antiquated compiler that pre-dates the latest ANSI standards, and only produces DOS binaries. I'm always surprised when I find people are still using it, actually. There are so many better compilers available for free in both the Linux and Windows worlds.
A lot of graphics programming today is done in the context of a GUI system, such as Windows and X in the Linux world. You'll probably want to take a look at some windowing API. A good one to start with might be SDL, as I believe that has 2d graphics routines similar to what you would find in the old DOS graphics of TC++. I believe SDL also has a mode that allows for graphics outside of a GUI environment, though I've never actually messed with that aspect of it much. SDL is also cross-platform, meaning there are libraries for it in Windows, Linux, etc.
1. "conio.h" and "graphics.h" are old Turbo C/DOS headers you aren't likely to see on any current platform: Linux or Windows.
2. SDL might be a good Linux alternative to the old BGI graphics libraries.
3. You might also wish to explore Qt or GTK+ as "standard", cross-platform (Windows *and* Linux) libraries for graphics (and GUIs). My preference is GTK+ (and I use the raw GTK+ API from my C++ programs, much as you used to call the C-language BGI library functions from your Turbo C++ programs).
for clarifying some of my doubts...
But what if I wish to draw just a plane circle,line or polygon and other shapes.Well all this is crap nowadays but my Graphics Course needs it.
Can i draw these thru GTK+ or SDL?
Well i don't know GTK+ or SDL programming.Are there any good sources from where i can learn these??
GTK+ is oriented more toward GUIs. It started out as the base library for "The Gimp" (an extremely popular Open Source graphics program), but it's become much more than that. I have nothing but high praise for GTK+. It's advantages include:
1. It's very easy to write a "hello world" (and only slightly more difficult
to write a "hello world" to a drawing area that lets you draw circles and polygons...)
2. It's cross-platform
3. It supports the gamut of things you'd want to do: user interface, raster imaging, vector drawing, good integration with the underlying windowing subsystem, etc etc:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.