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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? dxut.cpp

?? 游戲編程精粹6的光盤源代碼
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
//--------------------------------------------------------------------------------------
// File: DXUT.cpp
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//--------------------------------------------------------------------------------------
#include "dxstdafx.h"
#define DXUT_MIN_WINDOW_SIZE_X 200
#define DXUT_MIN_WINDOW_SIZE_Y 200
#undef min // use __min instead inside this source file
#undef max // use __max instead inside this source file


//--------------------------------------------------------------------------------------
// Thread safety 
//--------------------------------------------------------------------------------------
CRITICAL_SECTION g_cs;  
bool g_bThreadSafe = true;


//--------------------------------------------------------------------------------------
// Automatically enters & leaves the CS upon object creation/deletion
//--------------------------------------------------------------------------------------
class DXUTLock
{
public:
    inline DXUTLock()  { if( g_bThreadSafe ) EnterCriticalSection( &g_cs ); }
    inline ~DXUTLock() { if( g_bThreadSafe ) LeaveCriticalSection( &g_cs ); }
};



//--------------------------------------------------------------------------------------
// Helper macros to build member functions that access member variables with thread safety
//--------------------------------------------------------------------------------------
#define SET_ACCESSOR( x, y )       inline void Set##y( x t )  { DXUTLock l; m_state.m_##y = t; };
#define GET_ACCESSOR( x, y )       inline x Get##y() { DXUTLock l; return m_state.m_##y; };
#define GET_SET_ACCESSOR( x, y )   SET_ACCESSOR( x, y ) GET_ACCESSOR( x, y )

#define SETP_ACCESSOR( x, y )      inline void Set##y( x* t )  { DXUTLock l; m_state.m_##y = *t; };
#define GETP_ACCESSOR( x, y )      inline x* Get##y() { DXUTLock l; return &m_state.m_##y; };
#define GETP_SETP_ACCESSOR( x, y ) SETP_ACCESSOR( x, y ) GETP_ACCESSOR( x, y )


//--------------------------------------------------------------------------------------
// Stores timer callback info
//--------------------------------------------------------------------------------------
struct DXUT_TIMER
{
    LPDXUTCALLBACKTIMER pCallbackTimer;
    void* pCallbackUserContext;
    float fTimeoutInSecs;
    float fCountdown;
    bool  bEnabled;
};


//--------------------------------------------------------------------------------------
// Multimon handling to support OSes with or without multimon API support.  
// Purposely avoiding the use of multimon.h so DXUT.lib doesn't require 
// COMPILE_MULTIMON_STUBS and cause complication with MFC or other users of multimon.h
//--------------------------------------------------------------------------------------
#ifndef MONITOR_DEFAULTTOPRIMARY
#define MONITORINFOF_PRIMARY        0x00000001
#define MONITOR_DEFAULTTOPRIMARY    0x00000001
#define MONITOR_DEFAULTTONEAREST    0x00000002
typedef struct tagMONITORINFO
{
    DWORD   cbSize;
    RECT    rcMonitor;
    RECT    rcWork;
    DWORD   dwFlags;
} MONITORINFO, *LPMONITORINFO;
typedef struct tagMONITORINFOEXW : public tagMONITORINFO
{
    WCHAR       szDevice[CCHDEVICENAME];
} MONITORINFOEXW, *LPMONITORINFOEXW;
typedef MONITORINFOEXW MONITORINFOEX;
typedef LPMONITORINFOEXW LPMONITORINFOEX;
#endif
HMONITOR WINAPI DXUT_MonitorFromWindow(HWND hWnd, DWORD dwFlags);
int WINAPI DXUT_GetSystemMetrics(int nIndex);
BOOL WINAPI DXUT_GetMonitorInfo(HMONITOR hMonitor, LPMONITORINFO lpMonitorInfo);
#define DXUT_PRIMARY_MONITOR ((HMONITOR)0x12340042)
typedef int      (WINAPI* LPGETSYSTEMMETRICS)(int);
typedef HMONITOR (WINAPI* LPMONITORFROMWINDOW)(HWND, DWORD);
typedef BOOL     (WINAPI* LPGETMONITORINFO)(HMONITOR, LPMONITORINFO);


