Category : sfml

I’ve followed several tutorials for linking SFML perfectly. I’ve added the include directory, added libraries, and copied the dlls into the project folder. I’ve tried different versions and architectures. I’ve tried using openal32.lib (with its dll) and sfml-main.lib as well. However, I keep getting an error in Rect.inl saying: Severity Code Description File Line Error ..

Read more

We (school) are developping a game in C++ with SFML. The game is a fight game, where we need to play little sounds when the player gets hit for exemple. I’m attempting to play a sf::Sound in a loop. I know we should not call the play() method of sf::Sound in a loop, but as ..

Read more

My code is just simple c++ using SFML library. Main.cpp #include <iostream> #include <SFML/Audio.hpp> #include <SFML/Graphics.hpp> #include <array> #include "board.h" void Board::load(sf::Color col1, sf::Color col2) { for (int i=0; i<8;i++) { bool tmpColor=((i%2)==0)?true:false; for(int j=0; j<8;j++) { m_boardSquares[j + (i * 8)].setPosition(sf::Vector2f( j*64.f , i*64.f )); m_boardSquares[j + (i * 8)].setSize(sf::Vector2f(64.f, 64.f)); m_boardSquares[j + (i ..

Read more

lately I started playing with box2d and tried abstracting it to class RigidBody::RigidBody() { } RigidBody::RigidBody(const RigidBody& other) { m_fixture = other.m_fixture; b2BodyDef bodyDef; bodyDef.position = other.m_body->GetPosition(); bodyDef.type = other.m_body->GetType(); m_body = Runtime::PhysicsWorld.CreateBody(&bodyDef); b2FixtureDef fixtureDef; fixtureDef.shape = m_fixture->GetShape(); fixtureDef.density = m_fixture->GetDensity(); fixtureDef.friction = m_fixture->GetFriction(); fixtureDef.restitution = m_fixture->GetRestitution(); fixtureDef.restitutionThreshold = m_fixture->GetRestitutionThreshold(); m_fixture = m_body->CreateFixture(&fixtureDef); } RigidBody::RigidBody(sf::Vector2f ..

Read more