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.
I m new to Linux and I want to do programming in c/c++. How can I use Graphics in it. In turbo c++ IDE there is bgi files. How can I do in Linux.
Please Help Me. Thanx.
I presume u want console graphics since that is the only graphics package that I am aware of that is provided with Turbo C++ IDE. If so, the package you might want to try is ncurses which based on "escape sequences" passed to the terminal.
But if you want X-Window graphics programming, follow the links provided by Hko.
Originally posted by deveraux83 I presume u want console graphics since that is the only graphics package that I am aware of that is provided with Turbo C++ IDE. If so, the package you might want to try is ncurses which based on "escape sequences" passed to the terminal.
Actually, Turbo C++ also came with libraries for doing VGA graphics, and you could get a library that let you go into SVGA modes as well. If I remember correctly, it had functions for drawing lines, circles, individual pixels, etc. etc... Since the user is talking about BGI files, I assume that this is actually what he is looking for an equivalent too. If I remember right, the BGI files were like the "libraries" you used to get into graphics modes.
To answer the original user... I believe that SDL provides a similar interface. And if you want to get into 3D programming, you should also look into OpenGL.
I have just started doing this same C++ endeavour using QT from Trolltech. If you get stuck installing it, you may have to install from source. In that case refer to the 'Building QT for X11, Linux' thread. Hope you don't have to go thru the pain I did.
Carl/Houston TX
All the armies, navies, parliaments, and kings, put together, have not affected the life of man upon this earth, as has Christ.
I, too, am right at about the same place in my studies.
I got going with the ncurses library, thanks to the splendid tutorials available online. Then I thought, first I'll pick up VGA graphics, then OpenGL, and finally X Windows GTK operations, and I'll be reasonably confident that I could tackle any project in Linux that I wanted to.
Unfortunately, I've hit a snag. I found this tutorial at svgalib.org and tried it, but no go. I'm running Red Hat 9.0. The system doesn't seem to come with the "VGA.h" that it's talking about, nor does it recognize the library call. I _did_ search for and found some files called VGA.h on my system (none of them in the include directories), and they're all asm system calls and such...no drawing functions declared!
Since then, I've kinda shrugged and given up on console graphics. Recently, I tried downloading the source code for Linux screensavers. But these (spirograph.c, vermiculate.c, for example) #include <screenhack.h>...another file I don't have on my system!
Anyway, maybe with a different system these two methods will work? As for me, I'm still stuck on this one. It really speeds up your learning, if you can simply doodle lines and pixels on the screen. That way, all the junk you have to learn about pointers and structs has a better chance of sticking with you, if you can _use_ it to make simple graphical representations of your data structures.
Anybody have any idea how I can get this? Or just truck on to OpenGL (which I also did in my Windows C days, and found relatively simple to figure out with tutorials from gametutorials.com and a site I remember called NeHe something)?
Before you learn OpenGL, you should learn some basic Windowing system. Since OpenGL is designed to be platform independent, it doesn't provide you with a means of creating the initial Window. You can use cross-platform Windowing APIs like glut, SDL, wxWindows, etc. to create the window, and initialize OpenGL fairly easily, though.
I'm not sure if Qt has any sort of OpenGL widgets, but if it doesn't you can always resort to the glx function to initialize a window to use OpenGL...
But I searched out Qt, and it seems to be payware???
No, no, I've made it a rule to stick to freebies only.
Speaking of which, anybody seen what Macromedia's charging for their latest Flash Development kit? I clicked through out of curiosity. Brace yourself: $899.!!!
When a simple graphics development kit costs more than a top-of-the-line, loaded complete computer system, something is VERY WRONG! It's totally worth learning Linux graphics, just to write a cheap knockoff of Flash and give it away free!
*update*---> oops, stupid of me, paulsm4, you mean the QT development dingus that came with Red Hat! Yes, I've worked through the tutorial in Qt and it is one slick lil' program, alright, but I was talking about graphics libraries as in game development, not necessarily graphics as in windows and buttons.
I can second the recommendation on Qt. I regard "Visual" development interfaces as a barely-necessary evil at best, and even I have to admit that Qt rocks.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.