//--------------------------------------------------------------------------------------
// Stores DXUT state and data access is done with thread safety (if g_bThreadSafe==true)
//--------------------------------------------------------------------------------------
class DXUTState
{
protected:
    struct STATE
    {
        IDirect3D9*          m_D3D;                     // the main D3D object

        IDirect3DDevice9*    m_D3DDevice;               // the D3D rendering device
        CD3DEnumeration*     m_D3DEnumeration;          // CD3DEnumeration object

        DXUTDeviceSettings*  m_CurrentDeviceSettings;   // current device settings
        D3DSURFACE_DESC      m_BackBufferSurfaceDesc;   // back buffer surface description
        D3DCAPS9             m_Caps;                    // D3D caps for current device

        HWND  m_HWNDFocus;                  // the main app focus window
        HWND  m_HWNDDeviceFullScreen;       // the main app device window in fullscreen mode
        HWND  m_HWNDDeviceWindowed;         // the main app device window in windowed mode
        HMONITOR m_AdapterMonitor;          // the monitor of the adapter 
        HMENU m_Menu;                       // handle to menu

        UINT m_FullScreenBackBufferWidthAtModeChange;  // back buffer size of fullscreen mode right before switching to windowed mode.  Used to restore to same resolution when toggling back to fullscreen
        UINT m_FullScreenBackBufferHeightAtModeChange; // back buffer size of fullscreen mode right before switching to windowed mode.  Used to restore to same resolution when toggling back to fullscreen
        UINT m_WindowBackBufferWidthAtModeChange;  // back buffer size of windowed mode right before switching to fullscreen mode.  Used to restore to same resolution when toggling back to windowed mode
        UINT m_WindowBackBufferHeightAtModeChange; // back buffer size of windowed mode right before switching to fullscreen mode.  Used to restore to same resolution when toggling back to windowed mode
        DWORD m_WindowedStyleAtModeChange;  // window style
        WINDOWPLACEMENT m_WindowedPlacement; // record of windowed HWND position/show state/etc
        bool  m_TopmostWhileWindowed;       // if true, the windowed HWND is topmost 
        bool  m_Minimized;                  // if true, the HWND is minimized
        bool  m_Maximized;                  // if true, the HWND is maximized
        bool  m_MinimizedWhileFullscreen;   // if true, the HWND is minimized due to a focus switch away when fullscreen mode
        bool  m_IgnoreSizeChange;           // if true, DXUT won't reset the device upon HWND size change

        double m_Time;                      // current time in seconds
        float m_ElapsedTime;                // time elapsed since last frame

        HINSTANCE m_HInstance;              // handle to the app instance
        double m_LastStatsUpdateTime;       // last time the stats were updated
        DWORD m_LastStatsUpdateFrames;      // frames count since last time the stats were updated
        float m_FPS;                        // frames per second
        int   m_CurrentFrameNumber;         // the current frame number
        HHOOK m_KeyboardHook;               // handle to keyboard hook
        bool  m_AllowShortcutKeysWhenFullscreen; // if true, when fullscreen enable shortcut keys (Windows keys, StickyKeys shortcut, ToggleKeys shortcut, FilterKeys shortcut) 
        bool  m_AllowShortcutKeysWhenWindowed;   // if true, when windowed enable shortcut keys (Windows keys, StickyKeys shortcut, ToggleKeys shortcut, FilterKeys shortcut) 
        bool  m_AllowShortcutKeys;          // if true, then shortcut keys are currently disabled (Windows key, etc)
        bool  m_CallDefWindowProc;          // if true, DXUTStaticWndProc will call DefWindowProc for unhandled messages. Applications rendering to a dialog may need to set this to false.
        STICKYKEYS m_StartupStickyKeys;     // StickyKey settings upon startup so they can be restored later
        TOGGLEKEYS m_StartupToggleKeys;     // ToggleKey settings upon startup so they can be restored later
        FILTERKEYS m_StartupFilterKeys;     // FilterKey settings upon startup so they can be restored later

