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.


Messages - Xander314

Pages: 1 2 3 [4] 5
46
Audio / Music Error
« on: June 11, 2011, 09:13:35 am »
Don't think SFML supports MP3, probably for licensing reasons. Consider using OGG files instead.

47
General / Where are the DLLs?
« on: June 02, 2011, 01:55:53 pm »
You must put all used DLLs in your project folder (or maybe your debug/release folder).

This may not be mentioned in the tutorials (I am not sure), but it's true for all DLLs, not just SFML - if they aren't in a system DLL folder, they must be in your project folder.

EDIT: To the guy with header file problems: this must be fixed by adding the SFML header file directory (sfml_root_directory/include) to your compiler search directories.

In Code::Blocks: Settings -> Compiler and Debugger -> Global Compiler Settings -> Search Directories -> Compiler -> Add -> enter the path.

48
General / OpenGL static linking
« on: June 02, 2011, 01:49:58 pm »
Why can't you install drivers? Because it needs to be compatible with lots of systems? An OpenGL driven library obviously will only run on systems with OpenGL.

EDIT: I think Laurent was saying that you can't package the OpenGL dll, as the implementation is hardware dependent.

49
General / Help with collision!
« on: May 31, 2011, 12:18:58 am »
I just looked at the page for sf::Collision. It accepts two references to sf::Sprite, not two references to sf::Shape, hence the error - the compiler tells you that there is
Code: [Select]
no matching function for call to 'Collision::BoundingBoxTest(sf::Shape&, sf::Shape&)
because there is no such function.

See here: http://www.sfml-dev.org/wiki/en/sources/simple_collision_detection

Your other code is not solving the problem, merely masking it with a more fundamental problem.

EDIT:
Quote
Maybe start with a beginner's C++ book, it's rather basic knowledge.

If you don't want to buy a book:
http://www.cplusplus.com/doc/tutorial/

50
Graphics / Fitting Sprite to Window on Resize
« on: May 28, 2011, 02:16:34 pm »
Thanks for your help and speedy replies as usual :D

51
SFML website / Post Reply button redirects to Forum Index
« on: May 28, 2011, 12:32:10 pm »
Frequently, when I click the "Post Reply" button at the bottom of a thread, I am simply redirected to the main forum index.

I am using Windows 7 & Google Chrome 11.0.696.71. I didn't seem to experience the issue with IE8.

Is anyone else having such a problem?

52
Graphics / Fitting Sprite to Window on Resize
« on: May 28, 2011, 12:31:46 pm »
Strictly speaking therefore, should my resize operation be this instread:
Code: [Select]
Sprite.Resize(VideoMode.X, VideoMode.Y);?

53
Graphics / Fitting Sprite to Window on Resize
« on: May 28, 2011, 12:13:20 pm »
I was resizing my sprite to fit my window using:
Code: [Select]
Sprite.Scale((float)Window.GetWidth()/(float)Sprite.GetImage()->GetWidth(), (float)Window.GetHeight()/(float)Sprite.GetImage()->GetHeight());
and then
Code: [Select]
Sprite.Resize(Window.GetWidth(), Window.GetHeight());
when the sf::Event::Resize event is dispatched.

However, I have noticed that when I resize the window smaller than the video mode, the sprite no longer fits the screen. Why is this? And is there anything I can do about it?

Also, for the sf::Event::Resize event, what is the relevance of the values Event::Size::Width and Event::Size::Height. Surely they are the same as the values returned by Window::GetWidth() and Window::GetHeight()?

54
General / Multithreading, splash screens and sf::Sprites
« on: May 20, 2011, 06:34:48 pm »
Update: I just put exactly the same code in a new solution file in Visual C++ Express, and it worked, so I have no idea what the problem was.

55
General / Multithreading, splash screens and sf::Sprites
« on: May 20, 2011, 04:29:54 pm »
Strange. I've just tried building with MinGW, and it does work then. Must be something to do with MSVC++ then :S

