ProgrammingThis 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.
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.
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.
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.
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?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.