From eb8eea6c44754648dc61764be8f9883ba4f7a7fb Mon Sep 17 00:00:00 2001 From: bloeys Date: Mon, 17 Jan 2022 04:36:56 +0400 Subject: [PATCH] Towards an mvp --- main.go | 32 +++-- pgo/libs/libphysx-c.a | Bin 2904 -> 6430 bytes pgo/pgo.go | 114 ++++++++++++++++++ pgo/physx-c/CPxCpuDispatcher.h | 25 ++++ pgo/physx-c/CPxDefaultCpuDispatcher.h | 22 ++++ .../CPxDefaultSimulationFilterShader.h | 20 +++ pgo/physx-c/CPxFoundation.h | 4 +- pgo/physx-c/CPxPhysics.h | 26 ++++ pgo/physx-c/CPxPvd.h | 56 ++++++++- pgo/physx-c/CPxPvdTransport.h | 4 +- pgo/physx-c/CPxScene.h | 20 +++ pgo/physx-c/CPxSceneDesc.h | 30 +++++ pgo/physx-c/CPxTolerancesScale.h | 19 +++ pgo/physx-c/CPxVec3.h | 18 +++ pgo/wrap.cxx | 14 +++ 15 files changed, 389 insertions(+), 15 deletions(-) create mode 100755 pgo/physx-c/CPxCpuDispatcher.h create mode 100755 pgo/physx-c/CPxDefaultCpuDispatcher.h create mode 100755 pgo/physx-c/CPxDefaultSimulationFilterShader.h create mode 100755 pgo/physx-c/CPxPhysics.h create mode 100755 pgo/physx-c/CPxScene.h create mode 100755 pgo/physx-c/CPxSceneDesc.h create mode 100755 pgo/physx-c/CPxTolerancesScale.h create mode 100755 pgo/physx-c/CPxVec3.h diff --git a/main.go b/main.go index b10ebaa..fa3a299 100755 --- a/main.go +++ b/main.go @@ -9,15 +9,29 @@ func main() { defer f.Release() println("foundation:", f) - pvd := pgo.CreatePvd(f) - // defer pvd.Release() - println("Pvd:", pvd) - - pvdTr := pgo.DefaultPvdSocketTransportCreate("127.0.0.1", 9876, 500) - // defer pvdTr.Release() + pvdTr := pgo.DefaultPvdSocketTransportCreate("0.0.0.0", 5426, 100000) println("Pvd transport:", pvdTr) - // for { - // time.Sleep(1 / 60 * time.Second) - // } + pvd := pgo.CreatePvd(f) + println("Pvd:", pvd) + println("connect:", pvd.Connect(pvdTr, pgo.PvdInstrumentationFlag_eALL)) + + ts := pgo.NewTolerancesScale(1, 9.81) + p := pgo.CreatePhysics(f, ts, false, pvd) + println("Physics:", p) + + sd := pgo.NewSceneDesc(ts) + sd.SetGravity(pgo.NewVec3(0, -9.8, 0)) + sd.SetCpuDispatcher(pgo.DefaultCpuDispatcherCreate(2, 0).ToCpuDispatcher()) + + s := p.CreateScene(sd) + println("Scene:", s) + + for { + + } + + p.Release() + pvd.Release() + pvdTr.Release() } diff --git a/pgo/libs/libphysx-c.a b/pgo/libs/libphysx-c.a index 823f088a9c19e78dd3f1a635a8013349576fa81a..b42540ab3e191cbbc3ca065e5a0317f76a68342b 100755 GIT binary patch literal 6430 zcmcIoO>7%Q6n^<>(mGAzIKQZkFd_T|$WIg7NhDMpVk)AhspX^vM5K*bZ(|oXw)|6C z^}qoX#LuZh94jtx>Y;}!C_<_tAt6!~i35Sqp9576kw8Mq0Z|btyxE!Ao%PN-b`w^5 zp4s=_yl>|1n>TO#)XUL~8b9vp_gbIcW7c>6Ho!W^hK2@dcg_U>y#TH)fcm2V4H1CG z>y(-{00?>JC^enOcckVxC3hD9q1J1R2C+qILX(7AZc*}V;&`OCZA$HEgHW4`(IU1; z?dy~}LI8wXrYJSvMLZ<;RZ1O8C|^>PiBsXzkr^fQ+Vps2B0O_CqNL-OvzK~RP?V`N zlaqD@c%Nxd`ONEQrcNrMv6(R#4__Kj=R=8XI+|1CT1LreNiCYy&{X0=T5%MkAf%m( z=99Tyh8NXxvXV;`0-N)Z8k7uhusxp9qB&uCGILA^Eu2W@7h=&|BDG+5j6_Cet=l(c z=EQ9h)DB;a*$smBifC(E)fO~6w3U4#qiI|>q-9A!lPI*YMI9xpKu3 zs^Ji{!(pg}15g7Ea1h#{73!f5Txik*jo^l6Xn_u>fXXtotDJMC;aXwa8$9+c^wIja zVq3C!;*m*>xIo)ddC@HBxQo%6Id2ieA&NMgpADjrUTMQKopQsV%$Fl}~E}>Ra~$z+o?pg3&T(37CR601nXF*rD=uN z7fUAfB)nUt>l+Xts3aN$R!-`RT=wm}$JVR`|^#{3JggT(a+KM3BHN^Cutp~+JxEb2LEcGn{B zCtZT|ICR2t-g7FUW>VSIxt#a;NRM}NV(KK5TN(mJCPIiD0HlW}0v-UQC!j!3O{IG{u2N-2ofW)tDUPb;S)mHyTH%tRIh;A`psLbUPP_H zl!9f4?Iafgg?>r9&Npgb4fl`R!=Qo`-8sAX=3L4X=xP zLJCOy`1zg0`U{9uO_5}k3ae&BXrW({M*}|l8ozvY;L%Hne83smIMf9^(FG-84@>;} z?e{l+8%FG!BG{73OPog8Q5=x$o%t&_Z};OoYAy3{Ea>)x@0WaoEB$Z&(uMd3DZZpm z6d{FvNuKvhJbz=hbLVM9JVX)0>{cySp8`zzyUB0-%V=h(v!A|l?@7dTSuuGrx;H$2 z)Cjrhi~C=1b|YRL!;@XWL{On$l3#t2NcwB_Zoi0F4HV0I6|nxZw5N5-PPX_5kxg>4HOjF0HDphyvXkbG?zW%F zN#hn!rHQcY3?xIl|8MsyL2E)Z+ofr5Ya6lW{MnxPBm6@jZyD84co!4FgnmgoLYCVi pqa%Nl+}3Ph72fa!l(J71pCnd8q0T?>&oBJ{imy(;H;OQ>{{TzpyX61? delta 400 zcmY*TF-t;G82x-#efK^!wWpT!K(VMXGn1AevMEx`YAPtB2SGt(5&nT3qQE#qTmFH! zHMaEwf@o=IX^Kz~q@`%+Gl%HH;c(8meCOO`o@0&K186r z+lO?BdNA63D9(E@YJI3W>pF^Z23jDFhDzW}+e271uVi{XoBiuhT+$Up7GEyw+{CSp zBx*BT9M+iY%shlVq>~~yN%E45w0~OQC=?CkOSOE}uAJDV(_O-)7)MDTLPkUeIAL$A zY9H8@V;coI4@V|3Ed1z59oHg`bH(391Yaru%aFgzonZPl<-2oZHDs#Ig_rjv?;sq8 z)-V+|l_zI>#MyA65H2Ean*Pt$&iy1i8t>!*qu4N4{7;J)k0~}q&upj|9?Us(BBpv9 XTzVbjzztt?Utyy8J;KU^Ry6Sgp6*oo diff --git a/pgo/pgo.go b/pgo/pgo.go index 1247910..ca11bf3 100755 --- a/pgo/pgo.go +++ b/pgo/pgo.go @@ -12,14 +12,39 @@ struct CPxFoundation* CPxCreateFoundation(); void CPxFoundation_release(struct CPxFoundation*); struct CPxPvd* CPxCreatePvd(struct CPxFoundation*); +bool CPxPvd_connect(struct CPxPvd*, struct CPxPvdTransport*, enum CPxPvdInstrumentationFlag); void CPxPvd_release(struct CPxPvd*); struct CPxPvdTransport* CPxDefaultPvdSocketTransportCreate(const char* address, int port, int timeoutMillis); void CPxPvdTransport_release(struct CPxPvdTransport* cppt); + +struct CPxTolerancesScale NewCPxTolerancesScale(CPxReal length, CPxReal speed); + +struct CPxPhysics* CPxCreatePhysics(struct CPxFoundation* cfoundation, struct CPxTolerancesScale cscale, bool trackOutstandingAllocations, struct CPxPvd* cpvd); +struct CPxScene* CPxPhysics_createScene(struct CPxPhysics*, struct CPxSceneDesc*); +void CPxPhysics_release(struct CPxPhysics*); + +struct CPxVec3 NewCPxVec3(float x, float y, float z); + +struct CPxDefaultCpuDispatcher* CPxDefaultCpuDispatcherCreate(CPxU32 numThreads, CPxU32 affinityMasks); +struct CPxCpuDispatcher* CPxDefaultCpuDispatcher_toCPxCpuDispatcher(struct CPxDefaultCpuDispatcher* cdcd); + +struct CPxSceneDesc* NewCPxSceneDesc(struct CPxTolerancesScale); +void CPxSceneDesc_set_gravity(struct CPxSceneDesc*, struct CPxVec3); +void CPxSceneDesc_set_cpuDispatcher(struct CPxSceneDesc*, struct CPxCpuDispatcher*); */ import "C" import "unsafe" +type PvdInstrumentationFlag uint32 + +const ( + PvdInstrumentationFlag_eDEBUG PvdInstrumentationFlag = 1 << 0 + PvdInstrumentationFlag_ePROFILE PvdInstrumentationFlag = 1 << 1 + PvdInstrumentationFlag_eMEMORY PvdInstrumentationFlag = 1 << 2 + PvdInstrumentationFlag_eALL PvdInstrumentationFlag = (PvdInstrumentationFlag_eDEBUG | PvdInstrumentationFlag_ePROFILE | PvdInstrumentationFlag_eMEMORY) +) + type Foundation struct { cFoundation *C.struct_CPxFoundation } @@ -40,6 +65,10 @@ type Pvd struct { cPvd *C.struct_CPxPvd } +func (p *Pvd) Connect(pvdTr *PvdTransport, instFlag PvdInstrumentationFlag) bool { + return bool(C.CPxPvd_connect(p.cPvd, pvdTr.cPvdTr, uint32(instFlag))) +} + func (p *Pvd) Release() { C.CPxPvd_release(p.cPvd) } @@ -67,6 +96,91 @@ func DefaultPvdSocketTransportCreate(host string, port, timeoutMillis int) *PvdT p := &PvdTransport{} p.cPvdTr = C.CPxDefaultPvdSocketTransportCreate(hostCStr, C.int(port), C.int(timeoutMillis)) + return p +} + +type TolerancesScale struct { + cTolScale C.struct_CPxTolerancesScale +} + +func NewTolerancesScale(length, speed float32) *TolerancesScale { + + ts := &TolerancesScale{} + ts.cTolScale = C.NewCPxTolerancesScale(C.float(length), C.float(speed)) + return ts +} + +type Scene struct { + cS *C.struct_CPxScene +} + +type Physics struct { + cPhysics *C.struct_CPxPhysics +} + +// struct CPxScene* CPxPhysics_createScene(struct CPxPhysics*, struct CPxSceneDesc*); +func (p *Physics) CreateScene(sd *SceneDesc) *Scene { + return &Scene{ + cS: C.CPxPhysics_createScene(p.cPhysics, sd.cSD), + } +} + +func CreatePhysics(f *Foundation, ts *TolerancesScale, trackOutstandingAllocations bool, pvd *Pvd) *Physics { + + p := &Physics{} + p.cPhysics = C.CPxCreatePhysics(f.cFoundation, ts.cTolScale, C._Bool(trackOutstandingAllocations), pvd.cPvd) return p } + +func (p *Physics) Release() { + C.CPxPhysics_release(p.cPhysics) +} + +type Vec3 struct { + cV C.struct_CPxVec3 +} + +func NewVec3(x, y, z float32) *Vec3 { + return &Vec3{ + cV: C.NewCPxVec3(C.float(x), C.float(y), C.float(z)), + } +} + +type CpuDispatcher struct { + cCpuDisp *C.struct_CPxCpuDispatcher +} + +type DefaultCpuDispatcher struct { + cDefCpuDisp *C.struct_CPxDefaultCpuDispatcher +} + +// struct CPxCpuDispatcher* CPxDefaultCpuDispatcher_toCPxCpuDispatcher(struct CPxDefaultCpuDispatcher* cdcd); +func (d *DefaultCpuDispatcher) ToCpuDispatcher() *CpuDispatcher { + return &CpuDispatcher{cCpuDisp: (*C.struct_CPxCpuDispatcher)(d.cDefCpuDisp)} +} + +func DefaultCpuDispatcherCreate(numThreads, affinityMasks uint32) *DefaultCpuDispatcher { + return &DefaultCpuDispatcher{ + cDefCpuDisp: C.CPxDefaultCpuDispatcherCreate(C.uint(numThreads), C.uint(affinityMasks)), + } +} + +type SceneDesc struct { + cSD *C.struct_CPxSceneDesc +} + +func (sd *SceneDesc) SetGravity(v *Vec3) { + C.CPxSceneDesc_set_gravity(sd.cSD, v.cV) +} + +func (sd *SceneDesc) SetCpuDispatcher(cd *CpuDispatcher) { + C.CPxSceneDesc_set_cpuDispatcher(sd.cSD, cd.cCpuDisp) +} + +//struct CPxSceneDesc* NewCPxSceneDesc(struct CPxTolerancesScale); +func NewSceneDesc(ts *TolerancesScale) *SceneDesc { + return &SceneDesc{ + cSD: C.NewCPxSceneDesc(ts.cTolScale), + } +} diff --git a/pgo/physx-c/CPxCpuDispatcher.h b/pgo/physx-c/CPxCpuDispatcher.h new file mode 100755 index 0000000..bde6a4a --- /dev/null +++ b/pgo/physx-c/CPxCpuDispatcher.h @@ -0,0 +1,25 @@ +#ifndef CPxCpuDispatcher_H +#define CPxCpuDispatcher_H + +#ifdef __cplusplus +extern "C" { +#endif + + struct CPxCpuDispatcher + { + void* obj; + }; + + /// + /// This only frees C representation of the base class (the CPxCpuDispatcher struct). obj is NOT freed. + /// To release the PhysX resources release must be called on the actual C implementation (e.g. CPxDefaultCpuDispatcher_release) + /// + /// + /// + CPxAPI void CPxCpuDispatcher_release(CSTRUCT CPxCpuDispatcher*); + +#ifdef __cplusplus +} +#endif + +#endif // !PxCpuDispatcher_H \ No newline at end of file diff --git a/pgo/physx-c/CPxDefaultCpuDispatcher.h b/pgo/physx-c/CPxDefaultCpuDispatcher.h new file mode 100755 index 0000000..4a161e1 --- /dev/null +++ b/pgo/physx-c/CPxDefaultCpuDispatcher.h @@ -0,0 +1,22 @@ +#ifndef CPxDefaultCpuDispatcher_H +#define CPxDefaultCpuDispatcher_H + +#include "CPxCpuDispatcher.h" + +#ifdef __cplusplus +extern "C" { +#endif + + struct CPxDefaultCpuDispatcher { + void* obj; + }; + + CPxAPI CSTRUCT CPxDefaultCpuDispatcher* CPxDefaultCpuDispatcherCreate(CPxU32 numThreads, CPxU32 affinityMasks); + CPxAPI CSTRUCT CPxCpuDispatcher* CPxDefaultCpuDispatcher_toCPxCpuDispatcher(CSTRUCT CPxDefaultCpuDispatcher* cdcd); + CPxAPI void CPxDefaultCpuDispatcher_release(CSTRUCT CPxDefaultCpuDispatcher* cdcd); + +#ifdef __cplusplus +} +#endif + +#endif // !CPxDefaultCpuDispatcher_H \ No newline at end of file diff --git a/pgo/physx-c/CPxDefaultSimulationFilterShader.h b/pgo/physx-c/CPxDefaultSimulationFilterShader.h new file mode 100755 index 0000000..fce7c60 --- /dev/null +++ b/pgo/physx-c/CPxDefaultSimulationFilterShader.h @@ -0,0 +1,20 @@ +#ifndef CPxDefaultSimulationFilterShader_H +#define CPxDefaultSimulationFilterShader_H + +#ifdef __cplusplus +extern "C" { +#endif + + struct CPxDefaultSimulationFilterShader + { + void* obj; + }; + + //CPxAPI CSTRUCT CPxDefaultSimulationFilterShader* NewCPxDefaultSimulationFilterShader(); + //CPxAPI void FreeCPxDefaultSimulationFilterShader(CSTRUCT CPxDefaultSimulationFilterShader*); + +#ifdef __cplusplus +} +#endif + +#endif // !CPxDefaultSimulationFilterShader_H diff --git a/pgo/physx-c/CPxFoundation.h b/pgo/physx-c/CPxFoundation.h index 4edbd82..7e40b98 100755 --- a/pgo/physx-c/CPxFoundation.h +++ b/pgo/physx-c/CPxFoundation.h @@ -1,5 +1,5 @@ -#ifndef __CPxFoundation_H__ -#define __CPxFoundation_H__ +#ifndef CPxFoundation_H +#define CPxFoundation_H #ifdef __cplusplus extern "C" { diff --git a/pgo/physx-c/CPxPhysics.h b/pgo/physx-c/CPxPhysics.h new file mode 100755 index 0000000..8eeb427 --- /dev/null +++ b/pgo/physx-c/CPxPhysics.h @@ -0,0 +1,26 @@ +#ifndef CPxPhysics_H +#define CPxPhysics_H + +#include "CPxPvd.h" +#include "CPxFoundation.h" +#include "CPxScene.h" +#include "CPxSceneDesc.h" +#include "CPxTolerancesScale.h" + +#ifdef __cplusplus +extern "C" { +#endif + + struct CPxPhysics { + void* obj; + }; + + CPxAPI CSTRUCT CPxPhysics* CPxCreatePhysics(CSTRUCT CPxFoundation* cfoundation, CSTRUCT CPxTolerancesScale cscale, bool trackOutstandingAllocations, CSTRUCT CPxPvd* cpvd); + CPxAPI CSTRUCT CPxScene* CPxPhysics_createScene(CSTRUCT CPxPhysics*, CSTRUCT CPxSceneDesc*); + CPxAPI void CPxPhysics_release(CSTRUCT CPxPhysics*); + +#ifdef __cplusplus +} +#endif + +#endif \ No newline at end of file diff --git a/pgo/physx-c/CPxPvd.h b/pgo/physx-c/CPxPvd.h index 8053702..2fb3cb7 100755 --- a/pgo/physx-c/CPxPvd.h +++ b/pgo/physx-c/CPxPvd.h @@ -1,17 +1,69 @@ -#ifndef __CPxPvd_H__ -#define __CPxPvd_H__ +#ifndef CPxPvd_H +#define CPxPvd_H #include "CPxFoundation.h" +#include "CPxPvdTransport.h" #ifdef __cplusplus extern "C" { #endif + + enum CPxPvdInstrumentationFlag + { + /** + \brief Send debugging information to PVD. + + This information is the actual object data of the rigid statics, shapes, + articulations, etc. Sending this information has a noticeable impact on + performance and thus this flag should not be set if you want an accurate + performance profile. + */ + CPxPvdInstrumentationFlag_eDEBUG = 1 << 0, + + /** + \brief Send profile information to PVD. + + This information populates PVD's profile view. It has (at this time) negligible + cost compared to Debug information and makes PVD *much* more useful so it is quite + highly recommended. + + This flag works together with a PxCreatePhysics parameter. + Using it allows the SDK to send profile events to PVD. + */ + CPxPvdInstrumentationFlag_ePROFILE = 1 << 1, + + /** + \brief Send memory information to PVD. + + The PVD sdk side hooks into the Foundation memory controller and listens to + allocation/deallocation events. This has a noticable hit on the first frame, + however, this data is somewhat compressed and the PhysX SDK doesn't allocate much + once it hits a steady state. This information also has a fairly negligible + impact and thus is also highly recommended. + + This flag works together with a PxCreatePhysics parameter, + trackOutstandingAllocations. Using both of them together allows users to have + an accurate view of the overall memory usage of the simulation at the cost of + a hashtable lookup per allocation/deallocation. Again, PhysX makes a best effort + attempt not to allocate or deallocate during simulation so this hashtable lookup + tends to have no effect past the first frame. + + Sending memory information without tracking outstanding allocations means that + PVD will accurate information about the state of the memory system before the + actual connection happened. + */ + CPxPvdInstrumentationFlag_eMEMORY = 1 << 2, + + eALL = (CPxPvdInstrumentationFlag_eDEBUG | CPxPvdInstrumentationFlag_ePROFILE | CPxPvdInstrumentationFlag_eMEMORY) + }; + struct CPxPvd { void* obj; }; CPxAPI CSTRUCT CPxPvd* CPxCreatePvd(CSTRUCT CPxFoundation*); + CPxAPI bool CPxPvd_connect(CSTRUCT CPxPvd*, CSTRUCT CPxPvdTransport*, CENUM CPxPvdInstrumentationFlag); CPxAPI void CPxPvd_release(CSTRUCT CPxPvd* cpp); #ifdef __cplusplus } diff --git a/pgo/physx-c/CPxPvdTransport.h b/pgo/physx-c/CPxPvdTransport.h index fdaf709..4c077a2 100755 --- a/pgo/physx-c/CPxPvdTransport.h +++ b/pgo/physx-c/CPxPvdTransport.h @@ -1,5 +1,5 @@ -#ifndef __CPxPvdTransport_H__ -#define __CPxPvdTransport_H__ +#ifndef CPxPvdTransport_H +#define CPxPvdTransport_H #ifdef __cplusplus extern "C" { diff --git a/pgo/physx-c/CPxScene.h b/pgo/physx-c/CPxScene.h new file mode 100755 index 0000000..deea264 --- /dev/null +++ b/pgo/physx-c/CPxScene.h @@ -0,0 +1,20 @@ +#ifndef CPxScene_H +#define CPxScene_H + +#ifdef __cplusplus +extern "C" { +#endif + + struct CPxScene + { + void* obj; + }; + + CPxAPI void CPxScene_release(CSTRUCT CPxScene*); + +#ifdef __cplusplus +} +#endif + + +#endif // !CPxScene_H diff --git a/pgo/physx-c/CPxSceneDesc.h b/pgo/physx-c/CPxSceneDesc.h new file mode 100755 index 0000000..84ba6d3 --- /dev/null +++ b/pgo/physx-c/CPxSceneDesc.h @@ -0,0 +1,30 @@ +#ifndef CPxSceneDesc_H +#define CPxSceneDesc_H + +#include "CPxTolerancesScale.h" +#include "CPxVec3.h" +#include "CPxCpuDispatcher.h" + +#ifdef __cplusplus +extern "C" { +#endif + + struct CPxSceneDesc { + void* obj; + }; + + /// + /// Creates a SceneDesc with filterShader=physx::PxDefaultSimulationFilterShader + /// + /// + /// + CPxAPI CSTRUCT CPxSceneDesc* NewCPxSceneDesc(CSTRUCT CPxTolerancesScale); + CPxAPI void CPxSceneDesc_set_gravity(CSTRUCT CPxSceneDesc*, CSTRUCT CPxVec3); + CPxAPI void CPxSceneDesc_set_cpuDispatcher(CSTRUCT CPxSceneDesc*, CSTRUCT CPxCpuDispatcher*); + CPxAPI void FreeCPxSceneDesc(CSTRUCT CPxSceneDesc*); + +#ifdef __cplusplus +} +#endif + +#endif \ No newline at end of file diff --git a/pgo/physx-c/CPxTolerancesScale.h b/pgo/physx-c/CPxTolerancesScale.h new file mode 100755 index 0000000..f898062 --- /dev/null +++ b/pgo/physx-c/CPxTolerancesScale.h @@ -0,0 +1,19 @@ +#ifndef CPxTolerancesScale_H +#define CPxTolerancesScale_H + +#ifdef __cplusplus +extern "C" { +#endif + + struct CPxTolerancesScale + { + CPxReal length, speed; + }; + + CPxAPI CSTRUCT CPxTolerancesScale NewCPxTolerancesScale(CPxReal length, CPxReal speed); + +#ifdef __cplusplus +} +#endif + +#endif \ No newline at end of file diff --git a/pgo/physx-c/CPxVec3.h b/pgo/physx-c/CPxVec3.h new file mode 100755 index 0000000..d4ee78d --- /dev/null +++ b/pgo/physx-c/CPxVec3.h @@ -0,0 +1,18 @@ +#ifndef CPxVec3_H +#define CPxVec3_H + +#ifdef __cplusplus +extern "C" { +#endif + + struct CPxVec3 { + float x, y, z; + }; + + CPxAPI CSTRUCT CPxVec3 NewCPxVec3(float x, float y, float z); + +#ifdef __cplusplus +} +#endif + +#endif // !define CPxVec3_H \ No newline at end of file diff --git a/pgo/wrap.cxx b/pgo/wrap.cxx index b120050..36265ec 100755 --- a/pgo/wrap.cxx +++ b/pgo/wrap.cxx @@ -1,4 +1,18 @@ +#include +#include #define CPxAPI #define CSTRUCT struct +#define CENUM enum +#define CPxU32 uint32_t +#define CPxReal float + #include #include +#include +#include +#include +#include +#include +#include +#include +#include