https://github.com/slok/box2d-and-sfml-demo
Box2D and SFML Demo, with DebugDraw implemented with SFML
https://github.com/slok/box2d-and-sfml-demo
Last synced: 7 months ago
JSON representation
Box2D and SFML Demo, with DebugDraw implemented with SFML
- Host: GitHub
- URL: https://github.com/slok/box2d-and-sfml-demo
- Owner: slok
- Created: 2011-01-12T20:54:37.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2016-09-28T20:25:12.000Z (about 9 years ago)
- Last Synced: 2025-03-19T08:39:32.217Z (7 months ago)
- Language: C++
- Homepage:
- Size: 9.47 MB
- Stars: 35
- Watchers: 3
- Forks: 12
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Box2d and SFML demo
===================About
-----
This little project is a demo of the merge of two great libs, SFML and Box2DDependencies
------------
* [SFML](http://www.sfml-dev.org/) >= 1.6
* [Box2D](http://www.box2d.org/) >= 2.1.2Screenshot
-------------
Build & execute
---------------
### GNU/Linuxmkdir ./build
cd ./build
cmake ..
make
make install
cd ../
./box2dsfml
### Windows
You need a compiler like [Mingw](http://www.mingw.org/) and [CMake](http://www.cmake.org/)
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 scriptAuthor
------
Xabier (sLoK) Larrakoetxea [slok69 [at] gmail.com]License
-------
[GPL V3](http://www.gnu.org/licenses/gpl-3.0.html)