        bool  m_HandleDefaultHotkeys;       // if true, then DXUT will handle some default hotkeys
        bool  m_HandleAltEnter;             // if true, then DXUT will handle Alt-Enter
        bool  m_ShowMsgBoxOnError;          // if true, then msgboxes are displayed upon errors
        bool  m_ClipCursorWhenFullScreen;   // if true, then DXUT will keep the cursor from going outside the window when full screen
        bool  m_ShowCursorWhenFullScreen;   // if true, then DXUT will show a cursor when full screen
        bool  m_ConstantFrameTime;          // if true, then elapsed frame time will always be 0.05f seconds which is good for debugging or automated capture
        float m_TimePerFrame;               // the constant time per frame in seconds, only valid if m_ConstantFrameTime==true
        bool  m_WireframeMode;              // if true, then D3DRS_FILLMODE==D3DFILL_WIREFRAME else D3DRS_FILLMODE==D3DFILL_SOLID 
        bool  m_AutoChangeAdapter;          // if true, then the adapter will automatically change if the window is different monitor
        bool  m_WindowCreatedWithDefaultPositions; // if true, then CW_USEDEFAULT was used and the window should be moved to the right adapter
        int   m_ExitCode;                   // the exit code to be returned to the command line

        bool  m_DXUTInited;                 // if true, then DXUTInit() has succeeded
        bool  m_WindowCreated;              // if true, then DXUTCreateWindow() or DXUTSetWindow() has succeeded
        bool  m_DeviceCreated;              // if true, then DXUTCreateDevice*() or DXUTSetDevice() has succeeded

        bool  m_DXUTInitCalled;             // if true, then DXUTInit() was called
        bool  m_WindowCreateCalled;         // if true, then DXUTCreateWindow() or DXUTSetWindow() was called
        bool  m_DeviceCreateCalled;         // if true, then DXUTCreateDevice*() or DXUTSetDevice() was called

        bool  m_DeviceObjectsCreated;       // if true, then DeviceCreated callback has been called (if non-NULL)
        bool  m_DeviceObjectsReset;         // if true, then DeviceReset callback has been called (if non-NULL)
        bool  m_InsideDeviceCallback;       // if true, then the framework is inside an app device callback
        bool  m_InsideMainloop;             // if true, then the framework is inside the main loop
        bool  m_Active;                     // if true, then the app is the active top level window
        bool  m_TimePaused;                 // if true, then time is paused
        bool  m_RenderingPaused;            // if true, then rendering is paused
        int   m_PauseRenderingCount;        // pause rendering ref count
        int   m_PauseTimeCount;             // pause time ref count
        bool  m_DeviceLost;                 // if true, then the device is lost and needs to be reset
        bool  m_NotifyOnMouseMove;          // if true, include WM_MOUSEMOVE in mousecallback
        bool  m_Automation;                 // if true, automation is enabled
        bool  m_InSizeMove;                 // if true, app is inside a WM_ENTERSIZEMOVE

        int   m_OverrideAdapterOrdinal;     // if != -1, then override to use this adapter ordinal
        bool  m_OverrideWindowed;           // if true, then force to start windowed
        bool  m_OverrideFullScreen;         // if true, then force to start full screen
        int   m_OverrideStartX;             // if != -1, then override to this X position of the window
        int   m_OverrideStartY;             // if != -1, then override to this Y position of the window
        int   m_OverrideWidth;              // if != 0, then override to this width
        int   m_OverrideHeight;             // if != 0, then override to this height
        bool  m_OverrideForceHAL;           // if true, then force to HAL device (failing if one doesn't exist)
        bool  m_OverrideForceREF;           // if true, then force to REF device (failing if one doesn't exist)
        bool  m_OverrideForcePureHWVP;      // if true, then force to use pure HWVP (failing if device doesn't support it)
        bool  m_OverrideForceHWVP;          // if true, then force to use HWVP (failing if device doesn't support it)
        bool  m_OverrideForceSWVP;          // if true, then force to use SWVP 
        bool  m_OverrideConstantFrameTime;  // if true, then force to constant frame time
        float m_OverrideConstantTimePerFrame; // the constant time per frame in seconds if m_OverrideConstantFrameTime==true
        int   m_OverrideQuitAfterFrame;     // if != 0, then it will force the app to quit after that frame

