void RebootExperiment() { gSim.isRunning=false; DestroyPhysX(); InitPhysX(); CreateExperiment(); }
bool Apex::Init(ID3D11Device* dev, ID3D11DeviceContext* devcon) { if(!InitPhysX()) return false; mDev = dev; mDevcon = devcon; // Init Apex static PxDefaultErrorCallback gDefaultErrorCallback; ZeusResourceCallback* rcallback = new ZeusResourceCallback(); NxApexSDKDesc apexDesc; apexDesc.outputStream = &gDefaultErrorCallback; apexDesc.resourceCallback = rcallback; apexDesc.physXSDK = mPhysics; apexDesc.cooking = mCooking; m_renderResourceManager = new ZeusRenderResourceManager(dev,devcon); apexDesc.renderResourceManager = m_renderResourceManager; if(apexDesc.isValid()) gApexSDK = NxCreateApexSDK(apexDesc); else return false; if(!gApexSDK) return false; // NxApexSceneDesc apexSceneDesc; // // Create the APEX scene... // // apexSceneDesc.scene = mScene[mCurrentScene]; // // if(apexSceneDesc.isValid()) // gApexScene[mCurrentScene] = gApexSDK->createScene(apexSceneDesc); // else // return false; // if(!gApexScene[mCurrentScene]) // return false; //gApexScene[mCurrentScene]->setLODResourceBudget(10000.f); //static const physx::PxU32 viewIDlookAtRightHand = gApexScene[mCurrentScene]->allocViewMatrix(physx::apex::ViewMatrixType::LOOK_AT_LH); //static const physx::PxU32 projIDperspectiveCubicRightHand = gApexScene[mCurrentScene]->allocProjMatrix(physx::apex::ProjMatrixType::USER_CUSTOMIZED); //gApexScene[mCurrentScene]->setUseViewProjMatrix(viewIDlookAtRightHand, projIDperspectiveCubicRightHand); return true; }
bool InitClient( HWND hWnd ) { plResManager *resMgr = new plResManager; resMgr->SetDataPath("dat"); hsgResMgr::Init(resMgr); if (!plFileInfo("resource.dat").Exists()) { hsMessageBox("Required file 'resource.dat' not found.", "Error", hsMessageBoxNormal); return false; } plClientResMgr::Instance().ILoadResources("resource.dat"); gClient = new plClient; if( gClient == nil ) return false; if (!InitPhysX()) return false; gClient->SetWindowHandle( hWnd ); #ifdef DETACH_EXE hInstance = ((LPCREATESTRUCT) lParam)->hInstance; // This Function loads the EXE into Virtual memory...supposedly HRESULT hr = DetachFromMedium(hInstance, DMDFM_ALWAYS | DMDFM_ALLPAGES); #endif if( gClient->InitPipeline() ) gClient->SetDone(true); else { gClient->ResizeDisplayDevice(gClient->GetPipeline()->Width(), gClient->GetPipeline()->Height(), !gClient->GetPipeline()->IsFullScreen()); } if( gPendingActivate ) { // We need this because the window gets a WM_ACTIVATE before we get to this function, so // the above flag lets us know that we need to fake a late activate msg to the client gClient->WindowActivate( gPendingActivateFlag ); } gClient->SetMessagePumpProc( PumpMessageQueueProc ); return true; }
int main(int argc, char** argv) { #ifdef _DEBUG cout << "***DEBUG BUILD***" << endl; #endif ncc::whoami(); InitRun(argc,argv); InitGlut(argc,argv); InitHUD(); InitDevIL(); InitPhysX(); InitCUDA(); InitExperiment(); glutMainLoop(); // enter event processing return 0; // never actually reached. }
void plClientLoader::Run() { plResManager *resMgr = new plResManager; resMgr->SetDataPath("dat"); hsgResMgr::Init(resMgr); if (!plFileInfo("resource.dat").Exists()) { hsMessageBox("Required file 'resource.dat' not found.", "Error", hsMessageBoxNormal); return; } plClientResMgr::Instance().ILoadResources("resource.dat"); fClient = new plClient; fClient->SetWindowHandle(fWindow); if (!InitPhysX() || fClient->InitPipeline() || !fClient->StartInit()) { fClient->SetDone(true); } }
bool InitClient( HWND hWnd ) { plResManager *resMgr = new plResManager; resMgr->SetDataPath("dat"); hsgResMgr::Init(resMgr); if (!plFileInfo("resource.dat").Exists()) { hsMessageBox("Required file 'resource.dat' not found.", "Error", hsMessageBoxNormal); return false; } plClientResMgr::Instance().ILoadResources("resource.dat"); gClient = new plClient; if( gClient == nil ) return false; if (!InitPhysX()) return false; gClient->SetWindowHandle( hWnd ); if( gClient->InitPipeline() ) gClient->SetDone(true); else { gClient->ResizeDisplayDevice(gClient->GetPipeline()->Width(), gClient->GetPipeline()->Height(), !gClient->GetPipeline()->IsFullScreen()); } if( gPendingActivate ) { // We need this because the window gets a WM_ACTIVATE before we get to this function, so // the above flag lets us know that we need to fake a late activate msg to the client gClient->WindowActivate( gPendingActivateFlag ); } gClient->SetMessagePumpProc( PumpMessageQueueProc ); return true; }