Re: dchip is a D2 port of the Chipmunk2D physics library for 2D games

2013-11-12 Thread Andrej Mitrovic
On 11/12/13, Sergei Nosov sergei.no...@gmail.com wrote: For some reason, DMD (v2.064.2) fails to compile with that flag. The error is: Internal error: ../ztc/cg87.c 331 Error: DMD compile run failed with exit code 1 Aww. If only dub knew how to automatically run dustmite. LDC slows down for

Re: dchip is a D2 port of the Chipmunk2D physics library for 2D games

2013-11-12 Thread Dicebot
On Tuesday, 12 November 2013 at 15:39:27 UTC, Andrej Mitrovic wrote: Btw, how did you make dub use a -version flag anyway? I can't figure it out from the docs. I suppose it's something like: dub --build=release --version=? But I see that --version means something else in dub. It is done via

Re: dchip is a D2 port of the Chipmunk2D physics library for 2D games

2013-11-12 Thread Sönke Ludwig
Am 12.11.2013 16:55, schrieb Dicebot: On Tuesday, 12 November 2013 at 15:39:27 UTC, Andrej Mitrovic wrote: Btw, how did you make dub use a -version flag anyway? I can't figure it out from the docs. I suppose it's something like: dub --build=release --version=? But I see that --version means

Re: dchip is a D2 port of the Chipmunk2D physics library for 2D games

2013-11-11 Thread Andrej Mitrovic
On 11/11/13, Sergei Nosov sergei.no...@gmail.com wrote: I've done some experiments regarding dmd/ldc comparison. Machine: Ubuntu 12.04 (x86_64), Intel® Core™ i5-3470 CPU @ 3.20GHz × 4 Compilers: DMD64 D Compiler v2.064, LDC - the LLVM D compiler (0.12.0): based on DMD v2.063.2 and LLVM

Re: dchip is a D2 port of the Chipmunk2D physics library for 2D games

2013-11-11 Thread Sergei Nosov
On Monday, 11 November 2013 at 15:29:20 UTC, Andrej Mitrovic wrote: On 11/11/13, Sergei Nosov sergei.no...@gmail.com wrote: I've done some experiments regarding dmd/ldc comparison. Machine: Ubuntu 12.04 (x86_64), Intel® Core™ i5-3470 CPU @ 3.20GHz × 4 Compilers: DMD64 D Compiler v2.064, LDC -

Re: dchip is a D2 port of the Chipmunk2D physics library for 2D games

2013-11-11 Thread Andrej Mitrovic
On 11/12/13, Sergei Nosov sergei.no...@gmail.com wrote: In my version of dub it's -release -inline -O. I've tried also adding the -noboundscheck flag and it yielded the same results. I guess the setup for ldc is similar. What about using -version=CHIP_USE_DOUBLES ? I get quite a slowdown when

Re: dchip is a D2 port of the Chipmunk2D physics library for 2D games

2013-11-11 Thread Sergei Nosov
On Tuesday, 12 November 2013 at 04:07:14 UTC, Andrej Mitrovic wrote: On 11/12/13, Sergei Nosov sergei.no...@gmail.com wrote: In my version of dub it's -release -inline -O. I've tried also adding the -noboundscheck flag and it yielded the same results. I guess the setup for ldc is similar.

Re: dchip is a D2 port of the Chipmunk2D physics library for 2D games

2013-11-10 Thread Sergei Nosov
On Friday, 8 November 2013 at 04:39:11 UTC, Andrej Mitrovic wrote: On 11/8/13, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: Anyway in -release -inline -O -noboundscheck mode the sample now works perfectly smooth! Well, as long as you use float and not double via

Re: dchip is a D2 port of the Chipmunk2D physics library for 2D games

2013-11-09 Thread SomeDude
On Friday, 8 November 2013 at 05:04:45 UTC, Suliman wrote: I did not refactor, it's a straight port. Could you say how much code lines can be approximately saved after porting with refactoring? This question doesn't make much sense. I guess one could write the same thing from scratch in D in

Re: dchip is a D2 port of the Chipmunk2D physics library for 2D games

2013-11-07 Thread Rory McGuire
It's just a port so that should be the case. On 7 Nov 2013 09:25, Suliman bubnenk...@gmail.com wrote: The C library is relatively small, clocking in at about ~11.000 lines Do I right understand that rewriting code from C to D did not make it's more compact? I tried to calculate D source

Re: dchip is a D2 port of the Chipmunk2D physics library for 2D games

2013-11-07 Thread Andrej Mitrovic
On 11/7/13, Suliman bubnenk...@gmail.com wrote: The C library is relatively small, clocking in at about ~11.000 lines Do I right understand that rewriting code from C to D did not make it's more compact? I tried to calculate D source lines, and get ~11.000 I did not refactor, it's a straight

Re: dchip is a D2 port of the Chipmunk2D physics library for 2D games