        LPDXUTCALLBACKISDEVICEACCEPTABLE    m_IsDeviceAcceptableFunc;   // is device acceptable callback
        LPDXUTCALLBACKMODIFYDEVICESETTINGS  m_ModifyDeviceSettingsFunc; // modify device settings callback
        LPDXUTCALLBACKDEVICECREATED         m_DeviceCreatedFunc;        // device created callback
        LPDXUTCALLBACKDEVICERESET           m_DeviceResetFunc;          // device reset callback
        LPDXUTCALLBACKDEVICELOST            m_DeviceLostFunc;           // device lost callback
        LPDXUTCALLBACKDEVICEDESTROYED       m_DeviceDestroyedFunc;      // device destroyed callback
        LPDXUTCALLBACKFRAMEMOVE             m_FrameMoveFunc;            // frame move callback
        LPDXUTCALLBACKFRAMERENDER           m_FrameRenderFunc;          // frame render callback
        LPDXUTCALLBACKKEYBOARD              m_KeyboardFunc;             // keyboard callback
        LPDXUTCALLBACKMOUSE                 m_MouseFunc;                // mouse callback
        LPDXUTCALLBACKMSGPROC               m_WindowMsgFunc;            // window messages callback

        LPGETSYSTEMMETRICS                  m_FnGetSystemMetrics;       // delay loading of multimon apis.  Might be NULL
        LPMONITORFROMWINDOW                 m_FnMonitorFromWindow;      // delay loading of multimon apis.  Might be NULL
        LPGETMONITORINFO                    m_FnGetMonitorInfo;         // delay loading of multimon apis.  Might be NULL

        void*                               m_IsDeviceAcceptableFuncUserContext;   // user context for is device acceptable callback
        void*                               m_ModifyDeviceSettingsFuncUserContext; // user context for modify device settings callback
        void*                               m_DeviceCreatedUserContext;            // user context for device created callback
        void*                               m_DeviceCreatedFuncUserContext;        // user context for device created callback
        void*                               m_DeviceResetFuncUserContext;          // user context for device reset callback
        void*                               m_DeviceLostFuncUserContext;           // user context for device lost callback
        void*                               m_DeviceDestroyedFuncUserContext;      // user context for device destroyed callback
        void*                               m_FrameMoveFuncUserContext;            // user context for frame move callback
        void*                               m_FrameRenderFuncUserContext;          // user context for frame render callback
        void*                               m_KeyboardFuncUserContext;             // user context for keyboard callback
        void*                               m_MouseFuncUserContext;                // user context for mouse callback
        void*                               m_WindowMsgFuncUserContext;            // user context for window messages callback

        bool                         m_Keys[256];                       // array of key state
        bool                         m_MouseButtons[5];                 // array of mouse states

        CGrowableArray<DXUT_TIMER>*  m_TimerList;                       // list of DXUT_TIMER structs
        WCHAR                        m_StaticFrameStats[256];           // static part of frames stats 
        WCHAR                        m_FrameStats[256];                 // frame stats (fps, width, etc)
        WCHAR                        m_DeviceStats[256];                // device stats (description, device type, etc)
        WCHAR                        m_WindowTitle[256];                // window title
    };
    
    STATE m_state;

public:
    DXUTState()  { Create(); }
    ~DXUTState() { Destroy(); }

