Ok, checked my debug/release confguration, read the post, tried some things but it's still not working
Here is some info :
OS: Windows 8.1
Graphics card: NVIDIA GeForce GTX 670
SFML version: latest snapshot(i have compiled it)
Compiler: GCC(MinGW) 4.8.1
Note: the application doesn't crash, i just cannot shoot bullets in release mode, while i can in debug mode
The basic bullet code
#include <SFML/Graphics.hpp>
#include <list>
std::list<Bullet> bullets;
sf::Sprite sprite; //player-sprite
sf::RenderWindow window(sf::VideoMode(1200, 800), "Test", sf::Style::Titlebar | sf::Style::Close);
int main()
{
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
switch (event.type)
{
case sf::Event::Closed:
window.close();
break;
case sf::Event::MouseButtonReleased:
fire();
break;
}
}
draw();
}
}
void fire()
{
sf::Vector2i mouse_pos = sf::Mouse::getPosition(window);
sf::Vector2f curPos = sprite.getPosition();
float angle = atan2(mouse_pos.y - curPos.y, mouse_pos.x - curPos.x) * (180 / PI);
Bullet bullet(curPos, angle, 800.0f, 300.0f); //start-position, angle, start-speed, acceleration
bullet.sprite.setFillColor(sf::Color::Red);
bullets.push_back(bullet);
}
void draw()
{
for (Bullet bullet : bullets)
{
bullet.Update(time);
window->draw(bullet.sprite);
}
}