LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 01-19-2007, 04:31 PM   #1
neocontrol
Member
 
Registered: Jul 2005
Posts: 273

Rep: Reputation: 31
making circles with c++


Hi,

I'm learning to program in c++. My problem being that I am using a MS visual studio book.

Right now it's calling for a header called msoftcon.h. Any solutions to work around this head file? The example code is looking for me to make text based circles.... and obviously is a problem when it comes to this.

I heard something about using curses, but I'm not seeing any circle statements or anything.

Am I way off here? Any help would be appreciated.

Thanks

Last edited by neocontrol; 05-06-2010 at 01:33 PM.
 
Old 01-19-2007, 05:36 PM   #2
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 2,012

Rep: Reputation: 115Reputation: 115
What are you trying to do? SDL is generally better for simple 2D graphics.
 
Old 01-19-2007, 08:16 PM   #3
neocontrol
Member
 
Registered: Jul 2005
Posts: 273

Original Poster
Rep: Reputation: 31
Right now it looks like I'm making circles from ascii. One is with letters, and the other is filled in with blocks and colored, and the other one is with symbols.

What exactly is SDL? I don't care if I follow the book exactly, as long as I'm learning concepts.
 
Old 09-16-2008, 12:05 PM   #4
faizlo
Member
 
Registered: Sep 2008
Location: USA
Distribution: Linux Mint Qiana
Posts: 190

Rep: Reputation: Disabled
Hi,

I know I should not pump old threads but I am stuck at exactly the same problem as described here. I apologize in advance if I break some rules.

Here is the code:
Code:
//Circles as graphics objects
//Code from R. Lafore "OOP with C++
//
#include "msoftcon.h"           //for graphics function

struct circle
   {
   int xCo, yCo;                //coordinates of center
   int radius;
   color fillcolor;             //color
   fstyle fillstyle;            //fill pattern
   };

void circle_draw(circle c)
   {
   set_color(c.fillcolor);              //set color
   set_fill_style(c.fillstyle);         //set fill pattern
   draw_circle(c.xCo, c.yCo, c.radius); //draw solid circle
   }

int main()
   {
   init_graphics();                     //initialize graphics system

   circle c1 = {15, 7, 5, cBLUE, X_FILL};
   circle c2 = {41, 12, 7, cRED, O_FILL};
   circle c3 = {65, 18, 4, cGREEN, MEDIUM_FILL};

   circ_draw(c1);                       //draw circles
   circ_draw(c2);
   circ_draw(c3);
   set_cursor_pos(1, 25);               //cursor to lower left corner
   
   return 0;
   }
My question is:
How would you modify this code to work on a Linux box?

faizlo
 
Old 09-16-2008, 08:35 PM   #5
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,126
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
you could look at using libcaca (color ascii art library). I haven't done any development with it myself, but I have used mplayer with it driving a color ascii terminal and it actually looked decent.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Making sure I did it right Ludwig7666 Linux - Newbie 7 08-02-2006 02:28 AM
MDK 10.2 install running me in circles micromidget Mandriva 15 03-23-2005 08:44 PM
Simple circles elvee Programming 8 09-21-2004 01:22 PM
mounting usb thumbdrive and going in circles slackist Linux - Hardware 11 07-27-2004 08:30 PM
Making an OS... eam Programming 4 01-27-2004 02:46 AM

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

All times are GMT -5. The time now is 12:28 PM.

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