亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? dxutil.cpp

?? Introduction to directx9 3d game programming 一書的源代碼
?? CPP
?? 第 1 頁 / 共 3 頁
字號(hào):
    if( m_bUsingQPF )
    {
        static LONGLONG m_llStopTime        = 0;
        static LONGLONG m_llLastElapsedTime = 0;
        static LONGLONG m_llBaseTime        = 0;
        double fTime;
        double fElapsedTime;
        LARGE_INTEGER qwTime;
        
        // Get either the current time or the stop time, depending
        // on whether we're stopped and what command was sent
        if( m_llStopTime != 0 && command != TIMER_START && command != TIMER_GETABSOLUTETIME)
            qwTime.QuadPart = m_llStopTime;
        else
            QueryPerformanceCounter( &qwTime );

        // Return the elapsed time
        if( command == TIMER_GETELAPSEDTIME )
        {
            fElapsedTime = (double) ( qwTime.QuadPart - m_llLastElapsedTime ) / (double) m_llQPFTicksPerSec;
            m_llLastElapsedTime = qwTime.QuadPart;
            return (FLOAT) fElapsedTime;
        }
    
        // Return the current time
        if( command == TIMER_GETAPPTIME )
        {
            double fAppTime = (double) ( qwTime.QuadPart - m_llBaseTime ) / (double) m_llQPFTicksPerSec;
            return (FLOAT) fAppTime;
        }
    
        // Reset the timer
        if( command == TIMER_RESET )
        {
            m_llBaseTime        = qwTime.QuadPart;
            m_llLastElapsedTime = qwTime.QuadPart;
            m_llStopTime        = 0;
            m_bTimerStopped     = FALSE;
            return 0.0f;
        }
    
        // Start the timer
        if( command == TIMER_START )
        {
            if( m_bTimerStopped )
                m_llBaseTime += qwTime.QuadPart - m_llStopTime;
            m_llStopTime = 0;
            m_llLastElapsedTime = qwTime.QuadPart;
            m_bTimerStopped = FALSE;
            return 0.0f;
        }
    
        // Stop the timer
        if( command == TIMER_STOP )
        {
            m_llStopTime = qwTime.QuadPart;
            m_llLastElapsedTime = qwTime.QuadPart;
            m_bTimerStopped = TRUE;
            return 0.0f;
        }
    
        // Advance the timer by 1/10th second
        if( command == TIMER_ADVANCE )
        {
            m_llStopTime += m_llQPFTicksPerSec/10;
            return 0.0f;
        }

        if( command == TIMER_GETABSOLUTETIME )
        {
            fTime = qwTime.QuadPart / (double) m_llQPFTicksPerSec;
            return (FLOAT) fTime;
        }

        return -1.0f; // Invalid command specified
    }
    else
    {
        // Get the time using timeGetTime()
        static double m_fLastElapsedTime  = 0.0;
        static double m_fBaseTime         = 0.0;
        static double m_fStopTime         = 0.0;
        double fTime;
        double fElapsedTime;
        
        // Get either the current time or the stop time, depending
        // on whether we're stopped and what command was sent
        if( m_fStopTime != 0.0 && command != TIMER_START && command != TIMER_GETABSOLUTETIME)
            fTime = m_fStopTime;
        else
            fTime = GETTIMESTAMP() * 0.001;
    
        // Return the elapsed time
        if( command == TIMER_GETELAPSEDTIME )
        {   
            fElapsedTime = (double) (fTime - m_fLastElapsedTime);
            m_fLastElapsedTime = fTime;
            return (FLOAT) fElapsedTime;
        }
    
        // Return the current time
        if( command == TIMER_GETAPPTIME )
        {
            return (FLOAT) (fTime - m_fBaseTime);
        }
    
        // Reset the timer
        if( command == TIMER_RESET )
        {
            m_fBaseTime         = fTime;
            m_fLastElapsedTime  = fTime;
            m_fStopTime         = 0;
            m_bTimerStopped     = FALSE;
            return 0.0f;
        }
    
        // Start the timer
        if( command == TIMER_START )
        {
            if( m_bTimerStopped )
                m_fBaseTime += fTime - m_fStopTime;
            m_fStopTime = 0.0f;
            m_fLastElapsedTime  = fTime;
            m_bTimerStopped = FALSE;
            return 0.0f;
        }
    
        // Stop the timer
        if( command == TIMER_STOP )
        {
            m_fStopTime = fTime;
            m_fLastElapsedTime  = fTime;
            m_bTimerStopped = TRUE;
            return 0.0f;
        }
    
        // Advance the timer by 1/10th second
        if( command == TIMER_ADVANCE )
        {
            m_fStopTime += 0.1f;
            return 0.0f;
        }

        if( command == TIMER_GETABSOLUTETIME )
        {
            return (FLOAT) fTime;
        }

        return -1.0f; // Invalid command specified
    }
}




//-----------------------------------------------------------------------------
// Name: DXUtil_ConvertAnsiStringToWideCch()
// Desc: This is a UNICODE conversion utility to convert a CHAR string into a
//       WCHAR string. 
//       cchDestChar is the size in TCHARs of wstrDestination.  Be careful not to 
//       pass in sizeof(strDest) 
//-----------------------------------------------------------------------------
HRESULT DXUtil_ConvertAnsiStringToWideCch( WCHAR* wstrDestination, const CHAR* strSource, 
                                     int cchDestChar )
{
    if( wstrDestination==NULL || strSource==NULL || cchDestChar < 1 )
        return E_INVALIDARG;

    int nResult = MultiByteToWideChar( CP_ACP, 0, strSource, -1, 
                                       wstrDestination, cchDestChar );
    wstrDestination[cchDestChar-1] = 0;
    
    if( nResult == 0 )
        return E_FAIL;
    return S_OK;
}




//-----------------------------------------------------------------------------
// Name: DXUtil_ConvertWideStringToAnsi()
// Desc: This is a UNICODE conversion utility to convert a WCHAR string into a
//       CHAR string. 
//       cchDestChar is the size in TCHARs of strDestination
//-----------------------------------------------------------------------------
HRESULT DXUtil_ConvertWideStringToAnsiCch( CHAR* strDestination, const WCHAR* wstrSource, 
                                     int cchDestChar )
{
    if( strDestination==NULL || wstrSource==NULL || cchDestChar < 1 )
        return E_INVALIDARG;

    int nResult = WideCharToMultiByte( CP_ACP, 0, wstrSource, -1, strDestination, 
                                       cchDestChar*sizeof(CHAR), NULL, NULL );
    strDestination[cchDestChar-1] = 0;
    
    if( nResult == 0 )
        return E_FAIL;
    return S_OK;
}




//-----------------------------------------------------------------------------
// Name: DXUtil_ConvertGenericStringToAnsi()
// Desc: This is a UNICODE conversion utility to convert a TCHAR string into a
//       CHAR string. 
//       cchDestChar is the size in TCHARs of strDestination
//-----------------------------------------------------------------------------
HRESULT DXUtil_ConvertGenericStringToAnsiCch( CHAR* strDestination, const TCHAR* tstrSource, 
                                           int cchDestChar )
{
    if( strDestination==NULL || tstrSource==NULL || cchDestChar < 1 )
        return E_INVALIDARG;

#ifdef _UNICODE
    return DXUtil_ConvertWideStringToAnsiCch( strDestination, tstrSource, cchDestChar );
#else
    strncpy( strDestination, tstrSource, cchDestChar );
    strDestination[cchDestChar-1] = '\0';
    return S_OK;
#endif   
}




//-----------------------------------------------------------------------------
// Name: DXUtil_ConvertGenericStringToWide()
// Desc: This is a UNICODE conversion utility to convert a TCHAR string into a
//       WCHAR string. 
//       cchDestChar is the size in TCHARs of wstrDestination.  Be careful not to 
//       pass in sizeof(strDest) 
//-----------------------------------------------------------------------------
HRESULT DXUtil_ConvertGenericStringToWideCch( WCHAR* wstrDestination, const TCHAR* tstrSource, 
                                           int cchDestChar )
{
    if( wstrDestination==NULL || tstrSource==NULL || cchDestChar < 1 )
        return E_INVALIDARG;

#ifdef _UNICODE
    wcsncpy( wstrDestination, tstrSource, cchDestChar );
    wstrDestination[cchDestChar-1] = L'\0';
    return S_OK;
#else
    return DXUtil_ConvertAnsiStringToWideCch( wstrDestination, tstrSource, cchDestChar );
#endif    
}




//-----------------------------------------------------------------------------
// Name: DXUtil_ConvertAnsiStringToGeneric()
// Desc: This is a UNICODE conversion utility to convert a CHAR string into a
//       TCHAR string. 
//       cchDestChar is the size in TCHARs of tstrDestination.  Be careful not to 
//       pass in sizeof(strDest) on UNICODE builds
//-----------------------------------------------------------------------------
HRESULT DXUtil_ConvertAnsiStringToGenericCch( TCHAR* tstrDestination, const CHAR* strSource, 
                                           int cchDestChar )
{
    if( tstrDestination==NULL || strSource==NULL || cchDestChar < 1 )
        return E_INVALIDARG;
        
#ifdef _UNICODE
    return DXUtil_ConvertAnsiStringToWideCch( tstrDestination, strSource, cchDestChar );
#else
    strncpy( tstrDestination, strSource, cchDestChar );
    tstrDestination[cchDestChar-1] = '\0';
    return S_OK;
#endif    
}




