Author Topic: Use of SFML and dependensies  (Read 2673 times)

Offline dkaip

  • Multiple posting newcomer
  • *
  • Posts: 42
Use of SFML and dependensies
« on: January 30, 2010, 10:47:09 pm »
In main graphics start up program with codeblocks in build options, in other linker options must put -lsfml-system and in search directories>linker must take the C:\SFML-1.5\lib\mingw directory, and in the compiler stettings>#defines must put SFML_DYNAMIC.
In the program directory must put the sfml-system.dll file to work the program.
-------------------------------------
Now i implement with ...

Code
    sf::Font font;
    std::string file = OpenFile( "Arial.ttf" );
    font.LoadFromMemory( file.c_str( ), file.length( ) );

I have the graphics.hpp and i dont know what settings must i do.
Thank's
Jim

Code
#include <SFML/System.hpp>
#include <SFML/graphics.hpp>
#include <iostream>

int main()
{
    sf::Font font;
    std::string file = OpenFile( "Arial.ttf" );
    font.LoadFromMemory( file.c_str( ), file.length( ) );
    sf::Clock Clock;
    while (Clock.GetElapsedTime() < 5.f)
    {
        std::cout << Clock.GetElapsedTime() << std::endl;
        sf::Sleep(0.5f);
    }

    return 0;
}