2013-11-07 Thread Andrej Mitrovic
On 11/7/13, Sergei Nosov sergei.no...@gmail.com wrote: I don't have the numbers (I didn't find where to look for the FPS), but it hinders exactly the same as dmd. Hmm, I have the same issue. It might be an issue with the port. Or worse-case scenario, something wrong with the front-end (since

Re: dchip is a D2 port of the Chipmunk2D physics library for 2D games

2013-11-07 Thread Andrej Mitrovic
On 11/7/13, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: Hmm, I have the same issue. It might be an issue with the port. I did some profiling. I had some excessive opengl error check calls, which I've fixed in git-head. And I was wrong about -O not working, it works but it takes ~1-2

Re: dchip is a D2 port of the Chipmunk2D physics library for 2D games

2013-11-07 Thread Andrej Mitrovic
On 11/8/13, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: Anyway in -release -inline -O -noboundscheck mode the sample now works perfectly smooth! Well, as long as you use float and not double via -version=CHIP_USE_DOUBLES . Chipmunk actually uses doubles by default, although I'm not sure

Re: dchip is a D2 port of the Chipmunk2D physics library for 2D games

2013-11-07 Thread Suliman
I did not refactor, it's a straight port. Could you say how much code lines can be approximately saved after porting with refactoring?

Re: dchip is a D2 port of the Chipmunk2D physics library for 2D games

2013-11-06 Thread Andrej Mitrovic
On 11/6/13, Sergei Nosov sergei.no...@gmail.com wrote: It seems to work now! I've send you a little pull request fixing glu loading on my Ubuntu setup. Merged. And thanks!

Re: dchip is a D2 port of the Chipmunk2D physics library for 2D games

2013-11-06 Thread Andrej Mitrovic
On 11/6/13, Sergei Nosov sergei.no...@gmail.com wrote: It seems to work now! I've send you a little pull request fixing glu loading on my Ubuntu setup. Btw, which compiler are you using? Could you try running on LDC/GDC if you have that installed and see if there's any performance difference?

Re: dchip is a D2 port of the Chipmunk2D physics library for 2D games

2013-11-06 Thread Sergei Nosov
On Wednesday, 6 November 2013 at 18:15:58 UTC, Andrej Mitrovic wrote: On 11/6/13, Sergei Nosov sergei.no...@gmail.com wrote: It seems to work now! I've send you a little pull request fixing glu loading on my Ubuntu setup. Btw, which compiler are you using? Could you try running on LDC/GDC

Re: dchip is a D2 port of the Chipmunk2D physics library for 2D games

2013-11-06 Thread Suliman
The C library is relatively small, clocking in at about ~11.000 lines Do I right understand that rewriting code from C to D did not make it's more compact? I tried to calculate D source lines, and get ~11.000

Re: dchip is a D2 port of the Chipmunk2D physics library for 2D games

2013-11-05 Thread Sergei Nosov
On Sunday, 3 November 2013 at 15:16:09 UTC, Andrej Mitrovic wrote: On 11/3/13, simendsjo simend...@gmail.com wrote: Nothing I have the need for, but very cool nontheless. It would be interesting if you wrote about your experience on porting a C codebase this size. Nothing much new compared

Re: dchip is a D2 port of the Chipmunk2D physics library for 2D games

2013-11-05 Thread Andrej Mitrovic
On 11/5/13, Sergei Nosov sergei.no...@gmail.com wrote: Here's a little bug report. Don't know if it's my bad. It's not your fault. And thanks for the report! First-off, it complained about several 'cannot cast ulong to int'. I've fixed that with explicit casts. This is mostly the cause of

Re: dchip is a D2 port of the Chipmunk2D physics library for 2D games

2013-11-05 Thread Andrej Mitrovic
On 11/3/13, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: https://github.com/AndrejMitrovic/dchip What is Chipmunk2D? === Btw, I know the documentation and resources for the C library are a little bit scarce at the moment. In particular most tutorials seem to target

Re: dchip is a D2 port of the Chipmunk2D physics library for 2D games

2013-11-03 Thread simendsjo
On Sunday, 3 November 2013 at 05:08:40 UTC, Andrej Mitrovic wrote: (...) DChip[1] is a direct D2 port of the C library without no API changes. (...) Nothing I have the need for, but very cool nontheless. It would be interesting if you wrote about your experience on porting a C codebase this

Re: dchip is a D2 port of the Chipmunk2D physics library for 2D games

2013-11-03 Thread Andrej Mitrovic
On 11/3/13, simendsjo simend...@gmail.com wrote: Nothing I have the need for, but very cool nontheless. It would be interesting if you wrote about your experience on porting a C codebase this size. Nothing much new compared to the last time I ported C, which I wrote about here:

Re: dchip is a D2 port of the Chipmunk2D physics library for 2D games

2013-11-03 Thread Andrej Mitrovic
On 11/3/13, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: without no API changes. I meant without any API changes.

dchip is a D2 port of the Chipmunk2D physics library for 2D games

2013-11-02 Thread Andrej Mitrovic
https://github.com/AndrejMitrovic/dchip What is Chipmunk2D? === Chipmunk2D[1] is a 2D rigid body physics library distributed under the MIT license. It is intended to be blazingly fast, portable, numerically stable, and easy to use. It’s been used in hundreds of games across just