Skip to content

Commit

Permalink
Merge pull request #25 from Birch-san/more-benchmark-samples
Browse files Browse the repository at this point in the history
more benchmark samples - memory profiling
  • Loading branch information
ErikSom authored Jan 27, 2025
2 parents c548856 + 77e481a commit 155eeaa
Show file tree
Hide file tree
Showing 36 changed files with 2,302 additions and 1,114 deletions.
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[submodule "box2d"]
path = box2d
url = https://github.com/Birch-san/box2d.git
branch = birch
url = https://github.com/erincatto/box2d.git
branch = main
[submodule "box2cpp"]
path = box2cpp
url = https://github.com/Birch-san/box2cpp.git
Expand Down
2 changes: 1 addition & 1 deletion box2d
Submodule box2d updated 76 files
+4 −5 .github/workflows/build.yml
+4 −6 CMakeLists.txt
+3 −4 README.md
+1 −1 benchmark/CMakeLists.txt
+119 −20 benchmark/main.c
+2 −0 docs/FAQ.md
+2 −2 docs/overview.md
+38 −18 docs/simulation.md
+11 −20 include/box2d/base.h
+24 −18 include/box2d/box2d.h
+47 −83 include/box2d/collision.h
+10 −10 include/box2d/id.h
+1 −1 include/box2d/math_functions.h
+75 −62 include/box2d/types.h
+68 −63 samples/draw.cpp
+2 −2 samples/draw.h
+16 −13 samples/main.cpp
+86 −97 samples/sample.cpp
+8 −7 samples/sample.h
+27 −17 samples/sample_benchmark.cpp
+13 −1 samples/sample_bodies.cpp
+50 −77 samples/sample_collision.cpp
+257 −12 samples/sample_continuous.cpp
+201 −1 samples/sample_events.cpp
+2 −3 samples/sample_joints.cpp
+20 −2 samples/sample_shapes.cpp
+1 −1 samples/sample_stacking.cpp
+0 −2 samples/sample_world.cpp
+3 −0 samples/settings.cpp
+1 −0 samples/settings.h
+3 −0 samples/shader.cpp
+27 −7 shared/benchmarks.c
+2 −1 shared/benchmarks.h
+2 −2 shared/random.h
+14 −7 src/CMakeLists.txt
+17 −26 src/arena_allocator.c
+48 −0 src/arena_allocator.h
+3 −0 src/array.h
+98 −28 src/body.c
+3 −1 src/body.h
+14 −0 src/box2d.natvis
+35 −32 src/broad_phase.c
+1 −1 src/broad_phase.h
+4 −0 src/constants.h
+92 −135 src/contact.c
+1 −11 src/contact.h
+5 −4 src/contact_solver.c
+3 −2 src/core.c
+13 −1 src/core.h
+21 −23 src/distance.c
+182 −114 src/dynamic_tree.c
+16 −16 src/geometry.c
+3 −5 src/id_pool.c
+1 −1 src/id_pool.h
+8 −15 src/island.c
+20 −65 src/joint.c
+45 −1 src/joint.h
+48 −48 src/manifold.c
+2 −2 src/math_functions.c
+3 −3 src/revolute_joint.c
+368 −0 src/sensor.c
+36 −0 src/sensor.h
+122 −78 src/shape.c
+16 −4 src/shape.h
+198 −168 src/solver.c
+4 −4 src/solver_set.c
+0 −38 src/stack_allocator.h
+20 −15 src/table.c
+1 −1 src/table.h
+67 −113 src/timer.c
+3 −3 src/types.c
+155 −147 src/world.c
+11 −4 src/world.h
+1 −1 test/CMakeLists.txt
+9 −8 test/test_table.c
+67 −98 test/test_world.c
3 changes: 2 additions & 1 deletion box2d3-wasm/csrc/debugDraw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,13 @@ class DebugDrawCommandBuffer {
self->commands.push_back(cmd);
};

debugDraw.DrawString = [](b2Vec2 p, const char* s, void* context) {
debugDraw.DrawString = [](b2Vec2 p, const char* s, b2HexColor color, void* context) {
auto* self = static_cast<DebugDrawCommandBuffer*>(context);
if (self->commands.size() >= self->maxCommands) return;

DebugDrawCommand cmd;
cmd.commandType = DebugDrawCommandType::e_string;
cmd.color = color;
cmd.vertexCount = 1;

cmd.data[0] = p.x;
Expand Down
469 changes: 267 additions & 202 deletions box2d3-wasm/csrc/glue.cpp

Large diffs are not rendered by default.

Loading

0 comments on commit 155eeaa

Please sign in to comment.