Skip to content
forked from erincatto/box2d

Tutorial de como ejecutar y agregar pruebas a la Testbed de Box2D

License

Notifications You must be signed in to change notification settings

milemarchese/Box2D

 
 

Repository files navigation

Box2D

How to use Box2D Testbed

./premake5 gmake
./build.sh

How to add your own test

  • In "Testbed/Tests" add your new file .h, e.g "FooTest.h"

  • Your file must look like this

#ifndef FOOTEST_H
#define FOOTEST_H

class FooTest : public Test {

public:

//additional classes can go here

FooTest() {
    //your code
  }

void Step(Settings* settings) {
    Test::Step(settings);

    //show some text in the main screen
    g_debugDraw.DrawString(5, m_textLine, "My test");
    m_textLine += 15;
  }
    
static Test* Create() {
    return new FooTest;
  }
  
};

#endif
  • Go TestEntries.cpp

First, in the header add:

#include "FooTest.h

Then,

TestEntry g_testEntries[] =
{{"Foo test" , FooTest::Create}, //your file
{"Shape Cast", ShapeCast::Create}, //default tests...

Build again and success!

License

Box2D is developed by Erin Catto, and has the zlib license. While the zlib license does not require acknowledgement, we encourage you to give credit to Box2D in your product.

About

Tutorial de como ejecutar y agregar pruebas a la Testbed de Box2D

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 47.8%
  • C++ 46.2%
  • Objective-C 4.7%
  • Objective-C++ 0.7%
  • C# 0.5%
  • Lua 0.1%