MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / connect

Method connect

physx/source/pvd/src/PxPvdImpl.cpp:116–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114}
115
116bool PvdImpl::connect(PxPvdTransport& transport, PxPvdInstrumentationFlags flags)
117{
118 if(mIsConnected)
119 {
120 physx::shdfnd::getFoundation().error(PxErrorCode::eINVALID_PARAMETER, __FILE__, __LINE__, "PxPvd::connect - recall connect! Should call disconnect before re-connect.");
121 return false;
122 }
123
124 mFlags = flags;
125 mPvdTransport = &transport;
126
127 mIsConnected = mPvdTransport->connect();
128
129 if(mIsConnected)
130 {
131 mSharedMetaProvider = PVD_NEW(MetaDataProvider);
132 sendTransportInitialization();
133
134 PvdDataStream* stream = PvdDataStream::create(this);
135 initializeModelTypes(*stream);
136 stream->release();
137
138 if(mFlags & PxPvdInstrumentationFlag::eMEMORY)
139 {
140 mMemClient = PVD_NEW(PvdMemClient)(*this);
141 mPvdClients.pushBack(mMemClient);
142 }
143
144 if((mFlags & PxPvdInstrumentationFlag::ePROFILE) && mProfileZoneManager)
145 {
146 mPvdClients.pushBack(mProfileClient);
147 mProfileZone = &physx::profile::PxProfileZone::createProfileZone(&physx::shdfnd::getAllocator(),gSdkName,gProfileNameProvider.getProfileNames());
148 }
149
150 for(uint32_t i = 0; i < mPvdClients.size(); i++)
151 mPvdClients[i]->onPvdConnected();
152
153 if (mProfileZone)
154 {
155 mProfileZoneManager->addProfileZoneHandler(*mProfileClient);
156 mProfileZoneManager->addProfileZone( *mProfileZone );
157 }
158
159 if ((mFlags & PxPvdInstrumentationFlag::ePROFILE))
160 {
161 PxSetProfilerCallback(this);
162 }
163 }
164 return mIsConnected;
165}
166
167void PvdImpl::disconnect()
168{

Callers 15

createPhysicsAndSceneFunction · 0.45
initPhysicsFunction · 0.45
initPhysicsFunction · 0.45
initPhysicsFunction · 0.45
initPhysicsFunction · 0.45
initPhysicsFunction · 0.45
initPhysicsFunction · 0.45
initPhysicsFunction · 0.45
initPhysicsFunction · 0.45
initPhysicsFunction · 0.45
initPhysicsFunction · 0.45
initPhysicsFunction · 0.45

Calls 11

createFunction · 0.85
initializeModelTypesFunction · 0.85
PxSetProfilerCallbackFunction · 0.85
errorMethod · 0.80
addProfileZoneHandlerMethod · 0.80
releaseMethod · 0.45
pushBackMethod · 0.45
getProfileNamesMethod · 0.45
sizeMethod · 0.45
onPvdConnectedMethod · 0.45
addProfileZoneMethod · 0.45

Tested by

no test coverage detected