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.
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.
no matching function for call to 'Collision::BoundingBoxTest(sf::Shape&, sf::Shape&)
Maybe start with a beginner's C++ book, it's rather basic knowledge.
Sprite.Resize(VideoMode.X, VideoMode.Y);
?
Sprite.Scale((float)Window.GetWidth()/(float)Sprite.GetImage()->GetWidth(), (float)Window.GetHeight()/(float)Sprite.GetImage()->GetHeight());
Sprite.Resize(Window.GetWidth(), Window.GetHeight());
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()
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();
}
};