I use Codeblocks and TC 3.0.
I use TC's textcolor and textbackground functions to output colourful text. But only 16 colors are possible.
Also I tried creating circles and rectangles by TC's graphics.h in DOSBox, but an error occurs 'EGAVGA.BGI library missing' even if it exists.
I second SFML, a bunch of us here have at least some experience with it on a multitude of platforms and different IDE's. Also the tutorial won't take you more then a week to get through, and that's if you're really thorough. As a final selling point it's not strictly a "gaming" library, it's generic enough that I've thought about using it in some apps I write for my office.
If you're looking for basic, quick-n-easy shape drawing, C++ probably isn't the right language. Any graphic lib worth using is going to require you to set up and manage some kind of window. It really doesn't get much simpler than what SFML offers.
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML works!");
sf::RectangleShape shape(sf::Vector2f(200, 100));
shape.setFillColor(sf::Color::Blue); // Set the color fill
// You can ignore this it is just setting the origin to the center of the rectangle.
// This makes it easier to place the rectangle on screen
shape.setOrigin(shape.getSize().x / 2, shape.getSize().y / 2);
shape.setPosition(window.getSize().x / 2, window.getSize().y / 2); // Set the position to the middle
if (event.type == sf::Event::Closed)
// Now lets rotate the rectangle every frame. Now I should note this is not a good way to do this.
// You will want to use a time step instead for your update calls but that is another topic
// and didn't want to get into all that so just used this. It rotates the shape by .01 degrees
// every frame (Remember there can be hundreds of frames per second and it varies by computer speed).
It shows the basic idea behind it and some of the things you can do with the shapes. If you want to know more about SFML and shapes check out their tutorial specifically this one http://www.sfml-dev.org/tutorials/2.1/graphics-shape.php
Yes it will run as long as you have SFML 2.X linked to the project. All it shows is a window with a black background and a blue rectangle rotating in the middle of the screen.
Though would just like to point out again that the "hack" that I used for the rotation update should not be used in your actual projects. Instead you should have a timestep that you can use to calculate how much rotation to give for that given frame depending on the delta time.
For example you might see something like this. Not much comments on this explaining the timestep just was meant as a example of what it might look like. If you want more info on timesteps here is a great article on them http://gafferongames.com/game-physics/fix-your-timestep/
// This is how many frames per second we would like.
const sf::Time TimePerFrame = sf::seconds(1.0f / 60.0f);
// How fast our rotation speed should be.
constfloat rotationSpeed = 90.0f;
// Declare our window to work with.
sf::RenderWindow window(sf::VideoMode(800, 600), "Time Steps");
// Setup your rectangle shape.
sf::RectangleShape rectangle(sf::Vector2f(200, 100));
rectangle.setOrigin(rectangle.getSize().x / 2, rectangle.getSize().y / 2);
rectangle.setPosition(window.getSize().x / 2, window.getSize().y / 2);
// We will use this to keep track of the time that has past each frame.
sf::Time timeSinceLastUpdate = sf::Time::Zero;
sf::Time deltaTime = clock.restart();
timeSinceLastUpdate += deltaTime;
while (timeSinceLastUpdate > TimePerFrame)
timeSinceLastUpdate -= deltaTime;
if (event.type == sf::Event::Closed)
// We get real the real-time state of the keyboard to determine what buttons
// might be pressed then act accordingly
rectangle.rotate(-rotationSpeed * deltaTime.asSeconds());
rectangle.rotate(rotationSpeed * deltaTime.asSeconds());