So uhm, I've just "transferred" from SDL and so far...
I LOVE SFML!!! I've noticed it has all the basic functions I need for a console simulator all in one archive. I don't have to use it with external libs (like SDL & SDL_ttf for example).
So here's my question: What will I need to do in SFML to render a blinking text cursor on an imitation console window? I've already got some code here for you (that works when it's linked to the correct libs). By the way: I'm using G++ (GCC) TDM on Windows 7 (I compile apps in 32-bit mode.)
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <iostream>
int main() {
sf::RenderWindow wnd(sf::VideoMode(650, 300), "SFML Console");
sf::Vector2u myVector(650, 300);
wnd.setSize(myVector);
sf::Font myFont;
myFont.loadFromFile("theFont.ttf");
sf::Color myClr;
myClr.r = 0;
myClr.g = 203;
myClr.b = 0;
sf::String myStr = "Hello world!";
sf::Text myTxt;
myTxt.setColor(myClr);
myTxt.setString(myStr);
myTxt.setFont(myFont);
myTxt.setCharacterSize(12);
myTxt.setStyle(sf::Text::Regular);
myTxt.setPosition(0, 0);
while(wnd.isOpen()) {
sf::Event myEvent;
while (wnd.pollEvent(myEvent)) {
if (myEvent.type == sf::Event::Closed) {
wnd.close();
}
if (myEvent.type == sf::Event::KeyPressed) {
if (myEvent.key.code == sf::Keyboard::Escape) {
wnd.close();
}
}
wnd.clear();
wnd.draw(myTxt);
wnd.display();
}
}
}
Thanks in advance.
~lmsmi1