mirror of
https://github.com/bloeys/physx-go.git
synced 2025-12-29 07:58:20 +00:00
Init of physX Alhamdullah!
This commit is contained in:
8
main.go
Executable file
8
main.go
Executable file
@ -0,0 +1,8 @@
|
||||
package main
|
||||
|
||||
import "github.com/bloeys/physx-go/pgo"
|
||||
|
||||
func main() {
|
||||
pgo.Test()
|
||||
println("Hey!!")
|
||||
}
|
||||
BIN
pgo/libs/libphysx-c.a
Executable file
BIN
pgo/libs/libphysx-c.a
Executable file
Binary file not shown.
20
pgo/pgo.go
Executable file
20
pgo/pgo.go
Executable file
@ -0,0 +1,20 @@
|
||||
package pgo
|
||||
|
||||
/*
|
||||
#cgo CPPFLAGS: -I physx-c
|
||||
#cgo LDFLAGS: -L ./libs -l physx-c
|
||||
|
||||
#include <wrap.cxx>
|
||||
#include <stdlib.h> //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)
|
||||
}
|
||||
18
pgo/physx-c/CPxFoundation.h
Executable file
18
pgo/physx-c/CPxFoundation.h
Executable file
@ -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
|
||||
3
pgo/wrap.cxx
Executable file
3
pgo/wrap.cxx
Executable file
@ -0,0 +1,3 @@
|
||||
#define CPxAPI
|
||||
#define CSTRUCT struct
|
||||
#include <CPxFoundation.h>
|
||||
Reference in New Issue
Block a user