//-----------------------------------------------------------------------------
// Name: DXUtil_ConvertAnsiStringToGeneric()
// Desc: This is a UNICODE conversion utility to convert a WCHAR string into a
//       TCHAR string. 
//       cchDestChar is the size in TCHARs of tstrDestination.  Be careful not to 
//       pass in sizeof(strDest) on UNICODE builds
//-----------------------------------------------------------------------------
HRESULT DXUtil_ConvertWideStringToGenericCch( TCHAR* tstrDestination, const WCHAR* wstrSource, 
                                           int cchDestChar )
{
    if( tstrDestination==NULL || wstrSource==NULL || cchDestChar < 1 )
        return E_INVALIDARG;

#ifdef _UNICODE
    wcsncpy( tstrDestination, wstrSource, cchDestChar );
    tstrDestination[cchDestChar-1] = L'\0';    
    return S_OK;
#else
    return DXUtil_ConvertWideStringToAnsiCch( tstrDestination, wstrSource, cchDestChar );
#endif
}




#ifndef UNDER_CE
//-----------------------------------------------------------------------------
// Name: DXUtil_LaunchReadme()
// Desc: Finds and opens the readme.txt for this sample
//-----------------------------------------------------------------------------
VOID DXUtil_LaunchReadme( HWND hWnd )
{
    bool bSuccess = false;
    bool bFound = false;
    TCHAR strReadmePath[1024];
    TCHAR strExeName[MAX_PATH];
    TCHAR strExePath[MAX_PATH];
    TCHAR* strLastSlash = NULL;

    lstrcpy( strReadmePath, TEXT("") );
    lstrcpy( strExePath, TEXT("") );
    lstrcpy( strExeName, TEXT("") );

    // Get the exe name, and exe path
    GetModuleFileName( NULL, strExePath, MAX_PATH );
    strExePath[MAX_PATH-1]=0;

    strLastSlash = _tcsrchr( strExePath, TEXT('\\') );
    if( strLastSlash )
    {
        lstrcpyn( strExeName, &strLastSlash[1], MAX_PATH );
        strExeName[MAX_PATH-1]=0;

        // Chop the exe name from the exe path
        *strLastSlash = 0;

        // Chop the .exe from the exe name
        strLastSlash = _tcsrchr( strExeName, TEXT('.') );
        if( strLastSlash )
            *strLastSlash = 0;
    }

    if( !bFound )
    {
        // Search in "%EXE_DIR%\..\%EXE_NAME%".  This matchs the DirectX SDK layout
        _tcscpy( strReadmePath, strExePath );

        strLastSlash = _tcsrchr( strReadmePath, TEXT('\\') );
        if( strLastSlash )
            *strLastSlash = 0;
        lstrcat( strReadmePath, TEXT("\\") );
        lstrcat( strReadmePath, strExeName );
        lstrcat( strReadmePath, TEXT("\\readme.txt") );
        if( GetFileAttributes( strReadmePath ) != 0xFFFFFFFF )
            bFound = TRUE;
    }

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩亚洲综合在线| 国产一区高清在线| 在线一区二区视频| 亚洲成人资源在线| 欧美日韩国产不卡| 日韩精品一二三| 91精品国产色综合久久不卡蜜臀| 午夜电影久久久| 日韩一区二区三区观看| 国产剧情一区二区三区| 欧美国产一区在线| 色综合天天做天天爱| 天堂久久一区二区三区| 欧美成人精品1314www| 国产精品影视天天线| 中文字幕在线不卡一区| 在线一区二区三区做爰视频网站| 天天av天天翘天天综合网| 精品国产一二三区| 夫妻av一区二区| 亚洲精品视频自拍| 欧美一区二区精品久久911| 精品一区二区三区在线播放| 亚洲国产精品av| 欧美精品在线观看播放| 国产精品自拍三区| 一区二区在线观看视频在线观看| 日韩一区二区三区视频在线| 福利电影一区二区三区| 亚洲成人动漫av| 国产蜜臀av在线一区二区三区| 色综合天天综合网天天狠天天| 午夜视频一区二区| 国产欧美一区二区精品忘忧草| 在线中文字幕一区二区| 国产成人免费xxxxxxxx| 五月婷婷久久综合| 综合久久久久久| 久久综合狠狠综合| 91精品国产一区二区三区蜜臀 | 国产精品99久| 亚洲国产一区二区三区青草影视| 日韩三级视频在线观看| 欧美性xxxxxx少妇| 国产sm精品调教视频网站| 亚洲成人第一页| 综合久久久久综合| 国产视频在线观看一区二区三区| 欧美色网站导航| 成人福利电影精品一区二区在线观看| 天天做天天摸天天爽国产一区 | 日韩成人午夜电影| 国产精品国产成人国产三级| 日韩精品一区二区在线观看| 欧美日韩国产另类一区| 色综合色综合色综合| 不卡一区二区三区四区| 国产一区91精品张津瑜| 蜜桃久久av一区| 久久久久国产精品厨房| 色综合视频在线观看| 美女www一区二区| 日韩一二三四区| 日本亚洲欧美天堂免费| 精彩视频一区二区三区| 日韩欧美在线1卡| 97se亚洲国产综合自在线观| 夜夜亚洲天天久久| 欧美日韩一区二区三区不卡| 国产真实乱对白精彩久久| 亚洲欧洲日韩av| 亚洲国产精品成人综合| 日本一区二区三区四区| 91精品欧美久久久久久动漫| 一本久久a久久免费精品不卡| 成人av资源网站| 精品成人一区二区三区四区| 日韩午夜精品电影| 视频一区二区中文字幕| 欧美xxxx在线观看| 国产v综合v亚洲欧| 国产suv精品一区二区三区| 波多野洁衣一区| 亚洲高清免费一级二级三级| 亚洲国产日韩一区二区| 亚洲国产中文字幕在线视频综合| 欧美三级日韩三级| 亚洲综合一区二区三区| 欧美日精品一区视频| 亚洲成a人v欧美综合天堂| 国产福利一区二区| 亚洲福利一二三区| 久久久久久久久久久久电影 | 亚洲一区二三区| 欧美伊人久久久久久午夜久久久久| 亚洲高清视频在线| 日韩**一区毛片| 欧美高清一级片在线| 51精品久久久久久久蜜臀| 欧洲在线/亚洲| 国产精品系列在线播放| 亚洲精品欧美激情| 国产a久久麻豆| 亚洲国产高清不卡| 精品乱人伦一区二区三区| 欧美日韩国产片| 久久综合狠狠综合久久激情| 激情综合色播五月| 最新中文字幕一区二区三区| 欧美人xxxx| 午夜成人免费视频| 欧美一级二级在线观看| 久久久99免费| 日韩国产精品91| 九九九久久久精品| 久久免费视频色| 国产精品拍天天在线| 精品国精品国产尤物美女| 国产精品成人一区二区三区夜夜夜 | 国产成人精品三级| 色综合天天性综合| 欧美日韩在线三级| 国产女人水真多18毛片18精品视频| 亚洲免费观看高清在线观看| 一区二区三区**美女毛片| 亚洲一区二区三区影院| 国产成人av影院| 欧美日韩一级片在线观看| 久久综合色鬼综合色| 亚洲猫色日本管| 精品在线一区二区三区| 99免费精品视频| 精品国产123| 亚洲图片有声小说| 91丨porny丨首页| 久久综合九色综合欧美98 | 日韩欧美国产三级| 一区二区三区国产精华| 国产盗摄精品一区二区三区在线| 欧美日韩高清影院| 一区二区三区四区亚洲| 不卡一区二区中文字幕| 久久久久久97三级| 九九精品视频在线看| 91麻豆精品91久久久久久清纯| 亚洲黄色录像片| 不卡一区二区三区四区| 国产日韩欧美精品电影三级在线 | 国产精品69毛片高清亚洲| 欧美精品精品一区| 亚洲国产美女搞黄色| 91亚洲精华国产精华精华液| 欧美高清在线一区二区| 国产精品一二三区在线| 日韩欧美一区二区三区在线| 午夜精品久久久久久久| 欧美影片第一页| 亚洲成av人片观看| 精品视频1区2区| 丝袜亚洲另类丝袜在线| 欧美日韩国产高清一区二区三区 | 国产性色一区二区| 人人精品人人爱| 在线不卡a资源高清| 亚洲成人一区二区在线观看| 精品视频在线视频| 亚洲第一成人在线| 91久久精品国产91性色tv| 一区二区成人在线观看| 欧美天天综合网| 亚洲成av人在线观看| 欧美一区二区在线观看| 蜜桃久久久久久| 久久久精品综合| 99国产精品一区| 亚洲最大色网站| 91精品一区二区三区在线观看| 性久久久久久久| 日韩免费性生活视频播放| 久久精品国产77777蜜臀| 久久久久国产精品人| 成人免费毛片嘿嘿连载视频| 国产午夜亚洲精品午夜鲁丝片| 国产一区二区日韩精品| 国产精品国产三级国产aⅴ中文| 成人av免费在线观看| 亚洲女同一区二区| 91亚洲精品久久久蜜桃| 午夜久久久久久电影| 精品国产91乱码一区二区三区| 成人妖精视频yjsp地址| 一区二区三区欧美| 欧美一区二区成人| 国产成人自拍在线| 一区二区三区欧美| 精品剧情v国产在线观看在线| 成人免费高清在线| 午夜精品久久久久久久久久| 欧美精品一区在线观看| 97久久久精品综合88久久|