Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 01-06-2007, 03:30 PM   #1 (permalink)
Console Junkie
 
aditya.shevade's Avatar
 
Join Date: Jun 2006
Location: USA
Posts: 991
Default How to Draw lines in C/C++?


Hi

I was wondering. There is not graphics header file that we have in Windows, under linux.

So What to do, if I want to draw some straight lines in C/C++ under linux or unix?

I want to draw kind of a table. So, what to do? ASCII characters donot work.

Aditya
__________________
--- Console Junkie
aditya.shevade is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 01-06-2007, 05:12 PM   #2 (permalink)
1337 |)00|) \m/
 
kaustav_geek's Avatar
 
Join Date: Nov 2005
Location: Cyber Space
Posts: 472
Default Re: How to Draw lines in C/C++?

ASCII Chars don't work ? Really ? Well... In case what you're telling is true, then I don't think there's any way...
__________________
My Blog : www.vatsuak.blogspot.com
My DA page : www.burningsilver.deviantart.com

OK..ok..... Ads are bad.. ;)
kaustav_geek is offline  
Old 01-06-2007, 07:10 PM   #3 (permalink)
C# Be Sharp !
 
Zeeshan Quireshi's Avatar
 
Join Date: Jun 2006
Location: Toronto
Posts: 1,805
Default Re: How to Draw lines in C/C++?

could you post ur bit of code that u wrote for ASCII characters , may then i can help .

also if u could draw a rought sketch of what u wanna do , it would be better
__________________
There are 10 types of people in the world: those who understand binary and those who do not.
Zeeshan Quireshi is offline  
Old 01-06-2007, 08:13 PM   #4 (permalink)
Console Junkie
 
aditya.shevade's Avatar
 
Join Date: Jun 2006
Location: USA
Posts: 991
Default Re: How to Draw lines in C/C++?

^^ It's for a game of Tic-Tac-Toe. I just want to draw a 3X3 block of squares.

The code I used in windows is as follows :

Code:
printf("\n\n\n");

          printf("\n\t\t\t\t%c%c%c%c%c%c%c%c%c%c%c%c%c",218,196,196,196,194,196,196,196,194,196,196,196,191);

          printf("\n\t\t\t\t%c ",179);

          printf("%c",game[0][0]);

          printf(" %c ",179);

          printf("%c",game[0][1]);

          printf(" %c ",179);

          printf("%c",game[0][2]);

          printf(" %c ",179);

          printf("\n\t\t\t\t%c%c%c%c%c%c%c%c%c%c%c%c%c",195,196,196,196,197,196,196,196,197,196,196,196,180);

          printf("\n\t\t\t\t%c ",179);

          printf("%c",game[1][0]);

          printf(" %c ",179);

          printf("%c",game[1][1]);

          printf(" %c ",179);

          printf("%c",game[1][2]);

          printf(" %c ",179);

          printf("\n\t\t\t\t%c%c%c%c%c%c%c%c%c%c%c%c%c",195,196,196,196,197,196,196,196,197,196,196,196,180);

          printf("\n\t\t\t\t%c ",179);

          printf("%c",game[2][0]);

          printf(" %c ",179);

          printf("%c",game[2][1]);

          printf(" %c ",179);

          printf("%c",game[2][2]);

          printf(" %c ",179);

          printf("\n\t\t\t\t%c%c%c%c%c%c%c%c%c%c%c%c%c",192,196,196,196,193,196,196,196,193,196,196,196,217);
and when I use the same in linux, all I get is a strange combination of question marks and blanks.

So I wrote a program to find the ASCII values of the respective numbers, I found that lines are not there. The character set ends at 120 or so, there is nothing after that number but question marks.

Aditya
__________________
--- Console Junkie
aditya.shevade is offline  
Old 01-06-2007, 08:25 PM   #5 (permalink)
Resident Fanatic
 
Manshahia's Avatar
 
Join Date: Jul 2006
Location: /Milky way/earth/india/
Posts: 911
Default Re: How to Draw lines in C/C++?

to draw line u can use different algorithms like DDA, MID-Point etc etc...
very complicated though...
__________________
----------
Manshahia is offline  
Old 01-06-2007, 08:27 PM   #6 (permalink)
C# Be Sharp !
 
Zeeshan Quireshi's Avatar
 
Join Date: Jun 2006
Location: Toronto
Posts: 1,805
Default Re: How to Draw lines in C/C++?

try rewriting ther Code in C++ n compiling with latest version of GCC ,

coz what i think that the libraries with which you're linking ur application are old n thus don't support extended characters .
__________________
There are 10 types of people in the world: those who understand binary and those who do not.
Zeeshan Quireshi is offline  
Old 01-06-2007, 08:32 PM   #7 (permalink)
Console Junkie
 
aditya.shevade's Avatar
 
Join Date: Jun 2006
Location: USA
Posts: 991
Default Re: How to Draw lines in C/C++?

I am using anjuta that came with OpenSuSE 10.2. Version 1.2.4a.
gcc is 4.0.3

Can you please tell me what else might I do? Or provide sample code?

Aditya
__________________
--- Console Junkie
aditya.shevade is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
LCD Monitor lines..... vivektheone Hardware Q&A 4 23-02-2007 02:55 PM
Draw in PC? mukilan QnA (read only) 10 17-01-2007 01:39 PM
Telephone Lines techiways Mobiles and Tablets 3 28-09-2004 07:16 PM

 
Latest Threads
- by Charan
- by Sarath
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 12:42 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2