LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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


Reply
  Search this Thread
Old 07-12-2006, 01:45 PM   #1
LinuxLala
Senior Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: Fedora 7
Posts: 1,305

Rep: Reputation: 45
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
 
Old 07-12-2006, 01:56 PM   #2
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
SDL would be a great place to start. there are some good tutorials out there and there are also several SDL programmers here..
 
Old 07-12-2006, 02:45 PM   #3
firstfire
Member
 
Registered: Mar 2006
Location: Ekaterinburg, Russia
Distribution: Debian, Ubuntu
Posts: 709

Rep: Reputation: 428Reputation: 428Reputation: 428Reputation: 428Reputation: 428
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!
 
Old 07-12-2006, 07:25 PM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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.
 
Old 07-13-2006, 03:28 PM   #5
LinuxLala
Senior Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: Fedora 7
Posts: 1,305

Original Poster
Rep: Reputation: 45
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.
 
Old 07-13-2006, 03:44 PM   #6
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
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.
 
Old 07-13-2006, 04:22 PM   #7
LinuxLala
Senior Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: Fedora 7
Posts: 1,305

Original Poster
Rep: Reputation: 45
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/
 
Old 07-14-2006, 08:53 AM   #8
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
well here is the site with the tutorials i started out with..

http://cone3d.gamedev.net/cgi-bin/index.pl
 
Old 07-14-2006, 12:40 PM   #9
LinuxLala
Senior Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: Fedora 7
Posts: 1,305

Original Poster
Rep: Reputation: 45
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.
 
Old 07-14-2006, 12:49 PM   #10
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
ah yes, lazyfoo is actually a member here.. ill have to bookmark his site so i dont forget it next time..

good luck!
 
Old 07-14-2006, 06:21 PM   #11
LinuxLala
Senior Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: Fedora 7
Posts: 1,305

Original Poster
Rep: Reputation: 45
thanks again, xhi.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help:Programming Graphics/Games under Linux raju_indian Linux - Newbie 2 07-13-2006 07:35 AM
Graphics Programming on linux using C hazzyb Programming 5 07-15-2005 03:11 PM
Graphics programming in linux juby Programming 15 01-25-2003 05:49 AM
Graphics programming on Linux berry Programming 4 10-23-2002 04:41 AM
Graphics Driver Programming XoSkely10 Programming 1 07-31-2002 02:26 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration