예제 #1
0
    //void cleanupPhysics(bool /*interactive*/){
    void cleanupPhysics(bool interactive)
    {
        //PX_RELEASE(gScene);
        //PX_RELEASE(gDispatcher);
        //PX_RELEASE(gPhysics);
        //PX_RELEASE(gFoundation);
        gScene.release();
        gDispatcher.release();
        gPhysics.release();
        gFoundation.release();

        //printf("SnippetHelloWorld done.\n");
        System.Console.WriteLine("SnippetHelloWorld done.");
    }
예제 #2
0
    //void cleanupPhysics()
    void cleanupPhysics()
    {
        //// Signal threads to quit.
        //for (PxU32 i=0; i < gNumThreads; ++i)
        for (uint i = 0; i < gNumThreads; ++i)
        {
            //SnippetUtils::threadSignalQuit(gThreads[i].mThreadHandle);
            //SnippetUtils::syncSet(gThreads[i].mWorkReadySyncHandle);
            gThreads[i].quit = true;
            gThreads[i].mWorkReadySyncHandle.Set();
        }

        //// Clean up raycast threads and syncs.
        //for (PxU32 i=0; i < gNumThreads; ++i)
        for (uint i = 0; i < gNumThreads; ++i)
        {
            //SnippetUtils::threadWaitForQuit(gThreads[i].mThreadHandle);
            //SnippetUtils::threadRelease(gThreads[i].mThreadHandle);
            //SnippetUtils::syncRelease(gThreads[i].mWorkReadySyncHandle);
            gThreads[i].mThreadHandle.Join();
            gThreads[i].mWorkReadySyncHandle.Close();
        }

        //// Clean up the sync for the main thread.
        //SnippetUtils::syncRelease(gWorkDoneSyncHandle);
        gWorkDoneSyncHandle.Close();

        //PX_RELEASE(gScene);
        //PX_RELEASE(gDispatcher);
        //PX_RELEASE(gPhysics);
        //PX_RELEASE(gFoundation);
        gScene.release();
        gDispatcher.release();
        gPhysics.release();
        gFoundation.release();

        //printf("SnippetMultiThreading done.\n");
        System.Console.WriteLine("SnippetMultiThreading done.");
    }