Programming This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
07-12-2006, 02:45 PM
|
#1
|
Senior Member
Registered: Aug 2003
Location: New Delhi, India
Distribution: Fedora 7
Posts: 1,305
Rep:
|
linux 2D graphics programming in C help
Hello,
I wish to learn basic 2d graphics programming in C under linux. I am an absolute dumb-a** in this regard and I have searched through google but didn't find anything that could help me.
Basically, I am looking for some guide that will tell me what library, what header file, what method calls, etc, I have to make in order to be able to make simple 2D graphics.
Like I already said, I am an absolute dumb-a** in this regard so I need complete spoon feeding. I need to know the basics, the header files that I should use in C, etc.
Later, once I know 2D, I would like to learn some advance stuff. I don't understand where to begin. Everywhere I just see references to OpenGL, but I wish to begin with absolute basics of 2D and then slowly crawl my way up the ranks.
Any help would be appreciated.
Thanks!
P.S. It's amazing how even after a 1000 posts, it seems best to say 'Any help would be appreciated' after requesting for help. Funny how no one has ever come up with anything else, dicounting TIA and all variants
|
|
|
07-12-2006, 02:56 PM
|
#2
|
Senior Member
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065
Rep:
|
SDL would be a great place to start. there are some good tutorials out there and there are also several SDL programmers here..
|
|
|
07-12-2006, 03:45 PM
|
#3
|
Member
Registered: Mar 2006
Location: Ekaterinburg, Russia
Distribution: Debian, Ubuntu
Posts: 709
|
1) Try libplot from `GNU plotutils' package. This library is very simple and powerful enough, well documented. In that package you'll find very useful (in my opinion) utils like `graph', `ode', `spline', ...
http://www.gnu.org/software/plotutils/
2) Your program may produce PostScript-output which you can interpret with, say, `gs'.
3) svgalib - a low level graphics library for linux. Unlike previous with this one you can not plot anything in X-window, i.e. output appear in segregate console.
Good luck!
|
|
|
07-12-2006, 08:25 PM
|
#4
|
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
|
Another easy to use graphics lib is GD. Having said that, there are quite a few different types of graphics, and this is suitable for a small subset. Are you trying to generate charts & graphs, 'art', animation, print-quality... ? The type of graphic you want should be considered as part of your choice of library. You could, for instance, simply write C code that generates pure postscript, which would be rendered by some other device or program.
If you haven't already though about these issues, you should, and then ask more here after telling us some more of your plans.
--- rod.
|
|
|
07-13-2006, 04:28 PM
|
#5
|
Senior Member
Registered: Aug 2003
Location: New Delhi, India
Distribution: Fedora 7
Posts: 1,305
Original Poster
Rep:
|
What I want to do is the absolute basic stuff -- making dots and lines. filling color into boxes. The absolute beginner stuff. I wish to know how to get started. See, you guys have already suggested some things.
I *don't* wish to plot graphs or anything. I don't have to submit a project. All I want is to learn graphics programming using C under linux. Ubuntu specifically. Although, the distribution is not a concern.
A few years ago, I had done graphics in C using turbo C++ on winodws for a school project. I have done nothing in graphics since, and never anything on linux. So, I am an absolute illitrate.
Like I said above, I need a "from scratch" kind-of a guide.
|
|
|
07-13-2006, 04:44 PM
|
#6
|
Senior Member
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065
Rep:
|
what type of graphics programming. ? give an example of what you want to eventually be able to do. you mentioned about working up to opengl. are you thinking about game or simulation programming in the end or what.
|
|
|
07-13-2006, 05:22 PM
|
#7
|
Senior Member
Registered: Aug 2003
Location: New Delhi, India
Distribution: Fedora 7
Posts: 1,305
Original Poster
Rep:
|
ok, so I have got sdl installed, and I've been able to download some of them demos from the site and see how they work. Cool! It'd be nice if there are some noobie guides (no assumptions made by the author) for working with SDL now.
xhi: not games, really, but I was thinking more towards screen savers if you will.
Is there any manual available apart from http://www.libsdl.org/cgi/docwiki.cgi/
|
|
|
07-14-2006, 09:53 AM
|
#8
|
Senior Member
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065
Rep:
|
well here is the site with the tutorials i started out with..
http://cone3d.gamedev.net/cgi-bin/index.pl
|
|
|
07-14-2006, 01:40 PM
|
#9
|
Senior Member
Registered: Aug 2003
Location: New Delhi, India
Distribution: Fedora 7
Posts: 1,305
Original Poster
Rep:
|
xhi: thanks. I joined the gamedev forums last night and searched there for SDL. Found the cone3d sdl link there as well as http://lazyfooproductions.com/SDL_tutorials/index.php
thanks all.
|
|
|
07-14-2006, 01:49 PM
|
#10
|
Senior Member
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065
Rep:
|
ah yes, lazyfoo is actually a member here.. ill have to bookmark his site so i dont forget it next time..
good luck!
|
|
|
07-14-2006, 07:21 PM
|
#11
|
Senior Member
Registered: Aug 2003
Location: New Delhi, India
Distribution: Fedora 7
Posts: 1,305
Original Poster
Rep:
|
thanks again, xhi.
|
|
|
All times are GMT -5. The time now is 06:06 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|