Giter Site home page Giter Site logo

box2d-and-sfml-demo's Introduction

Box2d and SFML demo

About

This little project is a demo of the merge of two great libs, SFML and Box2D

Dependencies

Screenshot

Box2D-and-SML-demo screenshot

Build & execute

GNU/Linux

mkdir ./build
cd ./build
cmake ..
make
make install
cd ../
./box2dsfml

Windows

You need a compiler like Mingw and CMake In windows you have to set the env variables. To do this, add to the PATH the location of this 4 paths

  • The lib directory of SFML (Where the SFML libs are: "*.a, *.dll ...")
  • The headers directory of SFML (Where "SFML" folder is)
  • The lib directory of where Box2D lib file is (For example: libBox2D.a)
  • The headers directory of Box2D (Where "Box2D" folder is)

The PATH variable you should add (note: add ';' at the front) at the end of the PATH is something like this (Note that my Box2D lib is in the same folder of the Box2D header dir so I only add one path for the box2D)

C:\sources\SFML-1.6\include;C:\sources\SFML-1.6\lib;C:\sources\Box2D_v2.1.2_bin

Then use the same way to compile as in GNU/Linux (for example with mingw32-make)

mkdir ./build
[run cmake-gui]
[select project and build dir]
[push generate]
[enter with cmd in build dir]
mingw32-make
mingw32-make install
[if install fails, copy the executable in '/build/src/box2dsfml' to the root of the project (where resources folder is)]

Features

  • Materials
  • Dinamyc and static bodies (Box and circles)
  • Debug information (body count, contacts...)
  • Box2D debugDraw implementation for SFML
  • Mouse and key events to interact with the world
  • Mouse joint implemented to grab bodies
  • CMake build script

Author

Xabier (sLoK) Larrakoetxea [slok69 [at] gmail.com]

License

GPL V3

box2d-and-sfml-demo's People

Contributors

slok avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.