Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

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.


Topics - dabo

Pages: 1 [2]
16
Graphics / SetCenter() blurs my text sometimes
« on: May 26, 2008, 09:11:01 pm »
Is this just happening to me? When I give the method mentioned in the subject "float" parameters sometimes the text gets blurry. For example:

Code: [Select]
Text.SetCenter(TextRect.GetWidth() / 2, 0.f);

Doing this fixes it:

Code: [Select]
Text.SetCenter((int) TextRect.GetWidth() / 2, 0.f);

I find it strange that this method takes "float" parameters if I must use (int) conversion in order to make sure I don't get blurry text.

17
Network / Download text-file
« on: March 22, 2008, 12:45:11 pm »
Hi, I'm a beginner when it comes to network programming so I have a question.

Is it possible to use SFML's network part to download a text-file from a website, for example: www.mywebsite.com/mytextfile.txt and put it somewhere on the hard drive. If so, how would this be done?

18
Graphics / The new font class
« on: March 07, 2008, 11:41:47 am »
Hi, I was wondering is the interface / management the only new thing then you handle fonts? or are they drawn differently on the screen too? in other words do they look different when you draw them than they did before the font class? For a second I though they looked differently but they probably don't.

19
General / [SVN] Shapes
« on: March 07, 2008, 12:10:44 am »
Hi, I just downloaded the latest source and in order to get the shapes to link I had to add "Shape.cpp" and "Shape.hpp" to the sfml-graphics project in the SFML.sln solution for VS2008. Did you forget to add them?

Anyway now when I finally managed to build my project, I got a "Debug Assertion Failed" error when I tried to run my project. It said:

"Vector subscript out of range"

This is the code I'm using:

Code: [Select]
//Create a shape
sf::Shape sLine;
sLine.Line(sf::Vector2f(300.f,300.f), sf::Vector2f(320.f,340.f), 2.f, sf::Color(0, 0, 0));

//Draw the shape
App.Draw(sLine);


If I remove the Shape drawing code, I don't get the error. This is the first time I try to use shapes, is my code wrong? Any ideas?

20
General / Character/string width in pixels
« on: February 06, 2008, 10:01:56 pm »
Hi, is there a way to get the width of a character or a string in pixels? like if there were functions like this:

Code: [Select]
int i;
i = widthInPixels("a");
i = widthInPixels("SFML is great!");


I know you would need to take font size etc. into consideration too but still.

21
General / Linker errors using SFML 1.2
« on: January 17, 2008, 04:40:31 pm »
Hi, once again I get these lovely linker errors. They really love me :(

This is my setup:

VC++ Directories:

Include files:
C:\Daniel\SFML-1.2\include

Library files:
C:\Daniel\SFML-1.2\lib\vc2008\static

Additional dependencies:
sfml-graphics-d.lib sfml-main-d.lib sfml-system-d.lib sfml-window-d.lib

This is the code I'm trying to compile (the one from the doc-page without the music and the sprite):
Code: [Select]
#include <SFML/Graphics.hpp>
 
 int main()
 {
     // Create the main window
     sf::RenderWindow App(sf::VideoMode(800, 600), "SFML window");
 
     // Create a graphical string to display
     sf::String Text("Hello SFML", "arial.ttf", 50);
 
     // Start the game loop
     bool Running = true;
     while (Running)
     {
         // Process events
         sf::Event Event;
         while (App.GetEvent(Event))
         {
             // Close window : exit
             if (Event.Type == sf::Event::Closed)
                 Running = false;
         }
 
         // Draw the string
         App.Draw(Text);
 
         // Update the window
         App.Display();
     }
 
     return EXIT_SUCCESS;
 }


This is the output:
Code: [Select]
1>------ Rebuild All started: Project: sfml12test, Configuration: Debug Win32 ------
1>Deleting intermediate and output files for project 'sfml12test', configuration 'Debug|Win32'
1>Compiling...
1>main.cpp
1>Compiling manifest to resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1>Copyright (C) Microsoft Corporation.  All rights reserved.
1>Linking...
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>sfml-graphics-d.lib(ImageLoader.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base@std@@QBEXXZ) referenced in function "public: void __thiscall std::_Iterator_base::_Adopt(class std::_Container_base const *)" (?_Adopt@_Iterator_base@std@@QAEXPBV_Container_base@2@@Z)
1>sfml-window-d.lib(Window.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base@std@@QBEXXZ)
1>sfml-window-d.lib(VideoMode.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base@std@@QBEXXZ)
1>sfml-window-d.lib(VideoModeSupport.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base@std@@QBEXXZ)
1>sfml-graphics-d.lib(RenderWindow.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base@std@@QBEXXZ)
1>sfml-graphics-d.lib(String.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base@std@@QBEXXZ)
1>sfml-graphics-d.lib(Image.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base@std@@QBEXXZ)
1>sfml-graphics-d.lib(FontManager.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base@std@@QBEXXZ)
1>sfml-window-d.lib(WindowImpl.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::~_Container_base(void)" (__imp_??1_Container_base@std@@QAE@XZ)
1>sfml-graphics-d.lib(ImageLoader.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::~_Container_base(void)" (__imp_??1_Container_base@std@@QAE@XZ)
1>sfml-graphics-d.lib(GraphicsDevice.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::~_Container_base(void)" (__imp_??1_Container_base@std@@QAE@XZ)
1>sfml-window-d.lib(Window.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::~_Container_base(void)" (__imp_??1_Container_base@std@@QAE@XZ)
1>sfml-window-d.lib(VideoMode.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::~_Container_base(void)" (__imp_??1_Container_base@std@@QAE@XZ)
1>sfml-graphics-d.lib(RenderWindow.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::~_Container_base(void)" (__imp_??1_Container_base@std@@QAE@XZ) referenced in function __unwindfunclet$??0?$_Vector_val@EV?$allocator@E@std@@@std@@IAE@V?$allocator@E@1@@Z$0
1>sfml-graphics-d.lib(String.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::~_Container_base(void)" (__imp_??1_Container_base@std@@QAE@XZ)
1>sfml-graphics-d.lib(Image.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::~_Container_base(void)" (__imp_??1_Container_base@std@@QAE@XZ)
1>sfml-graphics-d.lib(FontManager.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::~_Container_base(void)" (__imp_??1_Container_base@std@@QAE@XZ)
1>sfml-window-d.lib(WindowImpl.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::_Container_base(void)" (__imp_??0_Container_base@std@@QAE@XZ) referenced in function "public: void __thiscall std::_Iterator_base::_Adopt(class std::_Container_base const *)" (?_Adopt@_Iterator_base@std@@QAEXPBV_Container_base@2@@Z)
1>sfml-graphics-d.lib(ImageLoader.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::_Container_base(void)" (__imp_??0_Container_base@std@@QAE@XZ)
1>sfml-graphics-d.lib(GraphicsDevice.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::_Container_base(void)" (__imp_??0_Container_base@std@@QAE@XZ)
1>sfml-window-d.lib(Window.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::_Container_base(void)" (__imp_??0_Container_base@std@@QAE@XZ)
1>sfml-window-d.lib(VideoMode.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::_Container_base(void)" (__imp_??0_Container_base@std@@QAE@XZ)
1>sfml-graphics-d.lib(RenderWindow.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::_Container_base(void)" (__imp_??0_Container_base@std@@QAE@XZ)
1>sfml-graphics-d.lib(String.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::_Container_base(void)" (__imp_??0_Container_base@std@@QAE@XZ)
1>sfml-graphics-d.lib(Image.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::_Container_base(void)" (__imp_??0_Container_base@std@@QAE@XZ)
1>sfml-graphics-d.lib(FontManager.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::_Container_base(void)" (__imp_??0_Container_base@std@@QAE@XZ)
1>sfml-graphics-d.lib(Image.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base::_Swap_aux(class std::_Container_base &)" (__imp_?_Swap_aux@_Container_base@std@@QAEXAAV12@@Z) referenced in function "public: void __thiscall std::vector<class sf::Color,class std::allocator<class sf::Color> >::swap(class std::vector<class sf::Color,class std::allocator<class sf::Color> > &)" (?swap@?$vector@VColor@sf@@V?$allocator@VColor@sf@@@std@@@std@@QAEXAAV12@@Z)
1>sfml-graphics-d.lib(Image.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base::_Swap_all(class std::_Container_base &)const " (__imp_?_Swap_all@_Container_base@std@@QBEXAAV12@@Z) referenced in function "public: void __thiscall std::vector<class sf::Color,class std::allocator<class sf::Color> >::swap(class std::vector<class sf::Color,class std::allocator<class sf::Color> > &)" (?swap@?$vector@VColor@sf@@V?$allocator@VColor@sf@@@std@@@std@@QAEXAAV12@@Z)
1>C:\Daniel\sfml12test\Debug\sfml12test.exe : fatal error LNK1120: 5 unresolved externals
1>Build log was saved at "file://c:\Daniel\sfml12test\sfml12test\Debug\BuildLog.htm"
1>sfml12test - 29 error(s), 1 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========


Sorry for being a pain in the ass with all these linker errors, they are haunting me.

22
General / Errors using VS 2008
« on: December 16, 2007, 09:29:18 pm »
I upgraded to VS 2008 last week, and now SFML won't work. I get a bunch of unresolved external errors even though I'm 99.9% sure I installed it the same way as I did for VS 2005 EE. I have followed the steps in the guide at the website.

Does anyone else use VS 2008? Have I missed something or is it because of VS 2008?

23
General discussions / Improved font handling?
« on: November 26, 2007, 07:11:40 pm »
Hi, I was wondering if you are planing to improve how small fonts are displayed? It's very important for me to be able to draw small fonts (for example size 12) in my current project, they are displayed very poorly right now. I've tried like 50 different fonts with the same result.

Keep up the good work!

24
General / Best way to draw a lot of text
« on: October 04, 2007, 10:41:18 am »
Hi, I hope this is the right place to put this...

I'm thinking of starting a manager game project (a lite version of Football Manager, Eastside Hockey Manager etc.). Those kind of games show a lot of info on the screen at the same time, how would you do it? It feels like I'm gonna need a million :) instances of the String class.

For example when you show the roster, for each player I would need to show name, birthdate and year, length, weight, morale, all his atributes(shooting, skating, passing etc.) the list goes on.

All thoughts are welcome.

25
Graphics / Transparency
« on: October 01, 2007, 09:37:20 pm »
Is it possible to set an entire image to become half transparent, not only a certain color?

26
Graphics / Error loading image
« on: September 30, 2007, 09:36:25 pm »
I'm trying to load a jpg image (1024x768), there's nothing wrong when I build the project in VS C++ 2005, but when I try to run it this error message shows up:

"Unhandled exception at 0x1023ee40 in first_ex.exe: 0xC0000005: Access violation reading location 0x097f1000."

This is the code I'm using:

Code: [Select]
sf::Image ImgBgr;
if (!ImgBgr.LoadFromFile("./background2.jpg"))
{
cout << "error loading image." << endl;
                return EXIT_FAILURE;
}

sf::Sprite SprBgr(ImgBgr, 0, 0);
App.Draw(SprBgr);


Other images load successfully but this one won't, I've tried other image formats too but nothing works. Any idea what's wrong?

Edit: I forgot to mention that in debug mode, it shows that the problem is on the line where I call the LoadFromFile-function.

Pages: 1 [2]
anything