Using Cpp files via REQUIRE, which Cpp environment do you use?

Previous topic - Next topic

MikeHart

Hi folks,

for a first try I want to IMPORT chipmunk physics into GLB. Of course, as external libraries usually depend on standard libs you need to have a C/Cpp environment installed. As I don't want to reinvent the wheel, so I have a few questions:

Which C/CPP compiler environment do you have installed and how did you set it up so GLB can use it's libraries and header files?
Does it work also cross platform, like for Iphone development?

Before I had BlitzMax and MingW installed but deinstalled it a while ago. There it was easy to use CPP files.

Thanks for any info
Michael

trucidare

Entscheide dich mal f?r eine Sprache...

Unter news findest du header iund libs f?r ein paar platformen. Runterladen in platform rein und voila geht.

mfg
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

MikeHart

Warum?  Ist doch ein zweisprachiges Forum, oder? Oder hab ich da irgendeine Forumregel ?bersehen? Aber kein Problem. Von nun an nur noch Englisch.  ;/

Anyway, thank you for the information.

Schranz0r

German:

Du kannst den Chipmunk-Source benutzen, nur sind da mehrere *.c Dateien drin.
Musst alle *.c Dateien in eine packen dann kannst du es mit REQUIRE aufrufen.
Brauchst allerdings trotzdem ein wenig Cpp/Inlinecode in GLB wegen den structs.
Sollten Probleme auftauchen einfach melden und zwar auf deutsch ;)

I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

trucidare

Ich kann nur Deutsch deswegen hilft mir englisch so rein null weiter.
Chipmunc.c kann schranzor dir hochladen funktioniert und linkt. keine problem.e
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

Schranz0r

Jow da hast du, hab schonmal die cpVect's eingebaut um dir zu zeigen wie das geht. ( falls du es noch nicht kannst :) )


Aufrufen des DGArrays im INLINE:

Code (glbasic) Select

cpVectArray(handle)


so kannst du auch nochmal auf die Werte x und y zugreifen

Code (glbasic) Select

cpVectArray(handle).x
cpVectArray(handle).y


[attachment deleted by admin]
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

MikeHart

Guten Morgen,

jetzt ist mir das mit der Sprachwahl klar. Und auch vielen Dank f?r den Quellcode.
Wird mit Sicherheit hilf- und lehrreich sein. :)

Michael

Kitty Hello


Hatonastick

26 or so odd years ago I could read, write and (to a certain extent, but I never was much good at that bit) speak German, but now it's all just odd looking words to me now.  =D

I think I get some of the simpler stuff still, like I think Gernot asked if Chipmunk was better than Box2D, and I think I get some of what Ocean said, but it's a long way from being able to read and write it.  :S

Kitty Hello

Oh, very nice. I always wonder why any native English speaker would want to bother learning German, though...

Hatonastick

Because when you go to school here they make you learn at least one other language for at least a year (or was the case when I went through school).  I ended up going with my choice longer than you are forced to though because I enjoyed it -- despite the fact that my teacher (who was German) looked like a Nazi in hiding (actually no my violin teacher was more like that, he even used to show me the salute which was a bit odd).  In my day it was a choice between French and German.  I wasn't much good at French and it wasn't helped by a friend of mine from Belgium who was doing the class just as a joke and made it a bit hard to concentrate, so ended up going with German for about 3 years.  Then a year or so later we had a German exchange student live with us for about a year and she pushed me on it a bit.  These days I think the choices are more along the Asian side of things eg. Japanese, Chinese and Malay or Indonesian.  One of my cousins who is a lot younger than me studied Japanese at High School then university.  She ended up teaching English in Japan for a while.  Guess it's to do with the multi-cultural aspects of being an Aussie.  Our Govt does or did push that angle a lot.

Now I can understand 'Inspector Rex' at times without having to watch the show (my family is into it, don't pick on me please) but that's about it.  Mind you I'm guessing it's not exactly packed full of complicated German dialog as far as Austrian (it is Austrian isn't it?) productions go.  Bit like our Skippy maybe but for a more adult audience. :)

MikeHart

Even being a german, living and working in germany, speaking english is now more native to me than using the german language. After being married to my wonderful american wife now for over 10 yrs i think now in english too.

Most of the forums i visit are english only. So it is my first choice. That i posted here was motivated by the thought that i would have a bigger chance of getting an answer to my problem as i thint the chances are higher that a german speaks english than a native english speaker knows german.

Sorry, if i caused confusion.

Gernot, i don't thing it is better but it looked easier to implement to me as it is pure c.
I was looking for a GLB file for Box2D but found nothing.


Kitty Hello

OK, go for Chipmunk then. I don't care, but I wish we had some of the 2D physics engines wrapped multiplatform. Newton _is_ brilliant for 3D, but at 2D it sort of sucks. (See my CogWork attempt).
We had a wrapper to Box2D, but it was not very promising and the debugging geometry was really complicated to get. Means - it's missing.
Port Chipmunk with IMPORT and make us all happy, please :D


Schranz0r

I can't find a helpfile for chipmunks  :S
Or a simple tutorial...

EDIT:

You have to wrapp some things into the chipmunks.c...
You must have clear datatypes ( int, long, float .... ) to SET and to RETURN !

like this:

Code (glbasic) Select

#include "stdlib.h"

#include "chipmunk.h"

// important to use it easier!
#include "glb.h"
...

    // All the functions

...
// at the end of the file:
/* ##################################################################*\
                            GLBasic things
/* ##################################################################*/
extern "C"{

// a DGArray to save the vectors
DGArray<cpVect> cpVectArray;


int CP_Vect( float x, float y){
cpVect tmp; // create a 2D-Vector
tmp.x = x; // set x
tmp.y = y; // set y

// push it to the DGArray cpVectArray
DIMPUSH(cpVectArray, tmp);

// return the number of entrys 1 to X (10 entrys = real 9 entrys)
// thats a handle to it!
return LEN(cpVectArray())-1;
}

}

I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard