snippet needed

i need a snippet for drawing a box and a circle of desired dimensions in c++ without the use of graphics.h

thanks in advance

Drawing them in the console using ascii? Or actually drawing graphics?
actually drawing graphics
You're going to want to get a 3rd party library. I would recommend SDL.

http://www.libsdl.org/

This guy has a great set of video tutorials: https://www.youtube.com/watch?v=Lb_Jy5HGMsk
And I think most people on here would agree lazy foo is the go to guy for SDL text tutorials: http://www.lazyfoo.net/SDL_tutorials/index.php

There are other options out there though, so to be fair, I'll post some others:

http://www.sfml-dev.org/ - SFML - Will do the job and it is very much geared towards game programming.

http://www.opengl.org/ - Good graphics library, although quite complex.
thanks @Mats

but can please suggest some snippet i asked for in c++?
No. That's not how you learn. =/

Everything you need is there.
Last edited on
sorry i also dont like looking out for prewritten code, but i'm havin my preboard day after tommorow and i need this snipet for my project.
otherwise i would have learnt it from my teacher or many of the forums on net
Typical video tutorial is 10-30 mins. You can learn what you need tonight if you put in a stupendous effort. Go for it!
thanx for it.
i may see it tommorow coz i've go to sleep,
here time is 00:10 :)
If you're using C++, I would prefer SFML over SDL.

http://sfml-dev.org/

It is clean, OO C++ with good official documentation and a helpful community. You also don't have to download extra libraries for loading more than a bmp, text, audio, and networking.

I have used both, and I definitely prefer SFML. When I used SFML, I had to write a fair amount of wrapper code to ensure RAII, but since SFML is C++ it will handle it own resources.

I also recommend Thor, an extension to SFML, which provides useful things such as animation and particles.

http://www.bromeon.ch/libraries/thor/index.html
Topic archived. No new replies allowed.