User forums > Using Code::Blocks

Use of SFML and dependensies

(1/1)

dkaip:
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( ) );

--- End code ---

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;
}

--- End code ---

Navigation

[0] Message Index

Go to full version