Skip to content

Commit

Permalink
Update box2c submodule and fix issue where function pointer bindings …
Browse files Browse the repository at this point in the history
…were incorrectly generated
  • Loading branch information
BeanCheeseBurrito committed Jun 29, 2024
1 parent bcf2548 commit 905f42d
Show file tree
Hide file tree
Showing 9 changed files with 475 additions and 1,517 deletions.
2 changes: 1 addition & 1 deletion Box2D.NET.Bindgen/Box2D.NET.Bindgen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Bindgen.NET" Version="0.1.9"/>
<PackageReference Include="Bindgen.NET" Version="0.1.13"/>
</ItemGroup>

</Project>
18 changes: 3 additions & 15 deletions Box2D.NET.Bindgen/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,11 @@

TreatInputFileAsRawSourceCode = true,
InputFile = """
#include <box2d/api.h>
#include <box2d/base.h>
#include <box2d/box2d.h>
#include <box2d/callbacks.h>
#include <box2d/color.h>
#include <box2d/constants.h>
#include <box2d/debug_draw.h>
#include <box2d/distance.h>
#include <box2d/dynamic_tree.h>
#include <box2d/event_types.h>
#include <box2d/geometry.h>
#include <box2d/hull.h>
#include <box2d/collision.h>
#include <box2d/id.h>
#include <box2d/joint_types.h>
#include <box2d/manifold.h>
#include <box2d/math.h>
#include <box2d/math_types.h>
#include <box2d/timer.h>
#include <box2d/math_functions.h>
#include <box2d/types.h>
""",
OutputFile = GetOutputDirectory("B2.g.cs"),
Expand Down
1,945 changes: 458 additions & 1,487 deletions Box2D.NET.Bindings/B2.g.cs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Box2D.NET.Bindings/Box2D.NET.Bindings.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<IsPackable>true</IsPackable>
<IncludeContentInPack>true</IncludeContentInPack>

<Version>0.0.7</Version>
<Version>0.0.8</Version>
<Title Condition="'$(Configuration)' == 'Debug'">Box2D.NET.Bindings.Debug</Title>
<Title Condition="'$(Configuration)' == 'Release'">Box2D.NET.Bindings.Release</Title>
<Authors>BeanCheeseBurrito</Authors>
Expand Down
2 changes: 1 addition & 1 deletion Box2D.NET.Native/Box2D.NET.Native.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<IsPackable>true</IsPackable>
<IncludeContentInPack>true</IncludeContentInPack>

<Version>0.0.7</Version>
<Version>0.0.8</Version>
<Title Condition="'$(Configuration)' == 'Debug'">Box2D.NET.Native.Debug</Title>
<Title Condition="'$(Configuration)' == 'Release'">Box2D.NET.Native.Release</Title>
<Authors>BeanCheeseBurrito</Authors>
Expand Down
8 changes: 4 additions & 4 deletions Box2D.NET.Native/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub fn compileLibrary(b: *Build, lib: *Build.Step.Compile) void {
"../native/box2c/src/allocate.c",
"../native/box2c/src/array.c",
"../native/box2c/src/bitset.c",
"../native/box2c/src/block_allocator.c",
"../native/box2c/src/block_array.c",
"../native/box2c/src/body.c",
"../native/box2c/src/broad_phase.c",
"../native/box2c/src/constraint_graph.c",
Expand All @@ -31,18 +31,18 @@ pub fn compileLibrary(b: *Build, lib: *Build.Step.Compile) void {
"../native/box2c/src/dynamic_tree.c",
"../native/box2c/src/geometry.c",
"../native/box2c/src/hull.c",
"../native/box2c/src/implementation.c",
"../native/box2c/src/id_pool.c",
"../native/box2c/src/island.c",
"../native/box2c/src/joint.c",
"../native/box2c/src/manifold.c",
"../native/box2c/src/math.c",
"../native/box2c/src/math_functions.c",
"../native/box2c/src/motor_joint.c",
"../native/box2c/src/mouse_joint.c",
"../native/box2c/src/pool.c",
"../native/box2c/src/prismatic_joint.c",
"../native/box2c/src/revolute_joint.c",
"../native/box2c/src/shape.c",
"../native/box2c/src/solver.c",
"../native/box2c/src/solver_set.c",
"../native/box2c/src/stack_allocator.c",
"../native/box2c/src/table.c",
"../native/box2c/src/timer.c",
Expand Down
11 changes: 5 additions & 6 deletions Box2D.NET.Tests/WorldTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ public unsafe class WorldTests
[Fact]
public void HelloWorld()
{
// Define the gravity vector.
B2.Vec2 gravity = new B2.Vec2 { x = 0.0f, y = -10.0f };

// Construct a world object, which will hold and simulate the rigid bodies.
B2.WorldDef worldDef = B2.DefaultWorldDef();
worldDef.gravity = gravity;
worldDef.gravity = new B2.Vec2 { x = 0.0f, y = -10.0f };

B2.WorldId worldId = B2.CreateWorld(&worldDef);
Assert.True(B2.WorldIsValid(worldId) != 0);

// Define the ground body.
B2.BodyDef groundBodyDef = B2.DefaultBodyDef();
Expand All @@ -25,14 +23,15 @@ public void HelloWorld()
// Call the body factory which allocates memory for the ground body
// from a pool and creates the ground box shape (also from a pool).
// The body is also added to the world.
B2.BodyId groundBodyId = B2.CreateBody(worldId, &groundBodyDef);
B2.BodyId groundId = B2.CreateBody(worldId, &groundBodyDef);
Assert.True(B2.BodyIsValid(groundId) != 0);

// Define the ground box shape. The extents are the half-widths of the box.
B2.Polygon groundBox = B2.MakeBox(50.0f, 10.0f);

// Add the box shape to the ground body.
B2.ShapeDef groundShapeDef = B2.DefaultShapeDef();
B2.CreatePolygonShape(groundBodyId, &groundShapeDef, &groundBox);
B2.CreatePolygonShape(groundId, &groundShapeDef, &groundBox);

// Define the dynamic body. We set its position and call the body factory.
B2.BodyDef bodyDef = B2.DefaultBodyDef();
Expand Down
2 changes: 1 addition & 1 deletion Box2D.NET/Box2D.NET.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<IsPackable>true</IsPackable>
<IncludeContentInPack>true</IncludeContentInPack>

<Version>0.0.7</Version>
<Version>0.0.8</Version>
<Title Condition="'$(Configuration)' == 'Debug'">Box2D.NET.Debug</Title>
<Title Condition="'$(Configuration)' == 'Release'">Box2D.NET.Release</Title>
<Authors>BeanCheeseBurrito</Authors>
Expand Down
2 changes: 1 addition & 1 deletion native/box2c
Submodule box2c updated 180 files

0 comments on commit 905f42d

Please sign in to comment.