summaryrefslogtreecommitdiffhomepage
path: root/examples/physac/physics_friction.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/physac/physics_friction.c')
-rw-r--r--examples/physac/physics_friction.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/examples/physac/physics_friction.c b/examples/physac/physics_friction.c
index db1b5f4c..9472729a 100644
--- a/examples/physac/physics_friction.c
+++ b/examples/physac/physics_friction.c
@@ -2,9 +2,11 @@
*
* Physac - Physics friction
*
-* NOTE: Physac requires multi-threading, when InitPhysics() a second thread is created to manage physics calculations.
+* NOTE 1: Physac requires multi-threading, when InitPhysics() a second thread is created to manage physics calculations.
+* NOTE 2: Physac requires static C library linkage to avoid dependency on MinGW DLL (-static -lpthread)
+*
+* Use the following line to compile:
*
-* Use the following code to compile (-static -lpthread):
* gcc -o $(NAME_PART).exe $(FILE_NAME) -s $(RAYLIB_DIR)\raylib\raylib_icon -static -lraylib -lpthread
* -lglfw3 -lopengl32 -lgdi32 -lopenal32 -lwinmm -std=c99 -Wl,--subsystem,windows -Wl,-allow-multiple-definition
*
@@ -15,7 +17,7 @@
#include "raylib.h"
#define PHYSAC_IMPLEMENTATION
-#include "../src/physac.h"
+#include "physac.h"
int main()
{
@@ -26,7 +28,6 @@ int main()
SetConfigFlags(FLAG_MSAA_4X_HINT);
InitWindow(screenWidth, screenHeight, "Physac [raylib] - Physics friction");
- SetTargetFPS(60);
// Physac logo drawing position
int logoX = screenWidth - MeasureText("Physac", 30) - 10;
@@ -61,6 +62,8 @@ int main()
bodyB->staticFriction = 1;
bodyB->dynamicFriction = 1;
SetPhysicsBodyRotation(bodyB, 330*DEG2RAD);
+
+ SetTargetFPS(60);
//--------------------------------------------------------------------------------------
// Main game loop
@@ -132,8 +135,10 @@ int main()
// De-Initialization
//--------------------------------------------------------------------------------------
ClosePhysics(); // Unitialize physics
+
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}
+