本文整理汇总了C++中Update函数的典型用法代码示例。如果您正苦于以下问题:C++ Update函数的具体用法?C++ Update怎么用?C++ Update使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Update函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Update
void CHistoryPane::OnSize(UINT nType, int cx, int cy)
{
CStatic::OnSize(nType, cx, cy);
Update();
RedrawWindow();
}
示例2: Validity
Interval Validity(TimeValue t) {Interval v; Update(t,v); return ivalid;}
示例3: Update
const Matrix4f Camera::GetMatrix()
{
Update();
return mat;
}
示例4: UpdateWithOffset
/**
* Updates the time stamp, setting it to the current clock plus the
* specified offset.
*/
void UpdateWithOffset(int offset) {
Update();
last += offset;
}
示例5: Update
void XyzWindow::On_Adjust()
{
Update(XY_VIEW);
Update(XZ_VIEW);
Update(ZY_VIEW);
}
示例6: while
void cIncrementalRedstoneSimulator::Simulate(float a_dt)
{
for (auto & DelayInfo : m_Data.m_MechanismDelays)
{
if ((--DelayInfo.second.first) == 0)
{
m_Data.GetActiveBlocks().emplace_back(DelayInfo.first);
}
}
// Build our work queue
cVector3iArray WorkQueue;
std::swap(WorkQueue, m_Data.GetActiveBlocks());
// Process the work queue
while (!WorkQueue.empty())
{
// Grab the first element and remove it from the list
Vector3i CurrentLocation = WorkQueue.back();
WorkQueue.pop_back();
BLOCKTYPE CurrentBlock;
NIBBLETYPE CurrentMeta;
if (!m_World.GetBlockTypeMeta(CurrentLocation.x, CurrentLocation.y, CurrentLocation.z, CurrentBlock, CurrentMeta))
{
continue;
}
auto CurrentHandler = cIncrementalRedstoneSimulator::CreateComponent(m_World, CurrentBlock, &m_Data);
if (CurrentHandler == nullptr) // Block at CurrentPosition doesn't have a corresponding redstone handler
{
// Clean up cached PowerData for CurrentPosition
static_cast<cIncrementalRedstoneSimulator *>(m_World.GetRedstoneSimulator())->GetChunkData()->ErasePowerData(CurrentLocation);
continue;
}
cRedstoneHandler::PoweringData Power;
for (const auto & Location : CurrentHandler->GetValidSourcePositions(CurrentLocation, CurrentBlock, CurrentMeta))
{
if (!cChunk::IsValidHeight(Location.y))
{
continue;
}
BLOCKTYPE PotentialBlock;
NIBBLETYPE PotentialMeta;
m_World.GetBlockTypeMeta(Location.x, Location.y, Location.z, PotentialBlock, PotentialMeta);
auto PotentialSourceHandler = cIncrementalRedstoneSimulator::CreateComponent(m_World, PotentialBlock, &m_Data);
if (PotentialSourceHandler == nullptr)
{
continue;
}
decltype(Power) PotentialPower(PotentialBlock, PotentialSourceHandler->GetPowerDeliveredToPosition(Location, PotentialBlock, PotentialMeta, CurrentLocation, CurrentBlock));
Power = std::max(Power, PotentialPower);
}
// Inform the handler to update
cVector3iArray Updates = CurrentHandler->Update(CurrentLocation, CurrentBlock, CurrentMeta, Power);
WorkQueue.insert(WorkQueue.end(), Updates.begin(), Updates.end());
if (IsAlwaysTicked(CurrentBlock))
{
m_Data.GetActiveBlocks().emplace_back(CurrentLocation);
}
}
}
示例7: INDEXTOOVERLAYMASK
void CLibraryFolderCtrl::Update(CLibraryFolder* pFolder, HTREEITEM hFolder, HTREEITEM hParent, DWORD nUpdateCookie, BOOL bRecurse)
{
if ( ! hFolder )
{
DWORD dwStyle = INDEXTOOVERLAYMASK( pFolder->IsShared() ? 0 : SHI_O_LOCKED );
if ( pFolder->m_sPath.CompareNoCase( Settings.Downloads.CompletePath ) == 0 ) dwStyle |= TVIS_BOLD;
if ( m_bMultiSelect && GetFirstSelectedItem() == NULL ) dwStyle |= TVIS_SELECTED;
if ( pFolder->m_bExpanded ) dwStyle |= TVIS_EXPANDED;
CString strName = pFolder->m_sName;
if ( pFolder->m_pParent == NULL )
{
CString strDrive;
if ( pFolder->m_sPath.Find( _T(":\\") ) == 1 || pFolder->m_sPath.GetLength() == 2 )
strDrive.Format( _T(" (%c:)"), pFolder->m_sPath[0] );
else
strDrive = _T(" (Net)");
strName += strDrive;
dwStyle |= TVIS_EXPANDED;
}
hFolder = InsertItem( TVIF_PARAM|TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_STATE,
strName, SHI_FOLDER_CLOSED, SHI_FOLDER_CLOSED, dwStyle,
TVIS_EXPANDED|TVIS_SELECTED|TVIS_OVERLAYMASK, (LPARAM)pFolder, hParent, TVI_SORT );
}
else
{
DWORD dwMask = TVIS_OVERLAYMASK | TVIS_BOLD;
DWORD dwStyle = INDEXTOOVERLAYMASK( pFolder->IsShared() ? 0 : SHI_O_LOCKED );
if ( pFolder->m_sPath.CompareNoCase( Settings.Downloads.CompletePath ) == 0 ) dwStyle |= TVIS_BOLD;
DWORD dwExisting = GetItemState( hFolder, dwMask ) & dwMask;
if ( dwExisting != dwStyle ) SetItemState( hFolder, dwStyle, dwMask );
}
if ( nUpdateCookie )
{
if ( bRecurse || ( GetItemState( hFolder, TVIS_SELECTED ) & TVIS_SELECTED ) )
{
pFolder->m_nSelectCookie = nUpdateCookie;
bRecurse |= ( GetItemState( hFolder, TVIS_EXPANDED ) & TVIS_EXPANDED ) == 0;
}
}
CPtrList pAlready;
for ( HTREEITEM hItem = GetChildItem( hFolder ) ; hItem ; )
{
HTREEITEM hNext = GetNextSiblingItem( hItem );
CLibraryFolder* pChild = (CLibraryFolder*)GetItemData( hItem );
if ( pFolder->CheckFolder( pChild ) )
{
Update( pChild, hItem, NULL, nUpdateCookie, bRecurse );
pAlready.AddTail( pChild );
}
else
{
DeleteItem( hItem );
}
hItem = hNext;
}
for ( POSITION pos = pFolder->GetFolderIterator() ; pos ; )
{
CLibraryFolder* pChild = pFolder->GetNextFolder( pos );
if ( pAlready.Find( pChild ) == NULL )
{
Update( pChild, NULL, hFolder, nUpdateCookie, bRecurse );
}
}
int nOldImage1, nOldImage2;
GetItemImage( hFolder, nOldImage1, nOldImage2 );
int nImage = ItemHasChildren( hFolder ) && ( GetItemState( hFolder, TVIS_EXPANDED ) & TVIS_EXPANDED );
nImage = nImage ? SHI_FOLDER_OPEN : SHI_FOLDER_CLOSED;
if ( nOldImage1 != nImage ) SetItemImage( hFolder, nImage, nImage );
}
示例8: Update
void PhaseMgr::UnRegisterPhasingAuraEffect(AuraEffect const* auraEffect)
{
_UpdateFlags |= phaseData.RemoveAuraInfo(auraEffect->GetId());
Update();
}
示例9: Update
float Random::Generate(float low, float high)
{
Update();
return (seed & BRICKS_RANDOM_MAX) * (high - low) / BRICKS_RANDOM_MAX + low;
}
示例10: Update
void World::UpdatePos(float x, float y)
{
_x = x;
_y = y;
Update();
}
示例11: SetTopParent
//.........这里部分代码省略.........
(
this,
wxID_ANY,
maximum,
wxDefaultPosition,
// make the progress bar sufficiently long
wxSize(wxMin(wxGetClientDisplayRect().width/3, 300), -1),
gauge_style
);
sizerTop->Add(m_gauge, 0, wxLEFT | wxRIGHT | wxTOP | wxEXPAND, 2*LAYOUT_MARGIN);
m_gauge->SetValue(0);
// create the estimated/remaining/total time zones if requested
m_elapsed =
m_estimated =
m_remaining = NULL;
// also count how many labels we really have
size_t nTimeLabels = 0;
wxSizer * const sizerLabels = new wxFlexGridSizer(2);
if ( style & wxPD_ELAPSED_TIME )
{
nTimeLabels++;
m_elapsed = CreateLabel(GetElapsedLabel(), sizerLabels);
}
if ( style & wxPD_ESTIMATED_TIME )
{
nTimeLabels++;
m_estimated = CreateLabel(GetEstimatedLabel(), sizerLabels);
}
if ( style & wxPD_REMAINING_TIME )
{
nTimeLabels++;
m_remaining = CreateLabel(GetRemainingLabel(), sizerLabels);
}
sizerTop->Add(sizerLabels, 0, wxALIGN_CENTER_HORIZONTAL | wxTOP, LAYOUT_MARGIN);
m_btnAbort =
m_btnSkip = NULL;
wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL);
const int borderFlags =
#if defined(__WXMSW__) || defined(__WXOSX__)
wxALL
#else
wxBOTTOM | wxTOP
#endif
;
const wxSizerFlags sizerFlags
= wxSizerFlags().Border(borderFlags, LAYOUT_MARGIN);
if ( HasPDFlag(wxPD_CAN_SKIP) )
{
m_btnSkip = new wxButton(this, wxID_SKIP, _("&Skip"));
buttonSizer->Add(m_btnSkip, sizerFlags);
}
if ( HasPDFlag(wxPD_CAN_ABORT) )
{
m_btnAbort = new wxButton(this, wxID_CANCEL);
buttonSizer->Add(m_btnAbort, sizerFlags);
}
if ( !HasPDFlag(wxPD_CAN_SKIP | wxPD_CAN_ABORT) )
buttonSizer->AddSpacer(LAYOUT_MARGIN);
sizerTop->Add(buttonSizer, sizerFlags);
SetSizerAndFit(sizerTop);
Centre(wxCENTER_FRAME | wxBOTH);
DisableOtherWindows();
Show();
Enable();
// this one can be initialized even if the others are unknown for now
//
// NB: do it after calling Layout() to keep the labels correctly aligned
if ( m_elapsed )
{
SetTimeLabel(0, m_elapsed);
}
Update();
return true;
}
示例12: PlayDemo
//------------------------------------------------------------
// Game loop
//------------------------------------------------------------
void PlayDemo()
{
Update();
RenderFrame();
}
示例13: wxCHECK_MSG
bool
wxGenericProgressDialog::Update(int value, const wxString& newmsg, bool *skip)
{
if ( !DoBeforeUpdate(skip) )
return false;
wxCHECK_MSG( m_gauge, false, "dialog should be fully created" );
#ifdef __WXMSW__
value /= m_factor;
#endif // __WXMSW__
wxASSERT_MSG( value <= m_maximum, wxT("invalid progress value") );
m_gauge->SetValue(value);
UpdateMessage(newmsg);
if ( (m_elapsed || m_remaining || m_estimated) && (value != 0) )
{
unsigned long elapsed;
unsigned long display_remaining;
UpdateTimeEstimates( value,
elapsed,
m_display_estimated,
display_remaining );
SetTimeLabel(elapsed, m_elapsed);
SetTimeLabel(m_display_estimated, m_estimated);
SetTimeLabel(display_remaining, m_remaining);
}
if ( value == m_maximum )
{
if ( m_state == Finished )
{
// ignore multiple calls to Update(m_maximum): it may sometimes be
// troublesome to ensure that Update() is not called twice with the
// same value (e.g. because of the rounding errors) and if we don't
// return now we're going to generate asserts below
return true;
}
// so that we return true below and that out [Cancel] handler knew what
// to do
m_state = Finished;
if( !HasPDFlag(wxPD_AUTO_HIDE) )
{
EnableClose();
DisableSkip();
#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
EnableCloseButton();
#endif // __WXMSW__
if ( newmsg.empty() )
{
// also provide the finishing message if the application didn't
m_msg->SetLabel(_("Done."));
}
// allow the window to repaint:
// NOTE: since we yield only for UI events with this call, there
// should be no side-effects
wxEventLoopBase::GetActive()->YieldFor(wxEVT_CATEGORY_UI);
// NOTE: this call results in a new event loop being created
// and to a call to ProcessPendingEvents() (which may generate
// unwanted re-entrancies).
(void)ShowModal();
}
else // auto hide
{
// reenable other windows before hiding this one because otherwise
// Windows wouldn't give the focus back to the window which had
// been previously focused because it would still be disabled
ReenableOtherWindows();
Hide();
}
}
else // not at maximum yet
{
DoAfterUpdate();
}
// update the display in case yielding above didn't do it
Update();
return m_state != Canceled;
}
示例14: Update
void Debugger_Disasm::RemoveBreakpoint()
{
CBreakPoints::RemoveBreakPoint(breakpointAddr);
Update();
}
示例15: ZeroMemory
/// <summary>
/// Creates the main window and begins processing
/// </summary>
/// <param name="hInstance">handle to the application instance</param>
/// <param name="nCmdShow">whether to display minimized, maximized, or normally</param>
int CDataCollection::Run(HINSTANCE hInstance, int nCmdShow)
{
MSG msg = {0};
WNDCLASS wc;
// Dialog custom window class
ZeroMemory(&wc, sizeof(wc));
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.cbWndExtra = DLGWINDOWEXTRA;
wc.hInstance = hInstance;
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_APP));
wc.lpfnWndProc = DefDlgProc;
wc.lpszClassName = L"DataCollectionAppDlgWndClass";
if (!RegisterClass(&wc))
{
return 0;
}
// Create main application window
HWND hWndApp = CreateDialogParam(
hInstance,
MAKEINTRESOURCE(IDD_APP),
NULL,
(DLGPROC)CDataCollection::MessageRouter,
reinterpret_cast<LPARAM>(this));
// Show window
ShowWindow(hWndApp, nCmdShow);
const int eventCount = 2;
HANDLE hEvents[eventCount]={m_hNextColorFrameEvent, m_hNextSkeletonEvent};
// Main message loop
while (WM_QUIT != msg.message)
{
// Check to see if we have either a message (by passing in QS_ALLINPUT)
// Or a Kinect event (hEvents)
// Update() will check for Kinect events individually, in case more than one are signalled
DWORD dwEvent = MsgWaitForMultipleObjects(eventCount, hEvents, FALSE, INFINITE, QS_ALLINPUT);
// Check if this is an event we're waiting on and not a timeout or message
if ((WAIT_OBJECT_0 == dwEvent)||(WAIT_OBJECT_0+1)==dwEvent)
{
Update();
}
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
// If a dialog message will be taken care of by the dialog proc
if ((hWndApp != NULL) && IsDialogMessage(hWndApp, &msg))
{
continue;
}
TranslateMessage(&msg);
DispatchMessageW(&msg);
}
}
return static_cast<int>(msg.wParam);
}