    void Create()
    {
        // Make sure these are created before DXUTState so they 
        // destroyed last because DXUTState cleanup needs them
        DXUTGetGlobalResourceCache();

        ZeroMemory( &m_state, sizeof(STATE) ); 
        g_bThreadSafe = true; 
        InitializeCriticalSection( &g_cs ); 
        m_state.m_OverrideStartX = -1; 
        m_state.m_OverrideStartY = -1; 
        m_state.m_OverrideAdapterOrdinal = -1; 
        m_state.m_AutoChangeAdapter = true; 
        m_state.m_ShowMsgBoxOnError = true;
        m_state.m_AllowShortcutKeysWhenWindowed = true;
        m_state.m_Active = true;
        m_state.m_CallDefWindowProc = true;

        // Get proc addresses of multimon APIs if they exist
        HMODULE hUser32 = GetModuleHandle( L"USER32" );
        if (hUser32 )
        {
            OSVERSIONINFOA osvi = {0}; osvi.dwOSVersionInfoSize = sizeof(osvi); GetVersionExA((OSVERSIONINFOA*)&osvi);
            bool bNT = (VER_PLATFORM_WIN32_NT == osvi.dwPlatformId);    

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品网曝门| 中文字幕成人av| 在线观看91视频| 色婷婷综合五月| 欧美日韩在线免费视频| 欧美日韩国产一级| 欧美日韩一区成人| 日韩欧美黄色影院| 久久午夜国产精品| 中文字幕亚洲不卡| 亚洲成人自拍一区| 精品制服美女久久| 成人ar影院免费观看视频| 99精品欧美一区二区三区小说 | 欧美一区二区三区四区久久| 欧美日高清视频| 精品少妇一区二区三区免费观看 | 国产午夜精品久久久久久久| 国产清纯白嫩初高生在线观看91 | 午夜精品久久久久久久99水蜜桃| 亚洲自拍偷拍九九九| 奇米色一区二区三区四区| 九一久久久久久| 99视频在线精品| 在线综合视频播放| 国产亚洲欧美日韩日本| 亚洲欧洲www| 日本三级亚洲精品| 不卡的电影网站| 91麻豆精品国产91久久久使用方法| 日韩午夜小视频| 国产精品美女久久久久久2018| 亚洲一区成人在线| 国产精品一区二区在线观看不卡| 91香蕉国产在线观看软件| 欧美日韩免费在线视频| 国产三区在线成人av| 亚洲不卡一区二区三区| 国产一区二区免费在线| 欧美视频一二三区| 国产精品色在线观看| 日韩av高清在线观看| 成人国产精品免费| 欧美一区永久视频免费观看| 国产精品国产三级国产aⅴ入口| 视频一区视频二区在线观看| 成人精品电影在线观看| 日韩一区和二区| 亚洲愉拍自拍另类高清精品| 国产一区二区三区四区在线观看 | 日本三级亚洲精品| 色婷婷综合中文久久一本| 久久亚洲免费视频| 日本aⅴ亚洲精品中文乱码| 99riav久久精品riav| 精品久久一区二区| 日韩高清不卡一区二区三区| 在线观看视频一区二区欧美日韩| 中文字幕成人网| 国产精品18久久久久久久久| 6080亚洲精品一区二区| 一级做a爱片久久| 99riav一区二区三区| 国产精品每日更新在线播放网址 | 欧美图区在线视频| 亚洲乱码国产乱码精品精可以看 | 欧美日韩的一区二区| 一区二区三区免费观看| 色综合久久六月婷婷中文字幕| 国产欧美一区在线| 国产成人免费在线视频| 久久综合久久综合久久| 麻豆精品在线看| 精品剧情v国产在线观看在线| 蜜臀av一区二区| 日韩欧美成人午夜| 老司机午夜精品| 精品蜜桃在线看| 国产乱淫av一区二区三区| 久久天天做天天爱综合色| 激情综合色丁香一区二区| 日韩免费成人网| 国产一区二区三区四| 久久久久久电影| 成人av在线网| 亚洲综合男人的天堂| 欧美在线看片a免费观看| 亚洲mv大片欧洲mv大片精品| 制服丝袜日韩国产| 久久综合综合久久综合| 久久久久久电影| 99re在线精品| 偷窥国产亚洲免费视频| 精品毛片乱码1区2区3区| 国产乱码精品一区二区三区av| 国产日韩欧美精品综合| 91麻豆国产福利在线观看| 欧美午夜精品理论片a级按摩| 日本福利一区二区| 亚洲午夜一区二区三区| 久久久久久久久久久久久夜| 高清beeg欧美| 自拍偷拍欧美激情| 欧美亚洲高清一区| 久久精品国产99久久6| 国产欧美精品一区二区色综合朱莉| av中文字幕不卡| 热久久免费视频| 国产精品卡一卡二| 欧美一区二区三区在线观看 | 色猫猫国产区一区二在线视频| 五月开心婷婷久久| 久久―日本道色综合久久| 一本到不卡免费一区二区| 蜜桃视频免费观看一区| 一区二区三区精密机械公司| 精品国产一区a| 91久久精品一区二区三| 韩国女主播一区| 午夜不卡av免费| 综合自拍亚洲综合图不卡区| 日韩精品一区二区三区在线观看| 99久久精品费精品国产一区二区| 蜜桃精品视频在线观看| 亚洲国产综合视频在线观看| 国产日韩欧美不卡在线| 日韩欧美一区中文| 欧美日韩国产系列| 色美美综合视频| 99精品视频在线观看| 国产成人av一区二区三区在线| 天堂精品中文字幕在线| 一区2区3区在线看| 亚洲精品成人精品456| 国产精品久久99| 国产亚洲欧美一区在线观看| 日韩美女视频在线| 日韩三级中文字幕| 欧美高清视频在线高清观看mv色露露十八 | 亚洲午夜免费福利视频| 综合网在线视频| 国产精品久久久久久久久免费丝袜 | 一本大道久久a久久精二百| 国产伦精一区二区三区| 精品一区二区三区香蕉蜜桃| 视频在线观看一区| 日本伊人色综合网| 日韩1区2区3区| 日本不卡一区二区三区| 天天操天天色综合| 日一区二区三区| 日本一道高清亚洲日美韩| 免费高清视频精品| 国产在线精品一区在线观看麻豆| 日日噜噜夜夜狠狠视频欧美人| 日韩中文字幕一区二区三区| 日本女优在线视频一区二区| 麻豆传媒一区二区三区| 国产一区欧美日韩| 国产成人亚洲综合a∨猫咪| 国产一区二区中文字幕| 成人免费黄色大片| 色av成人天堂桃色av| 欧美手机在线视频| 日韩欧美aaaaaa| 欧美激情综合网| 一区二区三国产精华液| 日韩精品一卡二卡三卡四卡无卡| 久久99精品久久只有精品| 粉嫩av亚洲一区二区图片| 色综合天天综合网国产成人综合天| 色综合久久六月婷婷中文字幕| 欧美最猛黑人xxxxx猛交| 欧美一级二级三级蜜桃| 国产欧美1区2区3区| 亚洲制服丝袜在线| 韩日欧美一区二区三区| bt欧美亚洲午夜电影天堂| 8x福利精品第一导航| 国产欧美一区二区三区在线老狼 | 欧美在线不卡一区| 欧美一区二区三区在| 国产欧美视频在线观看| 亚洲不卡一区二区三区| 国产精品99久久不卡二区| 色婷婷av一区二区| 久久久久九九视频| 亚洲国产精品一区二区尤物区| 国精产品一区一区三区mba视频| 色婷婷久久99综合精品jk白丝 | 日本一区二区不卡视频| 亚洲国产裸拍裸体视频在线观看乱了 | av一区二区三区四区| 欧美一区二区免费视频| 亚洲色欲色欲www| 久久精品噜噜噜成人88aⅴ| 在线免费av一区| 日本一区二区三区四区在线视频| 日韩福利电影在线观看| 一本色道久久综合精品竹菊|