56
General / Multithreading, splash screens and sf::Sprites
« on: May 20, 2011, 03:54:33 pm »
Copied and pasted below (sorry it's a bit messy).

[edit]This was from Visual C++; there was a yellow arrow on the top line (I assume this indicates the exception position) and a green arrow on the first line with System.exe (which is my executable file).

Quote

ntdll.dll!77c40474()    
    [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]   
    ntdll.dll!77c029c0()    
    ntdll.dll!77bbcd77()    
>   System.exe!std::_Tree<std::_Tset_traits<sf::ResourcePtr<sf::Image> *,std::less<sf::ResourcePtr<sf::Image> *>,std::allocator<sf::ResourcePtr<sf::Image> *>,0> >::erase(sf::ResourcePtr<sf::Image> * const & _Keyval)  Line 1398 + 0x57 bytes   C++
    System.exe!sf::Resource<sf::Image>::Disconnect(sf::ResourcePtr<sf::Image> & observer)  Line 78   C++
    System.exe!sf::ResourcePtr<sf::Image>::~ResourcePtr<sf::Image>()  Line 61   C++
    System.exe!sf::Sprite::~Sprite()  + 0x57 bytes   C++
    System.exe!Icanos::System::SplashScreen::Execute()  Line 31 + 0x21 bytes   C++
    System.exe!sf::priv::ThreadMemberFunc<Icanos::System::SplashScreen>::Run()  Line 58 + 0x33 bytes   C++
    sfml-system-d-2.dll!685b07b6()    
    sfml-system-d-2.dll!685b0ef9()    
    sfml-system-d-2.dll!685bad43()    
    sfml-system-d-2.dll!685bace4()    
    kernel32.dll!773433ca()    
    ntdll.dll!77ba9ed2()    
    ntdll.dll!77ba9ea5()

57
General / Multithreading, splash screens and sf::Sprites
« on: May 20, 2011, 03:36:40 pm »
I am writing a splash screen class to display while loading. I want it to be created on the main thread and then display itself on a separate thread until I tell it to quit.

This was working fine. However, I also want to display an image in this splash screen window, so I need an sf::Sprite. However, whenever I add the sf::Sprite, the program crashes when it's destructor is called (saying Windows has triggered a breakpoint).

Here is my code; any help fixing this problem would be greatly appreciated :D

Code: [Select]

class SplashScreen {
sf::Image Image;
sf::Font Font;
sf::Thread* Thread;
bool Running;
unsigned Width, Height;
const std::string Caption, Heading;

void Execute()
{
sf::Sprite bg(Image);
bg.Scale((float)Width/(float)Image.GetWidth(), (float)Height/(float)Image.GetHeight());
Running = true;
sf::RenderWindow Window(sf::VideoMode(Width, Height, 32), Caption, sf::Style::None);
while (Running)
{
Window.Draw(bg);
Window.Display();
}
}

public:
SplashScreen(unsigned Width, unsigned Height, const std::string& Heading, const std::string& Caption, const std::string& ImageFilename, const std::string& FontFilename = "arial.ttf")
: Width(Width), Height(Height), Caption(Caption), Heading(Heading)
{
if (!Image.LoadFromFile(ImageFilename))
throw Exceptions::BadFile(ImageFilename);

if (!Font.LoadFromFile(FontFilename))
throw Exceptions::BadFile(FontFilename);

Thread = new (std::nothrow) sf::Thread(&SplashScreen::Execute, this);
if (!Thread)
throw Exceptions::BadAllocation();
}
~SplashScreen()
{
Stop();
delete Thread;
}
void Run()
{
Thread->Launch();
}
void Stop()
{
Running = false;
Thread->Wait();
}
};

58
General / SFML Static libraries and /NODEFAULTLIB
« on: May 14, 2011, 03:53:09 pm »
Okay I'll do that then. Thanks for the quick reply :)

59
General / SFML Static libraries and /NODEFAULTLIB
« on: May 14, 2011, 03:16:26 pm »
I built the static SFML binaries in Visual Studio. However, when I try to link them get a warning:
warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library   

Having done a bit of research, I checked the runtime libraries used in each case. However both the SFML projects and my project use multithreaded debug DLL for debug config, and multithreaded DLL for release config.

So the used runtime libraries match and yet I still get this error. Does anyone have any idea why?

Thanks in advance for your help, and sorry if this has been asked before and I missed the answer: I did look around, but nowhere did there seem to be a straightforward solution...

60
System / Overhead of sf::Thread::Launch
« on: April 24, 2011, 05:25:30 pm »
If you do try it, can let us know how it goes - I too would be interested in how big the actual performance losses are.

Pages: 1 2 3 [4] 5
anything