victorfisac / Physac

2D physics header-only library for videogames developed in C using raylib library.
http://www.victorfisac.com/physac
MIT License
432 stars 28 forks source link

No physics calculations in example programs #43

Closed interkosmos closed 4 years ago

interkosmos commented 4 years ago

The examples in examples/ run, but no physics calulcations are applied. Tried current master branch on FreeBSD 12.1, with raylib 3.0.0 from ports:

# pkg install devel/raylib

Building and running (with raymath.h in src/):

$ gcc -I/usr/local/include/ -L/usr/local/lib/ -I../src/ -o demo physics_demo.c -lm -lpthread -lraylib
$ ./demo
INFO: Initializing raylib 3.0
INFO: DISPLAY: Device initialized successfully
INFO:     > Display size: 1920 x 1080
INFO:     > Render size:  800 x 450
INFO:     > Screen size:  800 x 450
INFO:     > Viewport offsets: 0, 0
INFO: GLAD: OpenGL extensions loaded successfully
INFO: GL: OpenGL 3.3 Core profile supported
INFO: GL: OpenGL device information:
INFO:     > Vendor:   Intel Open Source Technology Center
INFO:     > Renderer: Mesa DRI Intel(R) HD Graphics 620 (Kaby Lake GT2) 
INFO:     > Version:  4.5 (Core Profile) Mesa 19.0.8
INFO:     > GLSL:     4.50
INFO: GL: Supported extensions count: 204
INFO: GL: DXT compressed textures supported
INFO: GL: ETC2/EAC compressed textures supported
INFO: GL: Anisotropic textures filtering supported (max: 16X)
INFO: TEXTURE: [ID 1] Texture created successfully (1x1 - 1 mipmaps)
INFO: TEXTURE: [ID 1] Default texture loaded successfully
INFO: SHADER: [ID 1] Compiled successfully
INFO: SHADER: [ID 2] Compiled successfully
INFO: SHADER: [ID 3] Program loaded successfully
INFO: SHADER: [ID 3] Default shader loaded successfully
INFO: RLGL: Internal vertex buffers initialized successfully in RAM (CPU)
INFO: RLGL: Internal vertex buffers uploaded successfully to VRAM (GPU)
INFO: RLGL: Default state initialized successfully
INFO: TEXTURE: [ID 2] Texture created successfully (128x128 - 1 mipmaps)
INFO: FONT: Default font loaded successfully
[PHYSAC] physics module initialized successfully
[PHYSAC] physics thread created successfully
[PHYSAC] created polygon physics body id 0
[PHYSAC] created polygon physics body id 1
INFO: TIMER: Target time per frame: 16.667 milliseconds
[PHYSAC] created polygon physics body id 2
[PHYSAC] created polygon physics body id 3
[PHYSAC] created polygon physics body id 4
[PHYSAC] destroyed physics body id 4
[PHYSAC] destroyed physics body id 3
[PHYSAC] destroyed physics body id 2
[PHYSAC] destroyed physics body id 1
[PHYSAC] destroyed physics body id 0
[PHYSAC] physics module closed successfully
INFO: TEXTURE: [ID 2] Unloaded texture data from VRAM (GPU)
INFO: TEXTURE: [ID 1] Unloaded default texture data from VRAM (GPU)
INFO: Window closed successfully

The bodies are created on mouse click events, but they do not seem to move.

interkosmos commented 4 years ago

Found the reseaon: the #if defined(__linux__) pre-processor statements should be better replaced by #if defined(__unix__) to be compatible to FreeBSD.