diff --git a/main.go b/main.go new file mode 100755 index 0000000..bd7b680 --- /dev/null +++ b/main.go @@ -0,0 +1,8 @@ +package main + +import "github.com/bloeys/physx-go/pgo" + +func main() { + pgo.Test() + println("Hey!!") +} diff --git a/pgo/libs/libphysx-c.a b/pgo/libs/libphysx-c.a new file mode 100755 index 0000000..d55024c Binary files /dev/null and b/pgo/libs/libphysx-c.a differ diff --git a/pgo/pgo.go b/pgo/pgo.go new file mode 100755 index 0000000..a271753 --- /dev/null +++ b/pgo/pgo.go @@ -0,0 +1,20 @@ +package pgo + +/* +#cgo CPPFLAGS: -I physx-c +#cgo LDFLAGS: -L ./libs -l physx-c + +#include +#include //Needed for C.free + +//Functions +struct CPxFoundation* NewCPxFoundation(); +void FreeCPxFoundation(struct CPxFoundation*); +*/ +import "C" + +func Test() { + x := C.NewCPxFoundation() + println("Result:", x) + C.FreeCPxFoundation(x) +} diff --git a/pgo/physx-c/CPxFoundation.h b/pgo/physx-c/CPxFoundation.h new file mode 100755 index 0000000..6622b70 --- /dev/null +++ b/pgo/physx-c/CPxFoundation.h @@ -0,0 +1,18 @@ +#ifndef __CPxFoundation_H__ +#define __CPxFoundation_H__ + +#ifdef __cplusplus +extern "C" { +#endif + struct CPxFoundation + { + void* obj; + }; + + CPxAPI CSTRUCT CPxFoundation* NewCPxFoundation(); + CPxAPI void FreeCPxFoundation(CSTRUCT CPxFoundation* cpf); +#ifdef __cplusplus +} +#endif + +#endif \ No newline at end of file diff --git a/pgo/wrap.cxx b/pgo/wrap.cxx new file mode 100755 index 0000000..4f669a2 --- /dev/null +++ b/pgo/wrap.cxx @@ -0,0 +1,3 @@ +#define CPxAPI +#define CSTRUCT struct +#include