这篇教程C++ GetCurrentTime函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetCurrentTime函数的典型用法代码示例。如果您正苦于以下问题:C++ GetCurrentTime函数的具体用法?C++ GetCurrentTime怎么用?C++ GetCurrentTime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetCurrentTime函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: srandvoid Monster::JudegeAttack(){ srand((UINT)GetCurrentTime()); int x = rand()%100; if(x>98) { this->AttackAnimation("monster_attack",5,MonsterDirecton); }}
开发者ID:appleappleapple,项目名称:GameOfFighting,代码行数:10,
示例2: RunEnqueueDequeueTrial/* * Function: RunEnqueueDequeueTrial * -------------------------------- * Runs the enqueue & dequeue time trials for the specified * pqueue size. Reports results to cout. * Note that we just randomly choose numbers to insert. * The amount of time it takes to do one enqueue/dequeue is * too small to be accurately measured, so we do many iterations in * a loop and time that. */void RunEnqueueDequeueTrial(int size){ PQueue pq; for (int i = 0; i < size; i++) pq.enqueue(RandomInteger(1,size)); cout << "Time to enqueue into " << size << "-element pqueue: " << flush; double start = GetCurrentTime(); for (int j = 0; j < NumRepetitions; j++) pq.enqueue(RandomInteger(1, 2*size)); cout << 1000*(GetCurrentTime() - start)/NumRepetitions << " usecs" << endl; cout << "Time to dequeue from " << size << "-element pqueue: " << flush; start = GetCurrentTime(); for (int k = 0; k < NumRepetitions; k++) pq.dequeueMax(); cout << 1000*(GetCurrentTime() - start)/NumRepetitions << " usecs" << endl;}
开发者ID:azavadil,项目名称:CS106B_PA,代码行数:29,
示例3: WinMainint WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow){ static int iKeep [NUM][4] ; HDC hdcScr, hdcMem ; int cx, cy ; HBITMAP hBitmap ; HWND hwnd ; int i, j, x1, y1, x2, y2 ; if (LockWindowUpdate (hwnd = GetDesktopWindow ())) { hdcScr = GetDCEx (hwnd, NULL, DCX_CACHE | DCX_LOCKWINDOWUPDATE) ; hdcMem = CreateCompatibleDC (hdcScr) ; cx = GetSystemMetrics (SM_CXSCREEN) / 10 ; cy = GetSystemMetrics (SM_CYSCREEN) / 10 ; hBitmap = CreateCompatibleBitmap (hdcScr, cx, cy) ; SelectObject (hdcMem, hBitmap) ; srand ((int) GetCurrentTime ()) ; for (i = 0 ; i < 2 ; i++) for (j = 0 ; j < NUM ; j++) { if (i == 0) { iKeep [j] [0] = x1 = cx * (rand () % 10) ; iKeep [j] [1] = y1 = cy * (rand () % 10) ; iKeep [j] [2] = x2 = cx * (rand () % 10) ; iKeep [j] [3] = y2 = cy * (rand () % 10) ; } else { x1 = iKeep [NUM - 1 - j] [0] ; y1 = iKeep [NUM - 1 - j] [1] ; x2 = iKeep [NUM - 1 - j] [2] ; y2 = iKeep [NUM - 1 - j] [3] ; } BitBlt (hdcMem, 0, 0, cx, cy, hdcScr, x1, y1, SRCCOPY) ; BitBlt (hdcScr, x1, y1, cx, cy, hdcScr, x2, y2, SRCCOPY) ; BitBlt (hdcScr, x2, y2, cx, cy, hdcMem, 0, 0, SRCCOPY) ; Sleep (10) ; } DeleteDC (hdcMem) ; ReleaseDC (hwnd, hdcScr) ; DeleteObject (hBitmap) ; LockWindowUpdate (NULL) ; } return FALSE ;}
开发者ID:JohnXinhua,项目名称:UVa,代码行数:55,
示例4: kernel_main/*======================================================================*kernel_main*======================================================================*/PUBLIC int kernel_main(){ Init8259A(); Init8253(); SetIRQ(); k_reenter = -1; ticks = 0; get_boot_params(&BootParam); GetCurrentTime(&systime); //?áè?RTCê±?? int i, j, eflags, prio; u8 rpl; u8 priv; TASK * t; PROCESS * p = proc_table; char * stk = task_stack + STACK_SIZE_TOTAL + 0x4000; for (i = 0; i < NR_TASKS + NR_PROCS; i++,p++,t++) { if (i >= NR_TASKS + NR_NATIVE_PROCS) { p->p_flags = FREE_SLOT; p->ldt_sel = SELECTOR_LDT_FIRST + (i << 3); //空槽也要给LDT赋值否则调度任务会#GP异常 continue; } if (i < NR_TASKS) { t = task_table + i; priv = PRIVILEGE_TASK; rpl = RPL_TASK; eflags = 0x1202; prio = 1; } else { t = user_proc_table + (i - NR_TASKS); priv = PRIVILEGE_USER; rpl = RPL_USER; eflags = 0x202; prio = 1; } strcpy(p->name, t->name); p->p_parent = NO_TASK; if (strcmp(t->name, "INIT") != 0) { p->ldts[INDEX_LDT_C] = gdt[SELECTOR_KERNEL_CS >> 3]; p->ldts[INDEX_LDT_RW] = gdt[SELECTOR_KERNEL_DS >> 3]; p->ldts[INDEX_LDT_C].attr1 = DA_C | priv << 5; p->ldts[INDEX_LDT_RW].attr1 = DA_DRW | priv << 5; } else {
开发者ID:OscarLGH,项目名称:Orange-OS,代码行数:58,
示例5: EffectEnd// https://w3c.github.io/web-animations/#finish-an-animationvoidAnimation::Finish(ErrorResult& aRv){ if (mPlaybackRate == 0 || (mPlaybackRate > 0 && EffectEnd() == TimeDuration::Forever())) { aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); return; } AutoMutationBatchForAnimation mb(*this); // Seek to the end TimeDuration limit = mPlaybackRate > 0 ? TimeDuration(EffectEnd()) : TimeDuration(0); bool didChange = GetCurrentTime() != Nullable<TimeDuration>(limit); SilentlySetCurrentTime(limit); // If we are paused or play-pending we need to fill in the start time in // order to transition to the finished state. // // We only do this, however, if we have an active timeline. If we have an // inactive timeline we can't transition into the finished state just like // we can't transition to the running state (this finished state is really // a substate of the running state). if (mStartTime.IsNull() && mTimeline && !mTimeline->GetCurrentTime().IsNull()) { mStartTime.SetValue(mTimeline->GetCurrentTime().Value() - limit.MultDouble(1.0 / mPlaybackRate)); didChange = true; } // If we just resolved the start time for a pause or play-pending // animation, we need to clear the task. We don't do this as a branch of // the above however since we can have a play-pending animation with a // resolved start time if we aborted a pause operation. if (!mStartTime.IsNull() && (mPendingState == PendingState::PlayPending || mPendingState == PendingState::PausePending)) { if (mPendingState == PendingState::PausePending) { mHoldTime.SetNull(); } CancelPendingTasks(); didChange = true; if (mReady) { mReady->MaybeResolve(this); } } UpdateTiming(SeekFlag::DidSeek, SyncNotifyFlag::Sync); if (didChange && IsRelevant()) { nsNodeUtils::AnimationChanged(this); } PostUpdate();}
开发者ID:prashant2018,项目名称:gecko-dev,代码行数:55,
示例6: GetCurrentTimevoidAnimation::SilentlySetPlaybackRate(double aPlaybackRate){ Nullable<TimeDuration> previousTime = GetCurrentTime(); mPlaybackRate = aPlaybackRate; if (!previousTime.IsNull()) { ErrorResult rv; SilentlySetCurrentTime(previousTime.Value()); MOZ_ASSERT(!rv.Failed(), "Should not assert for non-null time"); }}
开发者ID:AtulKumar2,项目名称:gecko-dev,代码行数:11,
示例7: voidAnimationPlayer::SetSource(Animation* aSource){ if (mSource) { mSource->SetParentTime(Nullable<TimeDuration>()); } mSource = aSource; if (mSource) { mSource->SetParentTime(GetCurrentTime()); }}
开发者ID:Andrel322,项目名称:gecko-dev,代码行数:11,
示例8: _GetThreadID void Logger::LogEvent(const String &sMessage) { long lThread = _GetThreadID(); String sTime = GetCurrentTime(); String sData; sData.Format(_T("%d/t/"%s/"/t/"%s/"/r/n"), lThread, sTime, sMessage); _WriteData(sData, Events); }
开发者ID:bogri5520,项目名称:hMailServer,代码行数:11,
示例9: GetCurrentTimevoidClock::Pause (){ //printf ("clock %p (%s) paused/n", this, GetName ()); if (is_paused) return; is_paused = true; begin_pause_time = GetCurrentTime();}
开发者ID:kangaroo,项目名称:moon,代码行数:11,
示例10: SH_RobustAccept/** * Performs a robust accept, restarting when interrupted. * Requires a valid socket (se->fd >= 0). */extern intSH_RobustAccept(SockEntry se) { int timeout = se->base->robustTimeout; uint64_t start = GetCurrentTime(); for (;;) { int connRes = accept(se->fd, NULL, NULL); if (connRes >= 0) { se->lastUsed = GetCurrentTime(); return connRes; } int e = errno; if (e != EAGAIN && e != EINTR) break; MilliSleep(RobustMillis); uint64_t now = GetCurrentTime(); double dt = DeltaTime(start, now); if (dt > timeout) break; } se->errCount++; return -1;}
开发者ID:cawka,项目名称:packaging-ndnx,代码行数:24,
示例11: GetCurrentTime// ProcessEvents// called by the Process at interrupt time to see if there are// any events that have timed out//void STREAM::ProcessEvents(void){ if (qhEvent.IsElements()) { PEVENT pnextevent = (PEVENT)qhEvent.Head(); ULONG time = GetCurrentTime(); ULONG eventtime = pnextevent->GetEventTime(); if (eventtime <= time) pnextevent->Report(time); }}
开发者ID:OS2World,项目名称:DEV-SAMPLES-DRV-Audio_PDD-,代码行数:15,
示例12: SH_RobustConnect/** * Performs a robust connect, restarting when interrupted. * Requires a valid socket (se->fd >= 0). */extern intSH_RobustConnect(SockEntry se, struct sockaddr *sap) { int timeout = se->base->robustTimeout; uint64_t start = GetCurrentTime(); for (;;) { int connRes = connect(se->fd, sap, SockAddrLen(sap)); if (connRes >= 0) { se->lastUsed = GetCurrentTime(); return connRes; } int e = errno; if (e != EAGAIN && e != EINTR) break; MilliSleep(RobustMillis); uint64_t now = GetCurrentTime(); double dt = DeltaTime(start, now); if (dt > timeout) break; } se->errCount++; return -1;}
开发者ID:cawka,项目名称:packaging-ndnx,代码行数:24,
示例13: SysMouseAImpl_GetDeviceState/****************************************************************************** * GetDeviceState : returns the "state" of the mouse. * * For the moment, only the "standard" return structure (DIMOUSESTATE) is * supported. */static HRESULT WINAPI SysMouseAImpl_GetDeviceState( LPDIRECTINPUTDEVICE8A iface,DWORD len,LPVOID ptr) { SysMouseImpl *This = (SysMouseImpl *)iface; if(This->acquired == 0) return DIERR_NOTACQUIRED; EnterCriticalSection(&(This->crit)); TRACE("(this=%p,0x%08lx,%p):/n", This, len, ptr); TRACE("(X: %ld - Y: %ld - Z: %ld L: %02x M: %02x R: %02x)/n", This->m_state.lX, This->m_state.lY, This->m_state.lZ, This->m_state.rgbButtons[0], This->m_state.rgbButtons[2], This->m_state.rgbButtons[1]); /* Copy the current mouse state */ fill_DataFormat(ptr, &(This->m_state), This->wine_df); /* Initialize the buffer when in relative mode */ if (This->absolute == 0) { This->m_state.lX = 0; This->m_state.lY = 0; This->m_state.lZ = 0; } /* Check if we need to do a mouse warping */ if (This->need_warp == WARP_NEEDED && (GetCurrentTime() - This->last_warped > 10)) { dinput_window_check(This); TRACE("Warping mouse to %ld - %ld/n", This->mapped_center.x, This->mapped_center.y); SetCursorPos( This->mapped_center.x, This->mapped_center.y ); This->last_warped = GetCurrentTime();#ifdef MOUSE_HACK This->need_warp = WARP_DONE;#else This->need_warp = WARP_STARTED;#endif } LeaveCriticalSection(&(This->crit)); return DI_OK;}
开发者ID:howard5888,项目名称:wineT,代码行数:47,
示例14: GetPlayerOwner//------------------------------------------------------------------------------// Purpose : Update weapon//------------------------------------------------------------------------------void CWeaponSDKMelee::ItemPostFrame( void ){ CSDKPlayer *pPlayer = GetPlayerOwner(); if ( pPlayer == NULL ) return; if (IsThrowingGrenade()) { if (MaintainGrenadeToss()) return; } else if ((pPlayer->m_nButtons & IN_ALT2) && !IsThrowingGrenade() && pPlayer->GetAmmoCount(GetAmmoDef()->Index("grenades")) && pPlayer->CanAttack()) { bool bAllow = (m_flNextPrimaryAttack < GetCurrentTime()); if (m_bInReload) bAllow = true; if (bAllow) { StartGrenadeToss(); return; } } if (GetSwingTime() > 0 && GetSwingTime() <= GetCurrentTime()) { Swing(); } else if ( (pPlayer->m_nButtons & IN_ATTACK) && (m_flNextPrimaryAttack <= GetCurrentTime()) && pPlayer->CanAttack() ) { PrimaryAttack(); } else if ( (pPlayer->m_nButtons & IN_ATTACK2) && (m_flNextSecondaryAttack <= GetCurrentTime()) && pPlayer->CanAttack() ) { SecondaryAttack(); } else { WeaponIdle(); }}
开发者ID:JorgeChimendes,项目名称:DoubleAction,代码行数:44,
示例15: SH_NewSockEntryNoCheckstatic SockEntrySH_NewSockEntryNoCheck(SockBase base, int sockFD) { SockEntry ret = ProxyUtil_StructAlloc(1, SockEntryStruct); ret->base = base; ret->next = base->list; ret->fd = sockFD; ret->startTime = GetCurrentTime(); ret->lastUsed = ret->startTime; base->list = ret; base->nSocks++; return ret;}
开发者ID:cawka,项目名称:packaging-ndnx,代码行数:12,
示例16: SH_RobustSendmsg/** * Performs a robust sendmsg, restarting when interrupted. * Requires a connection. */extern ssize_tSH_RobustSendmsg(SockEntry se, struct msghdr *mp) { int timeout = se->base->robustTimeout; uint64_t start = GetCurrentTime(); for (;;) { ssize_t nb = sendmsg(se->fd, mp, 0); if (nb >= 0) { se->writeActive = 1; se->lastUsed = GetCurrentTime(); return nb; } int e = errno; if (e != EAGAIN && e != EINTR) break; MilliSleep(RobustMillis); uint64_t now = GetCurrentTime(); double dt = DeltaTime(start, now); if (dt > timeout) break; } se->errCount++; return -1;}
开发者ID:cawka,项目名称:packaging-ndnx,代码行数:25,
示例17: dprintfULONG WAVESTREAM::StopStream(PCONTROL_PARM pControl){ if(ulStreamState == STREAM_STOPPED) { dprintf(("WAVESTREAM::StopStream %lx (already stopped)", ulStreamId)); fUnderrun = FALSE; pControl->ulTime = GetCurrentTime(); return NO_ERROR; } pahw->Stop(this); //Reset cleans up waveout instance OSS16_StreamReset(this); ulStreamState = STREAM_STOPPED; fUnderrun = FALSE; dprintf(("WAVESTREAM::StopStream %lx", ulStreamId)); ReturnBuffers(); pControl->ulTime = GetCurrentTime(); _ulTimeBase = GetCurrentTime(); return NO_ERROR;}
开发者ID:OS2World,项目名称:DRV-SBLiveOS2,代码行数:21,
示例18: GetCurrentTime int Timer::DelayIsComplete (const Time& delay, bool reset) { float currentTime = GetCurrentTime ().GetValue (); int factor = static_cast<int> ( currentTime / delay.GetValue ()); if (reset && factor > 0) Reset (Time (currentTime - factor * delay.GetValue ())); return factor; }
开发者ID:Noxalus,项目名称:YAPOG,代码行数:12,
示例19: sprintfint CAppLoger::Init(const std::string& strPath, const std::string& strLogFileName, const int& iLogLevel){ if(strPath.empty()) { m_strLogPath = "."; } else { //暂时不支持路径处理,待后期维护 //这是一个坑吗? // m_strLogPath = strPath; } //待完成 //以时间戳和pid作为默认文件名 if(strLogFileName.empty()) { char szTmp[128] = {'0'}; sprintf(szTmp, "%d", getpid()); std::string strTmp(szTmp); //m_strLogFileName = strTmp+"_"+GetCurrentTime().replace(10,1, "_")+".log"; std::string strTmpTime = GetCurrentTime(); std::string strFromatTime=""; for(std::string::iterator it = strTmpTime.begin(); it != strTmpTime.end(); it++) { if(*it == '_' || *it == '-' || *it == ' ' || *it == ':') { continue; } strFromatTime.push_back((*it)); } m_strLogFileName = strTmp +"-"+strFromatTime + ".log"; } else { m_strLogFileName = strLogFileName; } if(iLogLevel > INF) { std::cout<<"this level "<< iLogLevel << "is so large"<<std::endl; return RUN_ERROR; } else { m_iLogLevel = iLogLevel; } return RUN_OK;}
开发者ID:mfslog,项目名称:Code,代码行数:53,
示例20: GetCurrentTimevoid CPerformanceAnalysis::StartTiming(){ int hour, minute, second, msecond; GetCurrentTime(hour, minute, second); GetPreciseCurrentTime(msecond); m_Functions[m_CurrentFunction].ExecutionTime.Hour = hour; m_Functions[m_CurrentFunction].ExecutionTime.Minute = minute; m_Functions[m_CurrentFunction].ExecutionTime.Second = second; m_Functions[m_CurrentFunction].ExecutionTime.Millisecond = msecond;}
开发者ID:jmfrouin,项目名称:gnulinux-sdatabase,代码行数:12,
示例21: InitContainersvoid CExactMethodForDGP::Execute(){ if (fComputationCompleted) return; if (!fLocked) { fLocked = true; nCountOfWindows = 0; nMaxLenOfWindowQueue = 0; depthOfResultingTree = 0; InitContainers(); nTotalMilliSeconds = GetCurrentTime(); BuildSequenceTree(); nTotalMilliSeconds = GetCurrentTime() - nTotalMilliSeconds; //FillExperimentalResults(); ClearContainers(); fComputationCompleted = true; fLocked = false; }}
开发者ID:phg1024,项目名称:Unfolding2,代码行数:21,
示例22: InitializeVOID CThread::Initialize(){ INT nTimeout; for (m_dwTime = GetCurrentTime(), m_dwTimeout = (SystemParametersInfo(SPI_GETHUNGAPPTIMEOUT, 0, &nTimeout, 0)) ? (DWORD)nTimeout : 0; m_hThread != (HANDLE)NULL; ) { CloseHandle(m_hThread); break; } CommonConstruct(); m_bAutoDelete = FALSE;}
开发者ID:BINARY-SPACE,项目名称:SatView,代码行数:12,
示例23: FadeToGammaOSStatus FadeToGamma( ScreenRef screen, const RLGammaTable *newGamma, float seconds ){ if( ! newGamma ) return paramErr; DEBUGMESSAGE( "Fading to new gamma over " << seconds << " seconds." ); //Calculate the starting and ending time for out fade double startTime = GetCurrentTime(); double endTime = startTime + seconds; //Determine our starting gamma RLGammaTable oldGamma, currentGamma; OSStatus error = GetGamma( screen, &oldGamma ); if( error ) return error; //Loop until we run out of time, resetting the gamma as fast as possible for( double currentTime = GetCurrentTime(); currentTime < endTime && ! error; currentTime = GetCurrentTime() ) { //The fraction is the percentage of time that we have spend so far in this loop as a value between 0 and 1.0 double fraction = (currentTime - startTime) / seconds; //Calculate the new gamma based on the amount of time spent so far //(1-fraction)startGamma + fraction * endGamma = startGamma + fraction( endGamma - startGamma) for( int i = 0; i < kGammaTableEntryCount; i++ ) { currentGamma.red[i] = oldGamma.red[i] + fraction * (newGamma->red[i] - oldGamma.red[i]); currentGamma.green[i] = oldGamma.green[i] + fraction * (newGamma->green[i] - oldGamma.green[i]); currentGamma.blue[i] = oldGamma.blue[i] + fraction * (newGamma->blue[i] - oldGamma.blue[i]); } error = SetGamma( screen, ¤tGamma ); } if( error ) DEBUGMESSAGE( "Got error # " << error << " doing a gamma fade in FadeToGamma(). Attempting to achieve the final gamma...." ); return SetGamma( screen, newGamma );}
开发者ID:mctully,项目名称:tntbasic,代码行数:40,
示例24: Display_static voidDisplay_(void){ FrameCount++; ExecutionCount++; uint64_t uiStartTime = GetCurrentTime(); glClearColor (0.0, 0.0, 0.0, 0.0); glClear (GL_COLOR_BUFFER_BIT); if(Animated) { UpdateData(); UpdateVBOs(); } int err = Recompute(); if (err != 0) { printf("Error %d from Recompute!/n", err); exit(1); } if (EnableStideExec && ((ExecutionCount / ExecuteStride) % 2) == 0) { printf("CL only for frame %d/n", ExecutionCount); return; } glDrawArrays(GL_POINTS, 0, DataElemCount / 4); ReportInfo(); glFinish(); // for timing uint64_t uiEndTime = GetCurrentTime(); ReportStats(uiStartTime, uiEndTime); DrawText(TextOffset[0], TextOffset[1], 1, (Animated == 0) ? "Press space to animate" : " "); glutSwapBuffers();}
开发者ID:hominidclint,项目名称:cl-gl-benchmark,代码行数:40,
示例25: RunSortTrial/* * Function: RunSortTrial * ---------------------- * Runs the sorting time trial for the specified pqueue size. * Reports results to cout. */void RunSortTrial(int size){ int *array = new int[size]; for (int i = 0; i < size; i++) // put random data into array array[i] = RandomInteger(1, size); cout << "Time to pqsort random sequence of " << size << " elements: " << flush; double start = GetCurrentTime(); PQSort(array, size); cout << GetCurrentTime() - start << " msecs" << endl; cout << "Time to pqsort sorted sequence of " << size << " elements: " << flush; for (int j = 0; j < size; j++) // put data in array already sorted array[j] = j; start = GetCurrentTime(); PQSort(array, size); cout << GetCurrentTime() - start << " msecs" << endl; cout << "Time to pqsort reverse-sorted sequence of " << size << " elements: " << flush; for (int k = 0; k < size; k++) // put data in array already reverse sorted array[k] = size - k; start = GetCurrentTime(); PQSort(array, size); cout << GetCurrentTime() - start << " msecs" << endl; delete [] array;}
开发者ID:azavadil,项目名称:CS106B_PA,代码行数:33,
示例26: DemoInit//--------------------------------------------------------------// Name: DemoInit - global// Description: Initiate the things needed for the demo// Arguments: None// Return Value: A boolean variable: -true: successful initiation// -false: unsuccessful initiation//--------------------------------------------------------------bool DemoInit( void ){ srand( GetCurrentTime( ) ); g_glApp.Init( 10, 10, g_iScreenWidth, g_iScreenHeight, 16, "Demo 4_3: Slope Lighting", IDI_ICON1, IDR_MENU1 ); g_glApp.CreateTTFont( "Lucida Console", 16 ); //set the clear color (background) to black glClearColor( 0.0f, 0.0f, 0.0f, 0.0f ); glDisable( GL_TEXTURE_2D ); //disable two dimensional texture mapping glDisable( GL_LIGHTING ); //disable lighting glDisable( GL_BLEND ); //disable blending glEnable( GL_DEPTH_TEST ); //enable depth testing glShadeModel( GL_SMOOTH ); //enable smooth shading glClearDepth( 1.0 ); //depth buffer setup glDepthFunc( GL_LEQUAL ); //set the type of depth test glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST ); //the nicest perspective look //load the height map in g_bruteForce.MakeTerrainPlasma( 128, 1.0f ); g_bruteForce.SetHeightScale( 0.25f ); //set the terrain's lighting system up g_bruteForce.SetLightingType( SLOPE_LIGHT ); g_bruteForce.SetLightColor( CVECTOR( 1.0f, 1.0f, 1.0f ) ); g_bruteForce.CustomizeSlopeLighting( 1, 1, 0.2f, 0.9f, 15 ); g_bruteForce.CalculateLighting( ); //load the various terrain tiles g_bruteForce.LoadTile( LOWEST_TILE, "../Data/lowestTile.tga" ); g_bruteForce.LoadTile( LOW_TILE, "../Data/lowTile.tga" ); g_bruteForce.LoadTile( HIGH_TILE, "../Data/highTile.tga" ); g_bruteForce.LoadTile( HIGHEST_TILE, "../Data/highestTile.tga" ); //load the terrain's detail map g_bruteForce.LoadDetailMap( "../Data/detailMap.tga" ); g_bruteForce.DoDetailMapping( g_bDetail, 8 ); //make the texture map, and then save it g_bruteForce.GenerateTextureMap( 256 ); g_bruteForce.DoTextureMapping( g_bTexture ); g_bruteForce.DoMultitexturing( g_glApp.CanMultitexture( ) ); //set the camera's position g_camera.SetPosition( 64.0f, 128.0f, 256.0f ); g_camera.m_fPitch-= 25; //the initiation was successful g_log.Write( LOG_SUCCESS, "INITIATION SUCCESSFUL" ); return true;}
开发者ID:jinshizi,项目名称:rushcodes,代码行数:59,
示例27: SetCurrentTimevoidAnimation::SetCurrentTimeAsDouble(const Nullable<double>& aCurrentTime, ErrorResult& aRv){ if (aCurrentTime.IsNull()) { if (!GetCurrentTime().IsNull()) { aRv.Throw(NS_ERROR_DOM_TYPE_ERR); } return; } return SetCurrentTime(TimeDuration::FromMilliseconds(aCurrentTime.Value()));}
开发者ID:AtulKumar2,项目名称:gecko-dev,代码行数:13,
示例28: SysMouseAImpl_GetDeviceData/****************************************************************************** * GetDeviceData : gets buffered input data. */static HRESULT WINAPI SysMouseAImpl_GetDeviceData(LPDIRECTINPUTDEVICE8A iface, DWORD dodsize, LPDIDEVICEOBJECTDATA dod, LPDWORD entries, DWORD flags){ SysMouseImpl *This = (SysMouseImpl *)iface; HRESULT res; res = IDirectInputDevice2AImpl_GetDeviceData(iface, dodsize, dod, entries, flags); if (FAILED(res)) return res; /* Check if we need to do a mouse warping */ if (This->need_warp && (GetCurrentTime() - This->last_warped > 10)) { if(!dinput_window_check(This)) return DIERR_GENERIC; TRACE("Warping mouse to %d - %d/n", This->mapped_center.x, This->mapped_center.y); SetCursorPos( This->mapped_center.x, This->mapped_center.y ); This->last_warped = GetCurrentTime(); This->need_warp = FALSE; } return res;}
开发者ID:WASSUM,项目名称:longene_travel,代码行数:25,
注:本文中的GetCurrentTime函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetCurrentTimestamp函数代码示例 C++ GetCurrentThreadId函数代码示例 |