Changed BulletMultiThreaded Thread Support to be passed in, rather then global 'Win32ThreadSupport'/'Libspe2ThreadSupport' etc.

This allows developer to hookup Bullet to a custom task scheduler, by deriving from btThreadSupportInterface.
This commit is contained in:
ejcoumans
2007-07-09 03:21:33 +00:00
parent 2508cef2cf
commit 121fd7808e
12 changed files with 201 additions and 66 deletions

View File

@@ -26,7 +26,7 @@ subject to the following restrictions:
///Setup and initialize SPU/CELL/Libspe2
Win32ThreadSupport::Win32ThreadSupport(Win32ThreadConstructionInfo& threadConstructionInfo)
{
startSPU(threadConstructionInfo);
startThreads(threadConstructionInfo);
}
///cleanup/shutdown Libspe2
@@ -122,6 +122,7 @@ void Win32ThreadSupport::sendRequest(uint32_t uiCommand, uint32_t uiArgument0, u
}
///check for messages from SPUs
void Win32ThreadSupport::waitForResponse(unsigned int *puiArgument0, unsigned int *puiArgument1)
{
@@ -170,8 +171,8 @@ void Win32ThreadSupport::waitForResponse(unsigned int *puiArgument0, unsigned in
}
///start the spus group (can be called at the beginning of each frame, to make sure that the right SPU program is loaded)
void Win32ThreadSupport::startSPU(Win32ThreadConstructionInfo& threadConstructionInfo)
void Win32ThreadSupport::startThreads(Win32ThreadConstructionInfo& threadConstructionInfo)
{
m_activeSpuStatus.resize(threadConstructionInfo.m_numThreads);
@@ -214,6 +215,11 @@ void Win32ThreadSupport::startSPU(Win32ThreadConstructionInfo& threadConstructio
}
void Win32ThreadSupport::startSPU()
{
}
///tell the task scheduler we are done with the SPU tasks
void Win32ThreadSupport::stopSPU()
{