LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 02-24-2005, 11:27 PM   #1
ss100
LQ Newbie
 
Registered: Dec 2004
Location: areepparampu
Posts: 17

Rep: Reputation: 0
graphics in C


i am a new user.
here the systems contains redhat linux version 9.0

i want to know how to draw a line using a c program
in turbo C it is possible by including header file <graphics.h>

i don't see any such header file in c compiler for this linux system.

i downloaded one file gd-1.8.4.tar.zip.

how i install it. or it the write way of doing.
are the commands are same as in turbo C.

i will be thankful to u if u give guidelines to it
thank you.
 
Old 02-25-2005, 01:47 AM   #2
Marius2
Member
 
Registered: Jan 2004
Location: Munich
Distribution: SuSE 9.2, 10.2, 10.3, knoppix
Posts: 276

Rep: Reputation: 31
Take a look at SDL, which is similar to DirectDraw. Further options are GTK (more complicated, but also mightier than SDL, with Anjuta IDE you'll have a programming environment similar to Visual Basic. This is gnomes graphical library), QT (like GTK, but not really free. This is KDEs graphical library), or Xlib (which is the layer under the first three kits - fastest, but also most complicated, really a headache).

If you only want to draw a line, I'd say SDL is the way to go.

I believe RH 9 comes with the development packages for all of the four kits. If you installed them, you should find documentation for each somewhere under /usr/share/doc, and google should come up with tons of docs for them, too.

HTH
 
Old 05-16-2008, 02:17 PM   #3
josedsilva
LQ Newbie
 
Registered: Apr 2002
Location: Goa, India.
Posts: 23

Rep: Reputation: 15
You can install svgalib from (http://svgalib.org) if you want to draw graphics without the need for X windows.
Svgalib has a nice library, namely vgagl, that provides you with basic drawing primitives.
I have written a wrapper library for svgalib in C that makes graphics management easier. You can mail me at josedsilva@yahoo.com for the latest source code.
 
Old 05-19-2008, 09:44 AM   #4
Ace Blackwell
Member
 
Registered: Mar 2004
Location: Kentucky, USA
Distribution: SlamD 12.1 / Slack 12.0 ~ 14.2_64
Posts: 345

Rep: Reputation: 54
Jose,

Do you have a lot of trouble with the video set modes in SVGALIB? I have very limited screen choices. Example is 320x200 mode. It locks my system up. I actually can only run at screen 10 (not sure of the mode). Other programs in Linux use 320x200 with no problem. Is there a set up that maybe I'm not doing? Do I have to do a "get command" for something first?

Thanks
Ace
 
Old 05-19-2008, 10:59 AM   #5
slakwarebunny
LQ Newbie
 
Registered: May 2008
Location: India,Kerala
Distribution: Slackware 12.1
Posts: 10
Blog Entries: 1

Rep: Reputation: 0
[1] http://www.dosbox.com/download.php?main=1
Download dosbox from here ... i would prefer source compilation
[
DosBox is ment to emulate Old DOS operating system .. and of
course .. the main motive is to run DOS application .. which
include games ... etc .. if that is the case ... why not turboc++
3.0 for dos
]

[2] Download TurboC++ 3.0 from here
http://www.vetusware.com/download/Bo...%203.0/?id=163

[3] Compile the code forDOSBox which u should be having SDL
installed for proper graphics drawing ( its ment for DosBox)
AFA you are concerned u dnt have to bother about SDL drawing.
DBOx will handle it .. u can continue with ur c graphics
functions

[4] After installing dosbox
Create a directory C: in ur home and inside C: ->mkdir Temp
extract the turboc++ contents to /home/yourname/C:/Temp

[5] From the terminal run DoxBox
type the following in the prompt shown below
Z:>mount c ~/C:
If u have mounted properly it will say
[ Drive c has been mounted ....... ]

[6] Type this
Z:>C:

[7] Then cd to Temp run the installation wizard
mostly-> install.exe

[8] You are done ...

[9] After installtion if the Directory's are C:\TC\Bin
then cd to TC\bin and type TC ...

[10] After seeing the IDE go to the [options] ->[Linker]->[Libraries] in the window seen enable Graphics Libraries ...

[11] You are done
 
Old 05-20-2008, 06:46 AM   #6
josedsilva
LQ Newbie
 
Registered: Apr 2002
Location: Goa, India.
Posts: 23

Rep: Reputation: 15
Quote:
Originally Posted by Ace Blackwell View Post
Jose,

Do you have a lot of trouble with the video set modes in SVGALIB? I have very limited screen choices. Example is 320x200 mode. It locks my system up. I actually can only run at screen 10 (not sure of the mode). Other programs in Linux use 320x200 with no problem. Is there a set up that maybe I'm not doing? Do I have to do a "get command" for something first?

Thanks
Ace
Have you configured libvga.config in /etc/vga/ correctly?
You may need to install svgalib with the VESA support enabled.
Can you mail me a copy of the installation Makefile.cfg and libvga.config with the following info:
1. Graphic card model no. and chipset, monitor info. (with Vertical and Horizontal scan freq ranges).
2. Mouse information
3. Linux kernel and PC hardware information.
 
Old 05-20-2008, 12:49 PM   #7
RHLinuxGUY
Member
 
Registered: Oct 2003
Distribution: Ubuntu 7.04
Posts: 889
Blog Entries: 1

Rep: Reputation: 30
If I remember correctly I don't think Red Hat 9 came with SDL Devel packages. So freshrpms you need to be.
 
Old 05-20-2008, 03:11 PM   #8
Ace Blackwell
Member
 
Registered: Mar 2004
Location: Kentucky, USA
Distribution: SlamD 12.1 / Slack 12.0 ~ 14.2_64
Posts: 345

Rep: Reputation: 54
thanks

SlackBunny,

Thanks for the info. I haven't been able to find a DOS Box for Slack. This is good info. I have M$ Quick C for DOS and for fun am trying to convert some of my old programs to Linux, but couldn't find anything close to the previous graphics commands. SVGALib looks the closest I've seen so far so I'm going to try it.

Thanks Again,

Ace Balckwell
 
Old 05-21-2008, 12:39 AM   #9
slakwarebunny
LQ Newbie
 
Registered: May 2008
Location: India,Kerala
Distribution: Slackware 12.1
Posts: 10
Blog Entries: 1

Rep: Reputation: 0
Thumbs up

My pleasure

DosBOx for Slackware 12.0
http://www.linuxpackages.net/search_...osbox&ver=12.0
SDL for Slackware 12.0
http://www.libsdl.org/release/SDL-1.2.13.tar.gz
Above link is Source code .of sdl ..

My personal advice is to do source compilation for which ever package u plan to install

Last edited by slakwarebunny; 05-21-2008 at 05:31 AM. Reason: Gramatical
 
  


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
graphics programmes and wacom graphics tablets? bigjohn Linux - Newbie 9 05-29-2005 05:03 PM
getting graphics card to be used instead of integrated graphics Shaun32 Fedora - Installation 5 02-18-2005 03:33 PM
where to find S3 graphics pro savage DDR graphics jcolon Linux - Hardware 5 02-16-2005 04:53 PM
graphics with no X alaios Linux - General 2 08-28-2004 11:50 PM
Graphics issues with Intel 82856G Graphics Adapter herrmag Linux - Newbie 1 08-09-2004 02:52 PM

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

All times are GMT -5. The time now is 10:13 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