本文整理匯總了C++中GetCurrent函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetCurrent函數的具體用法?C++ GetCurrent怎麽用?C++ GetCurrent使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了GetCurrent函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: ToHead
/******************************************************************************
void IFXKeyTrack::Filter(F32 deltatime)
remove track entries too close in time
******************************************************************************/
void IFXKeyTrack::Filter(F32 deltatime)
{
//I32 original=GetNumberElements();
IFXListContext basecontext,nextcontext;
IFXKeyFrame *base,*next;
ToHead(basecontext);
while((base=GetCurrent(basecontext)) != NULL)
{
nextcontext=basecontext;
PostIncrement(nextcontext);
if(IsAtTail(nextcontext))
break;
next=GetCurrent(nextcontext);
if( (next->Time()-base->Time()) < deltatime )
{
Delete(next);
}
else
{
PostIncrement(basecontext);
}
}
}
示例2: switch
void
ParamListGL::Special(int key, int /*x*/, int /*y*/)
{
switch(key) {
case GLUT_KEY_DOWN:
Increment();
break;
case GLUT_KEY_UP:
Decrement();
break;
case GLUT_KEY_RIGHT:
GetCurrent()->Increment();
break;
case GLUT_KEY_LEFT:
GetCurrent()->Decrement();
break;
case GLUT_KEY_HOME:
GetCurrent()->Reset();
break;
case GLUT_KEY_END:
GetCurrent()->SetPercentage(1.0);
break;
}
glutPostRedisplay();
}
示例3: GetCurrent
eOSState cMenuBrowseFiles::Info(void)
{
if (GetCurrent() && !GetCurrent()->IsDir()) {
cString filename = cString::sprintf("%s/%s", *m_CurrentDir, GetCurrent()->Name());
return AddSubMenu(new cMetainfoMenu(filename));
}
return osContinue;
}
示例4: error
bool LEVELSELECT::addDirectoryListEntry(char* directoryName)
{
if (strlen(directoryName)+1 > MAX_PATH)
{
error("LEVELSELECT::addLevelListEntry", "Parameter directoryName too long. Max length is MAX_PATH (%d).", MAX_PATH);
return false;
}
LEVELDIRECTORY *lastDirectory = GetCurrent()->GetDirectory();
LEVELDIRECTORY *newDirectory;
//get last directory
if (lastDirectory != NULL)
{
while (lastDirectory->next != NULL)
{
lastDirectory = lastDirectory->next;
}
}
newDirectory = (LEVELDIRECTORY*)malloc(sizeof(LEVELDIRECTORY));
newDirectory->prev = lastDirectory;
newDirectory->next = NULL;
if (lastDirectory != NULL)
{
lastDirectory->next = newDirectory;
newDirectory->index = lastDirectory->index+1;
}
else
{
newDirectory->index = 0;
}
if (strcmp(directoryName, "..")==0)
{
strcpy(newDirectory->name, "");
}
else
{
strcpy(newDirectory->name, directoryName);
}
GetCurrent()->GetDirectoryPath(newDirectory->path, newDirectory->name);
if (GetCurrent()->GetDirectory() == NULL)
GetCurrent()->currentDirectory = newDirectory;
return true;
}
示例5: GetCurrent
void subPageSpells::Del()
{
School *school = currentSchool;
if ( school->spells.size() == 1 )
{
currentSpell->Clear();
GetCurrent();
return;
}
spellItr = school->spells.erase(spellItr);
delete currentSpell;
currentSpell = *spellItr;
GetCurrent();
}
示例6: SetCurrent
void subPageSpells::Next(unsigned int n)
{
SetCurrent();
std::vector<Spell*> *pSpells = ¤tSchool->spells;
if ( n > (pSpells->size()-spellNumber) && n!=1 )
{
spellItr = pSpells->end();
spellItr--;
currentSpell = *spellItr;
spellNumber = pSpells->size();
return;
}
for ( ; n > 0; n-- )
{
spellItr++;
spellNumber++;
if ( spellItr == pSpells->end() )
{
spellItr = pSpells->begin();
spellNumber = 1;
}
currentSpell = *spellItr;
}
GetCurrent();
}
示例7: NS_GetCurrentThread
bool
TaskQueue::IsCurrentThreadIn()
{
bool in = NS_GetCurrentThread() == mRunningThread;
MOZ_ASSERT(in == (GetCurrent() == this));
return in;
}
示例8: runner
nsresult
TaskQueue::DispatchLocked(already_AddRefed<nsIRunnable> aRunnable,
DispatchMode aMode, DispatchFailureHandling aFailureHandling,
DispatchReason aReason)
{
nsCOMPtr<nsIRunnable> r = aRunnable;
AbstractThread* currentThread;
if (aReason != TailDispatch && (currentThread = GetCurrent()) && RequiresTailDispatch(currentThread)) {
currentThread->TailDispatcher().AddTask(this, r.forget(), aFailureHandling);
return NS_OK;
}
mQueueMonitor.AssertCurrentThreadOwns();
if (mIsFlushing && aMode == AbortIfFlushing) {
return NS_ERROR_ABORT;
}
if (mIsShutdown) {
return NS_ERROR_FAILURE;
}
mTasks.push(r.forget());
if (mIsRunning) {
return NS_OK;
}
nsRefPtr<nsIRunnable> runner(new Runner(this));
nsresult rv = mPool->Dispatch(runner.forget(), NS_DISPATCH_NORMAL);
if (NS_FAILED(rv)) {
NS_WARNING("Failed to dispatch runnable to run TaskQueue");
return rv;
}
mIsRunning = true;
return NS_OK;
}
示例9: GetCurrent
Size DockCont::GetMinSize() const
{
if (ignoreminsize) return Size(0, 0);
Size sz = tabbar.GetCount() ? GetCurrent().GetMinSize() : Size(0, 0);
sz = AddFrameSize(sz);
return sz;
}
示例10: GetCurrent
int CoroutineMgr::Yield(int coid )
{
Coroutine * cur = GetCurrent();
if(!cur)
{
LOG_FATAL("current co is null !");
return -1;
}
Coroutine * co = Find(coid);
if(0 == coid)
{
//switch to prev
co = cur->from;
}
if(!co)
{
LOG_FATAL("current from co is null !");
return -1;
}
if(cur->bState == Coroutine::COROUTINE_STATUS_RUNNING)
{
cur->bState = Coroutine::COROUTINE_STATUS_SUSPEND;
}
co->bState = Coroutine::COROUTINE_STATUS_RUNNING;
SetCurrent(co);
LOG_INFO("co = %d is yield schedule next = %d for = %d",cur->iID,co->iID,coid);
swapcontext(&(cur->ctx),&(co->ctx));
return retval;
}
示例11: GetCurrent
void VirtualHost::UpdateSerializationSizeLimit() {
const VirtualHost *vh = GetCurrent();
assert(vh);
if (vh->m_runtimeOption.serializationSizeLimit != StringData::MaxSize) {
VariableSerializer::serializationSizeLimit =
vh->m_runtimeOption.serializationSizeLimit;
}
}
示例12: GetCurrent
const vector<string> &VirtualHost::GetAllowedDirectories() {
const VirtualHost *vh = GetCurrent();
ASSERT(vh);
if (!vh->m_runtimeOption.allowedDirectories.empty()) {
return vh->m_runtimeOption.allowedDirectories;
}
return RuntimeOption::AllowedDirectories;
}
示例13: Unbind
void Shader::Unbind()
{
if(GetCurrent() != nullptr)
{
glUseProgram(0);
SetCurrent(nullptr);
}
}
示例14: Bind
void Shader::Bind()
{
if(GetCurrent() != this)
{
glUseProgram(id);
SetCurrent(this);
}
}
示例15: DrawMeter
void FProgress::DrawMeter(CDC& dc, FRect& rcPaint)
{
//fill the unavailable
int nLines = rcPaint.Width() / (gLineDistance + gPenWidth) + 1;
int nAvailLines = (int)GetAvail((double)nLines) ;
int nCurrLines = (int)GetCurrent((double)nLines);
assert(nAvailLines >= nCurrLines);
int x = rcPaint.left;
int y = rcPaint.top;
dc.MoveTo(x, y);
int lh = rcPaint.Height() - 0;
int mh = lh;
int nPenIndex = 2;
dc.SelectPen(m_Pens[nPenIndex]);
dword dwStyle = GetWindowLong(GWL_STYLE);
for (int k = 0; k < nLines; k++)
{
if (k == nCurrLines)
{
if (k < nAvailLines)
dc.SelectPen(m_Pens[1]);
else
dc.SelectPen(m_Pens[0]);
if (dwStyle & PROG_LARGER_CURRENT)
{
lh = lh / 2;
y += lh / 2;
dc.MoveTo(x, y);
}
}
else if (k == nAvailLines)
{
dc.SelectPen(m_Pens[0]);
}
if (dwStyle & PROG_GROWING)
{
double dblNow = (double)k / (double)nLines;
lh = (int)(mh * dblNow);
y = mh - lh;
dc.MoveTo(x, y);
}
dc.LineTo(x, y + lh);
x += gLineDistance;
x += gPenWidth;
dc.MoveTo(x, y);
}
}