summaryrefslogtreecommitdiffhomepage
path: root/examples/physac/physics_demo.c
diff options
context:
space:
mode:
authorPablo Marcos Oltra <[email protected]>2018-07-29 13:09:30 +0200
committerPablo Marcos Oltra <[email protected]>2018-07-29 21:32:39 +0200
commit907e27ef4e7a4220142e9e7ccfe711ae86dd6a4e (patch)
tree1829443c7f811914d75a626aa1b60c657a4b76a4 /examples/physac/physics_demo.c
parente82505b873370b8f3a914a079062c21e64353210 (diff)
downloadraylib-907e27ef4e7a4220142e9e7ccfe711ae86dd6a4e.tar.gz
raylib-907e27ef4e7a4220142e9e7ccfe711ae86dd6a4e.zip
Fix Physac examples to be run without creating new thread
Diffstat (limited to 'examples/physac/physics_demo.c')
-rw-r--r--examples/physac/physics_demo.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/physac/physics_demo.c b/examples/physac/physics_demo.c
index 273b9931..d417efec 100644
--- a/examples/physac/physics_demo.c
+++ b/examples/physac/physics_demo.c
@@ -17,6 +17,7 @@
#include "raylib.h"
#define PHYSAC_IMPLEMENTATION
+#define PHYSAC_NO_THREADS
#include "physac.h"
int main()
@@ -54,6 +55,8 @@ int main()
// Update
//----------------------------------------------------------------------------------
// Delay initialization of variables due to physics reset async
+ RunPhysicsStep();
+
if (needsReset)
{
floor = CreatePhysicsBodyRectangle((Vector2){ screenWidth/2, screenHeight }, 500, 100, 10);
@@ -61,6 +64,8 @@ int main()
circle = CreatePhysicsBodyCircle((Vector2){ screenWidth/2, screenHeight/2 }, 45, 10);
circle->enabled = false;
+
+ needsReset = false;
}
// Reset physics input
@@ -134,4 +139,3 @@ int main()
return 0;
}
-