1
Graphics / I am tryin an array and i can not make it works ....
« on: March 12, 2010, 09:40:49 pm »
Thank's
Jim
Jim
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
if (!font.LoadFromFile("i2.ttf"))
sf::Text Text("\x0035, \x2718, \x2719, \x271a, \x271b, \x271c, \x271d, \x271e, \x271f, \x2720, \x2721, \x2722, \x2723, \x2724, \x2725,",font);
Uint32 Font::ourDefaultCharset[] =
{
// Printable characters in ASCII range
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, ....
..........................
// extension
0x2710, 0x2711,
..................
sf::Font A;
if (!A.LoadFromFile("i2.ttf"))
return EXIT_FAILURE;
sf::String Text("\x271F \x34 ", A, 50);// the 4 i can see it ...
FT_Library library; /* handle to library */
FT_Face face; /* handle to face object */
FT_Error error;
error = FT_Init_FreeType(&library);
error = FT_New_Face( library,"arial.ttf", 0, &face );
error = FT_Set_Char_Size( face, /* handle to face object */ 0, /* char_width in 1/64th of points */ 16*64, /* char_height in 1/64th of points */ 300, /* horizontal device resolution */ 300 ); /* vertical device resolution */
error = FT_Set_Pixel_Sizes( face, /* handle to face object */ 0, /* pixel_width */ 16 ); /* pixel_height */
int glyph_index = FT_Get_Char_Index( face, 0x0039);
error = FT_Load_Glyph( face,glyph_index,FT_LOAD_NO_BITMAP);
error = FT_Render_Glyph(face->glyph,FT_RENDER_MODE_MONO);
FT_GlyphSlot slot = face->glyph; /* a small shortcut */
libsfml-audio-d.a,libsfml-audio-s-d.a,libsfml-audio-s.a,libsfml-audio.a,libsfml-graphics-d.a,libsfml-graphics-s-d.a,libsfml-g,aphics-s.a,libsfml-graphics.a,libsfml-main-d.a,libsfml-network-d.a,libsfml-network-s-d.a,libsfml-network-s.a,libsfml-netwo,k.a,libsfml-system-d.a,libsfml-system-d.dll.a,libsfml-system-s-d.a,libsfml-system-s.a,libsfml-system.a,libsfml-window-d.a,l,bsfml-window-s-d.a,libsfml-window-s.a,libsfml-window.a
sfml-audio-d.dll,sfml-audio.dll,sfml-graphics-d.dll,sfml-graphics,dll,sfml-network-d.dll,sfml-network.dll,sfml-system-d.dll,sfml-system.dll,sfml-window-d.dll,sfml-window.dll
-lsfml-graphics
-lsfml-window
-lsfml-system
-lsfml-audio
#include <SFML/System.hpp>
#include <iostream>
int main()
{
sf::Clock Clock;
while (Clock.GetElapsedTime() < 5.f)
{
std::cout << Clock.GetElapsedTime() << std::endl;
sf::Sleep(0.5f);
}
return 0;
}
int main()
{
// Create the main rendering window
sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");
// Load a font from a file
sf::Font MyFont;
if (!MyFont.LoadFromFile("arial.ttf", 50))
return EXIT_FAILURE;
// Create a graphical string
sf::String Hello;
std::string asd="123 Γεια χαρά, όλα καλά";
std::wstring asd1=L"456 Γεια χαρά, όλα καλά";
Hello.SetText("\xf1\xf2...\xfe\xff \x3c2");
C:\TMP\15\main.cpp||In function `int main()':|
C:\TMP\15\main.cpp|19|error: no matching function for call to `sf::Font::LoadFromFile(const char[10], int)'|
C:\Program Files\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\SFML\Graphics\Font.hpp|92|note: candidates are: bool sf::Font::LoadFromFile(const std::string&)|
C:\TMP\15\main.cpp|25|error: 'class sf::String' has no member named 'SetText'|
C:\TMP\15\main.cpp|25|warning: hex escape sequence out of range|
C:\TMP\15\main.cpp|26|error: 'class sf::String' has no member named 'SetFont'|
C:\TMP\15\main.cpp|27|error: 'class sf::String' has no member named 'SetColor'|
C:\TMP\15\main.cpp|28|error: 'class sf::String' has no member named 'SetPosition'|
C:\TMP\15\main.cpp|30|error: 'class sf::String' has no member named 'SetSize'|
C:\TMP\15\main.cpp|52|error: 'class sf::RenderWindow' has no member named 'Capture'|
C:\TMP\15\main.cpp|59|error: no matching function for call to `sf::RenderWindow::Draw(sf::String&)'|
C:\Program Files\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\SFML\Graphics\RenderTarget.hpp|70|note: candidates are: void sf::RenderTarget::Draw(const sf::Drawable&)|
C:\Program Files\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\SFML\Graphics\RenderTarget.hpp|79|note: void sf::RenderTarget::Draw(const sf::Drawable&, const sf::Shader&)|
||=== Build finished: 8 errors, 1 warnings ===|
-------------- Clean: Debug DLL_Win32 in sfml-system ---------------
Cleaned "sfml-system - Debug DLL_Win32"
-------------- Clean: Debug DLL_Win32 in sfml-window ---------------
Cleaned "sfml-window - Debug DLL_Win32"
-------------- Clean: Debug DLL_Win32 in sfml-network ---------------
Cleaned "sfml-network - Debug DLL_Win32"
-------------- Clean: Debug DLL_Win32 in sfml-graphics ---------------
Cleaned "sfml-graphics - Debug DLL_Win32"
-------------- Clean: Debug DLL_Win32 in sfml-audio ---------------
Cleaned "sfml-audio - Debug DLL_Win32"
-------------- Build: Debug DLL_Win32 in sfml-system ---------------
Compiling: ..\..\src\SFML\System\Clock.cpp
Compiling: ..\..\src\SFML\System\Lock.cpp
Compiling: ..\..\src\SFML\System\Mutex.cpp
Compiling: ..\..\src\SFML\System\Randomizer.cpp
Compiling: ..\..\src\SFML\System\Sleep.cpp
Compiling: ..\..\src\SFML\System\String.cpp
Compiling: ..\..\src\SFML\System\Thread.cpp
Compiling: ..\..\src\SFML\System\ThreadLocal.cpp
Compiling: ..\..\src\SFML\System\Utf.cpp
Compiling: ..\..\src\SFML\System\Win32\MutexImpl.cpp
Compiling: ..\..\src\SFML\System\Win32\Platform.cpp
Compiling: ..\..\src\SFML\System\Win32\ThreadImpl.cpp
Compiling: ..\..\src\SFML\System\Win32\ThreadLocalImpl.cpp
Linking dynamic library: ..\..\lib\mingw\sfml-system-d.dll
Creating library file: ..\..\lib\mingw\libsfml-system-d.dll.a
Output size is 2.12 MB
-------------- Build: Debug DLL_Win32 in sfml-window ---------------
Compiling: ..\..\src\SFML\Window\Context.cpp
Compiling: ..\..\src\SFML\Window\ContextGL.cpp
Compiling: ..\..\src\SFML\Window\Input.cpp
Compiling: ..\..\src\SFML\Window\VideoMode.cpp
Compiling: ..\..\src\SFML\Window\Win32\ContextWGL.cpp
Compiling: ..\..\src\SFML\Window\Win32\Joystick.cpp
Compiling: ..\..\src\SFML\Window\Win32\VideoModeSupport.cpp
Compiling: ..\..\src\SFML\Window\Win32\WindowImplWin32.cpp
Compiling: ..\..\src\SFML\Window\Window.cpp
Compiling: ..\..\src\SFML\Window\WindowImpl.cpp
Linking dynamic library: ..\..\lib\mingw\sfml-window-d.dll
mingw32-g++.exe: ..\..\lib\mingw\libsfml-system-d.a: No such file or directory
Process terminated with status 1 (0 minutes, 6 seconds)
0 errors, 0 warnings