本文整理汇总了C++中IObject::Update方法的典型用法代码示例。如果您正苦于以下问题:C++ IObject::Update方法的具体用法?C++ IObject::Update怎么用?C++ IObject::Update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IObject
的用法示例。
在下文中一共展示了IObject::Update方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Update
void CSoundManager::Update(DWORD tickCount)
{
IDTOOBJECTMAP *objMap;
objMap = GetObjectMap(&m_hsSoundObjTypeName);
if (objMap != NULL)
{
IDTOOBJECTMAP::iterator mapIter = objMap->begin();
while (mapIter != objMap->end())
{
IObject *object = mapIter->second;
object->Update();
mapIter++;
}
}
objMap = GetObjectMap(&m_hsPlaylistTypeName);
if (objMap != NULL)
{
IDTOOBJECTMAP::iterator mapIter = objMap->begin();
for (; mapIter != objMap->end(); mapIter++)
{
IObject *object = mapIter->second;
object->Update();
}
}
// make sure the audio engine updates whatever else it needs to update now
static DWORD msgUpdateAudioEngine = CHashString(_T("UpdateAudioEngine")).GetUniqueID();
m_ToolBox->SendMessage(msgUpdateAudioEngine, 0, NULL);
}
示例2: calTypeName
/// \brief Update function for the Cal3DModelManager
/// Renders immediately, the queued list of renderobjects
/// \return void
void Cal3DModelManager::Update( DWORD tickCount )
{
//check for bad callbacks
stack< CalCoreAnimation * > deadCallbacks;
CAL3DANIMATIONTOCALLBACKMAP::iterator iter = m_AnimationCallbacks.begin();
for(;iter != m_AnimationCallbacks.end(); ++iter)
{
Cal3dCallback * cb = (*iter).second;
if( cb && cb->m_bDelete )
{
deadCallbacks.push( (*iter).first );
}
}
//delete dead animation callbacks
while( !deadCallbacks.empty() )
{
CalCoreAnimation * ca = deadCallbacks.top();
deadCallbacks.pop();
iter = m_AnimationCallbacks.find( ca );
if( iter != m_AnimationCallbacks.end())
{
Cal3dCallback * cb = (*iter).second;
ca->removeCallback( cb );
delete cb;
m_AnimationCallbacks.erase( iter);
}
}
OBJECTLIST objList;
static CHashString calTypeName( _T("Cal3DRenderObject"));
//send a dummy file so we get a callback for this first phase
IDTOOBJECTMAP::iterator objIter;
IDTOOBJECTMAP *objMap = GetObjectMap( &calTypeName );
//update our objects
if( objMap )
{
IObject * destObject;
for( objIter = objMap->begin();objIter != objMap->end(); ++objIter )
{
destObject = objIter->second;
destObject->Update();
}
}
}
示例3: Update
bool CGUIPage::Update()
{
DWORD sortMethod;
ADDRENDERLISTPARAMS addRenderListMessage;
OBJECTLIST::iterator olIter;
IObject *Object;
for(olIter = m_ObjectList.begin(); olIter != m_ObjectList.end();
olIter++)
{
Object = dynamic_cast<IObject*>(*olIter);
if(Object == NULL)
{
EngineGetToolBox()->SetErrorValue(ERR_NULL_POINTER);
EngineGetToolBox()->Log(LOGERROR, _T("Could not cast object from the object page list to IObject*"));
return false;
}
Object->Update(); //update each gui object before adding to render list
}
if(m_ObjectList.empty())
{
return false;
}
if(m_SortedMap.empty())
{
SortGUIElements();
}
// setup render list for render manager
if (m_bBatchRender)
{
sortMethod = SORT_FIFO;//SORT_DISTANCE;
if (m_pRenderTarget == NULL) // render to scene view (world) or to context, if enabled
{
addRenderListMessage.dwSortMethod = sortMethod;
addRenderListMessage.objList = &m_ObjectList;
addRenderListMessage.dwListPriorityKey = RENDERPRIORITY_FRONTBUFFER;
addRenderListMessage.renderContext = m_RenderContext;
addRenderListMessage.dwFuncCallback = CGUIManager::PreRenderWrap;
addRenderListMessage.dwFuncPostRenderCallback = CGUIManager::PostRenderWrap;
static DWORD msgHash_AddRenderList = CHashString(_T("AddRenderList")).GetUniqueID();
EngineGetToolBox()->SendMessage(msgHash_AddRenderList, sizeof(addRenderListMessage), &addRenderListMessage, NULL, NULL);
}
else // render to texture
{
RENDERLISTTOTEXTUREPARAMS params;
params.dwSortMethod = sortMethod;
params.objList = &m_ObjectList;
params.RenderTexture = m_pRenderTarget;
params.Camera = NULL;
params.clearDepth = true;
params.clearTarget = true;
static DWORD msgHash_RenderListToTexture = CHashString(_T("RenderListToTexture")).GetUniqueID();
EngineGetToolBox()->SendMessage(msgHash_RenderListToTexture, sizeof(params), ¶ms, NULL, NULL);
}
}
return true;
}