Add flag to say if pvd is supported

This commit is contained in:
bloeys
2022-12-07 06:38:33 +04:00
parent dd5a42c760
commit 96c55ad30d
3 changed files with 12 additions and 4 deletions

View File

@ -21,13 +21,11 @@ func contactHandler(cph pgo.ContactPairHeader) {
func main() { func main() {
const enablePvd = true
f := pgo.CreateFoundation() f := pgo.CreateFoundation()
println("foundation:", f) println("foundation:", f)
var pvd *pgo.Pvd var pvd *pgo.Pvd
if enablePvd { if pgo.PvdSupported {
pvdTr := pgo.DefaultPvdSocketTransportCreate("127.0.0.1", 5425, 100000) pvdTr := pgo.DefaultPvdSocketTransportCreate("127.0.0.1", 5425, 100000)
println("Pvd transport:", pvdTr) println("Pvd transport:", pvdTr)
@ -48,7 +46,7 @@ func main() {
scene := p.CreateScene(sd) scene := p.CreateScene(sd)
println("Scene:", scene) println("Scene:", scene)
if enablePvd { if pgo.PvdSupported {
scenePvdClient := scene.GetScenePvdClient() scenePvdClient := scene.GetScenePvdClient()
println("ScenePvdClient:", scenePvdClient) println("ScenePvdClient:", scenePvdClient)

5
pgo/consts_checked.go Executable file
View File

@ -0,0 +1,5 @@
//go:build !physx_release
package pgo
const PvdSupported = true

5
pgo/consts_release.go Executable file
View File

@ -0,0 +1,5 @@
//go:build physx_release
package pgo
const PvdSupported = false