青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

天行健 君子當自強而不息

DXUT框架剖析(14)

控件是用戶接口的重要組成部分,為了便于用戶操作,為程序界面添加各種控件是非常好的方法。DXUT框架為在Direct3D程序中添加各種控件提供了支持。為了便于加載控件和處理各控件的消息,通常先在窗口中加載對話框,然后在對話框中添加響應的控件,由對話框來管理控件。為了統一管理各個對話框,還需要定義對話框資源管理器類CDXUTDialogResourceManager的一個對象,在程序開始時,調用各個對話框的Init函數和對話框資源管理對象進行初始化:

CDXUTDialogResourceManager g_dlg_resource_manager;
CD3DSettingsDlg g_settings_dlg;
CDXUTDialog g_button_dlg;
CDXUTDialog g_control_dlg;

g_settings_dlg.Init(&g_dlg_resource_manager);
g_button_dlg.Init(&g_dlg_resource_manager);
g_control_dlg.Init(&g_dlg_resource_manager);

需要注意的是,對話框類CD3DSettingsDlg是Direct3D封裝好的一個專門用于Direct3D渲染設備設置的對話框類,其中的控件已經都加載好了,同時各個控件將如何響應用戶的輸入Direct3D也已經實現了。在此只需對它的對象實例g_settings_dlg進行相應的初始化,并在程序退出前釋放對應的資源即可。

g_button_dlg和g_control_dlg是兩個標準的DXUT對話框,它們中沒有任何控件,可以把它們看作兩個裝載控件的容器。其初始化包括三項內容:設置對話框控件消息處理回調函數、添加控件、設置對話框位置和大小。

設置對話框控件消息處理回調函數、添加控件的代碼如下所示:

g_button_dlg.SetCallback(OnGUIEvent);

int x = 35, y = 10, width = 125, height = 22;

g_button_dlg.AddButton(IDC_TOGGLE_FULLSCREEN, L"Toggle full screen", x, y, width, height);
g_button_dlg.AddButton(IDC_TOGGLE_REF, L"Toggle REF (F3)", x, y += 24, width, height);
g_button_dlg.AddButton(IDC_CHANGE_DEVICE, L"Change device (F2)", x, y += 24, width, height, VK_F2);

g_button_dlg.SetCallback(OnGUIEvent);

y = 10;

g_control_dlg.AddComboBox(IDC_COMBO, x, y += 24, width, height);
g_control_dlg.GetComboBox(IDC_COMBO)->AddItem(L"Text1", NULL);
g_control_dlg.GetComboBox(IDC_COMBO)->AddItem(L"Text2", NULL);
g_control_dlg.GetComboBox(IDC_COMBO)->AddItem(L"Text3", NULL);
g_control_dlg.GetComboBox(IDC_COMBO)->AddItem(L"Text4", NULL);

g_control_dlg.AddCheckBox(IDC_CHECK_BOX_1, L"CheckBox1", x, y += 24, width, height);
g_control_dlg.AddCheckBox(IDC_CHECK_BOX_2, L"CheckBox2", x, y += 24, width, height);

g_control_dlg.AddRadioButton(IDC_RADIO_1, IDC_RADIO_GROUP_1, L"Radio1G1", x, y += 24, width, height);
g_control_dlg.AddRadioButton(IDC_RADIO_2, IDC_RADIO_GROUP_1, L"Radio2G1", x, y += 24, width, height);
g_control_dlg.AddRadioButton(IDC_RADIO_3, IDC_RADIO_GROUP_1, L"Radio3G1", x, y += 24, width, height);
g_control_dlg.GetRadioButton(IDC_RADIO_3)->SetChecked(true);

g_control_dlg.AddButton(IDC_BUTTON_1, L"Button1", x, y += 24, width, height);
g_control_dlg.AddButton(IDC_BUTTON_2, L"Button2", x, y += 24, width, height);

g_control_dlg.AddRadioButton(IDC_RADIO_4, IDC_RADIO_GROUP_2, L"Radio1G2", x, y += 24, width, height);
g_control_dlg.AddRadioButton(IDC_RADIO_5, IDC_RADIO_GROUP_2, L"Radio2G2", x, y += 24, width, height);
g_control_dlg.GetRadioButton(IDC_RADIO_5)->SetChecked(true);

g_control_dlg.AddSlider(IDC_SLIDER, 50, y += 24, 100, height);
g_control_dlg.GetSlider(IDC_SLIDER)->SetRange(0, 100);
g_control_dlg.GetSlider(IDC_SLIDER)->SetValue(50);

g_control_dlg.AddEditBox(IDC_EDIT, L"Test", x, y += 24, width, 32);

設置對話框位置和大小的代碼如下所示:

// set dialog position and size

g_button_dlg.SetLocation(pBackBufferSurfaceDesc->Width - 170, 0);
g_button_dlg.SetSize(170, 170);

g_control_dlg.SetLocation(pBackBufferSurfaceDesc->Width - 170, pBackBufferSurfaceDesc->Height - 350);
g_control_dlg.SetSize(170, 300);

因為上面的代碼用到了與對話框和控件相關的幾個類,所以需要將實現這幾個類的源文件添加到工程項目中,具體包括4個文件:DXUTgui.h、DXUTgui.cpp、DXUTSettingsDlg.h和DXUTSettingsDlg.cpp,這4個文件位于當前目錄的common目錄下。

 

渲染控件

在主程序的OnFrameRender()回調函數中,調用各個對話框的OnRender()函數對各個對話框進行渲染,代碼如下:

//--------------------------------------------------------------------------------------
// Render the scene
//--------------------------------------------------------------------------------------
void CALLBACK OnFrameRender( IDirect3DDevice9* pd3dDevice, double fTime, float fElapsedTime, void* pUserContext )
{
HRESULT hr;
	if(g_settings_dlg.IsActive())
{
g_settings_dlg.OnRender(fElapsedTime);
return;
}
    // Clear the render target and the zbuffer 
V( pd3dDevice->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_ARGB(0, 0, 0, 0), 1.0f, 0) );
    // Render the scene
if( SUCCEEDED( pd3dDevice->BeginScene() ) )
{
RenderText();
		V(g_button_dlg.OnRender(fElapsedTime));
V(g_control_dlg.OnRender(fElapsedTime));
        V( pd3dDevice->EndScene() );
}
}

 

處理控件消息

當在應用程序的窗口中單擊鼠標或觸發其他事件時,先由對話框資源管理器對象g_dlg_resource_manager處理全局消息以更新GUI,然后進入各個對話框的消息處理函數:

//--------------------------------------------------------------------------------------
// Handle messages to the application
//--------------------------------------------------------------------------------------
LRESULT CALLBACK MsgProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
bool* pbNoFurtherProcessing, void* pUserContext )
{
*pbNoFurtherProcessing = g_dlg_resource_manager.MsgProc(hWnd, uMsg, wParam, lParam);
if(*pbNoFurtherProcessing)
return 0;
	if(g_settings_dlg.IsActive())
{
g_settings_dlg.MsgProc(hWnd, uMsg, wParam, lParam);
return 0;
}
	*pbNoFurtherProcessing = g_button_dlg.MsgProc(hWnd, uMsg, wParam, lParam);
if(*pbNoFurtherProcessing)
return 0;
	*pbNoFurtherProcessing = g_control_dlg.MsgProc(hWnd, uMsg, wParam, lParam);
if(*pbNoFurtherProcessing)
return 0;
    return 0;
}

g_settings_dlg對于自己消息的處理Direct3D已經封裝好了,需要做的工作就是在回調函數OnGUIEvent()中處理對話框的消息。

//--------------------------------------------------------------------------------------
// Handle events for controls
//--------------------------------------------------------------------------------------
void CALLBACK OnGUIEvent(UINT event, int control_id, CDXUTControl* control, void* user_context)
{
switch(control_id)
{
case IDC_TOGGLE_FULLSCREEN:
DXUTToggleFullScreen();
break;
	case IDC_TOGGLE_REF:
DXUTToggleREF();
break;
	case IDC_CHANGE_DEVICE:
g_settings_dlg.SetActive(true);
break;
}
}

 

釋放對話框

在程序退出前需要釋放各個對話框所占用的資源:

//--------------------------------------------------------------------------------------
// Release resources created in the OnResetDevice callback here
//--------------------------------------------------------------------------------------
void CALLBACK OnLostDevice( void* pUserContext )
{
g_dlg_resource_manager.OnLostDevice();
g_settings_dlg.OnLostDevice();
g_font->OnLostDevice();
release_com(g_text_sprite);
}
//--------------------------------------------------------------------------------------
// Release resources created in the OnCreateDevice callback here
//--------------------------------------------------------------------------------------
void CALLBACK OnDestroyDevice( void* pUserContext )
{
g_dlg_resource_manager.OnDestroyDevice();
g_settings_dlg.OnDestroyDevice();
release_com(g_font);
}

 

在程序運行時,單擊窗口上的【Toggle Full Screen】按鈕,可切換到全屏模式下。單擊窗口上的【Toggle REF】按鈕,可切換到參考設備下。按下F2鍵或單擊窗口上的【Change Device】按鈕,則顯示Direct3D設備設置對話框,如下圖所示:

 

主程序:

#include "dxstdafx.h"
#include 
"resource.h"

#pragma warning(disable : 
4127)

#define IDC_TOGGLE_FULLSCREEN        1
#define IDC_TOGGLE_REF                2
#define IDC_CHANGE_DEVICE            3
#define IDC_COMBO                    4
#define IDC_CHECK_BOX_1                5
#define IDC_CHECK_BOX_2                6
#define IDC_RADIO_1                    7
#define IDC_RADIO_2                    8
#define IDC_RADIO_3                    9
#define IDC_BUTTON_1                10
#define IDC_BUTTON_2                11
#define IDC_RADIO_4                    12
#define IDC_RADIO_5                    13
#define IDC_SLIDER                    14
#define IDC_EDIT                    15

#define IDC_RADIO_GROUP_1            1
#define IDC_RADIO_GROUP_2            2

#define release_com(p)    do { if(p) { (p)->Release(); (p) = NULL; } } while(0)

ID3DXFont
*        g_font;
ID3DXSprite
*    g_text_sprite;
bool            g_show_help = true;

CDXUTDialogResourceManager    g_dlg_resource_manager;
CD3DSettingsDlg                g_settings_dlg;
CDXUTDialog                    g_button_dlg;
CDXUTDialog                    g_control_dlg;

//--------------------------------------------------------------------------------------
// Rejects any devices that aren't acceptable by returning false
//--------------------------------------------------------------------------------------
bool CALLBACK IsDeviceAcceptable( D3DCAPS9* pCaps, D3DFORMAT AdapterFormat, 
                                  D3DFORMAT BackBufferFormat, 
bool bWindowed, void* pUserContext )
{
    
// Typically want to skip backbuffer formats that don't support alpha blending

    IDirect3D9
* pD3D = DXUTGetD3DObject(); 

    
if( FAILED( pD3D->CheckDeviceFormat( pCaps->AdapterOrdinal, pCaps->DeviceType, AdapterFormat, 
                    D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING, D3DRTYPE_TEXTURE, BackBufferFormat ) ) )
        
return false;

    
return true;
}


//--------------------------------------------------------------------------------------
// Before a device is created, modify the device settings as needed.
//--------------------------------------------------------------------------------------
bool CALLBACK ModifyDeviceSettings( DXUTDeviceSettings* pDeviceSettings, const D3DCAPS9* pCaps, void* pUserContext )
{
    
// If video card does not support hardware vertex processing, then uses sofaware vertex processing.
    if((pCaps->DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0)
        pDeviceSettings
->BehaviorFlags = D3DCREATE_SOFTWARE_VERTEXPROCESSING;

    
static bool is_first_time = true;

    
if(is_first_time)
    {
        is_first_time 
= false;

        
// if using reference device, then pop a warning message box.
        if(pDeviceSettings->DeviceType == D3DDEVTYPE_REF)
            DXUTDisplaySwitchingToREFWarning();
    }

    
return true;
}


//--------------------------------------------------------------------------------------
// Create any D3DPOOL_MANAGED resources here 
//--------------------------------------------------------------------------------------
HRESULT CALLBACK OnCreateDevice( IDirect3DDevice9* pd3dDevice, 
                                 
const D3DSURFACE_DESC* pBackBufferSurfaceDesc, 
                                 
void* pUserContext )
{
    HRESULT    hr;

    V_RETURN(g_dlg_resource_manager.OnCreateDevice(pd3dDevice));
    V_RETURN(g_settings_dlg.OnCreateDevice(pd3dDevice));

    D3DXCreateFont(pd3dDevice, 
180, FW_BOLD, 1, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY,
                   DEFAULT_PITCH 
| FF_DONTCARE, L"Arial"&g_font);

    
return S_OK;
}


//--------------------------------------------------------------------------------------
// Create any D3DPOOL_DEFAULT resources here 
//--------------------------------------------------------------------------------------
HRESULT CALLBACK OnResetDevice( IDirect3DDevice9* pd3dDevice, 
                                
const D3DSURFACE_DESC* pBackBufferSurfaceDesc, 
                                
void* pUserContext )
{
    HRESULT hr;

    V_RETURN(g_dlg_resource_manager.OnResetDevice());
    V_RETURN(g_settings_dlg.OnResetDevice());
    V_RETURN(g_font
->OnResetDevice());
    V_RETURN(D3DXCreateSprite(pd3dDevice, 
&g_text_sprite));

    
// set dialog position and size

    g_button_dlg.SetLocation(pBackBufferSurfaceDesc
->Width - 1700);
    g_button_dlg.SetSize(
170170);

    g_control_dlg.SetLocation(pBackBufferSurfaceDesc
->Width - 170, pBackBufferSurfaceDesc->Height - 350);
    g_control_dlg.SetSize(
170300);    

    
// setup view matrix

    D3DXMATRIX mat_view;
    D3DXVECTOR3 eye(
0.0f0.0f-5.0f);
    D3DXVECTOR3  at(
0.0f0.0f,  0.0f);
    D3DXVECTOR3  up(
0.0f1.0f,  0.0f);

    D3DXMatrixLookAtLH(
&mat_view, &eye, &at, &up);
    pd3dDevice
->SetTransform(D3DTS_VIEW, &mat_view);

    
// set projection matrix
    D3DXMATRIX mat_proj;
    
float aspect = (float)pBackBufferSurfaceDesc->Width / pBackBufferSurfaceDesc->Height;
    D3DXMatrixPerspectiveFovLH(
&mat_proj, D3DX_PI/4, aspect, 1.0f100.0f);
    pd3dDevice
->SetTransform(D3DTS_PROJECTION, &mat_proj);

    
return S_OK;
}

//--------------------------------------------------------------------------------------
// Release resources created in the OnResetDevice callback here 
//--------------------------------------------------------------------------------------
void CALLBACK OnLostDevice( void* pUserContext )
{
    g_dlg_resource_manager.OnLostDevice();
    g_settings_dlg.OnLostDevice();
    g_font
->OnLostDevice();
    release_com(g_text_sprite);
}


//--------------------------------------------------------------------------------------
// Release resources created in the OnCreateDevice callback here
//--------------------------------------------------------------------------------------
void CALLBACK OnDestroyDevice( void* pUserContext )
{
    g_dlg_resource_manager.OnDestroyDevice();
    g_settings_dlg.OnDestroyDevice();
    release_com(g_font);
}

//--------------------------------------------------------------------------------------
// Handle updates to the scene
//--------------------------------------------------------------------------------------
void CALLBACK OnFrameMove( IDirect3DDevice9* pd3dDevice, double fTime, float fElapsedTime, void* pUserContext )
{
}

//--------------------------------------------------------------------------------------
// Render the helper information
//--------------------------------------------------------------------------------------
void RenderText()
{
    CDXUTTextHelper text_helper(g_font, g_text_sprite, 
20);
    
    text_helper.Begin();

    
// show frame and device states
    text_helper.SetInsertionPos(55);
    text_helper.SetForegroundColor( D3DXCOLOR(
1.0f0.475f0.0f1.0f) );
    text_helper.DrawTextLine( DXUTGetFrameStats(
true) );
    text_helper.DrawTextLine( DXUTGetDeviceStats() );

    
// show other simple information
    text_helper.SetForegroundColor( D3DXCOLOR(1.0f1.0f1.0f1.0f) );
    text_helper.DrawTextLine(L
"Put whatever misc status here");

    
// show helper information
    
    
const D3DSURFACE_DESC* surface_desc = DXUTGetBackBufferSurfaceDesc();

    
if(g_show_help)
    {
        text_helper.SetInsertionPos(
10, surface_desc->Height - 15 * 6);
        text_helper.SetForegroundColor( D3DXCOLOR(
1.0f0.475f0.0f1.0f) );
        text_helper.DrawTextLine(L
"Controls (F1 to hide):");
        
        text_helper.SetInsertionPos(
40, surface_desc->Height - 15 * 4);
        text_helper.DrawTextLine(L
"Quir: ESC");
    }
    
else
    {
        text_helper.SetInsertionPos(
10, surface_desc->Height - 15 * 4);
        text_helper.SetForegroundColor( D3DXCOLOR(
1.0f1.0f1.0f1.0f) );
        text_helper.DrawTextLine(L
"Press F1 for help");
    }

    text_helper.End();
}

//--------------------------------------------------------------------------------------
// Render the scene 
//--------------------------------------------------------------------------------------
void CALLBACK OnFrameRender( IDirect3DDevice9* pd3dDevice, double fTime, float fElapsedTime, void* pUserContext )
{
    HRESULT hr;

    
if(g_settings_dlg.IsActive())
    {
        g_settings_dlg.OnRender(fElapsedTime);
        
return;
    }

    
// Clear the render target and the zbuffer 
    V( pd3dDevice->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_ARGB(0000), 1.0f0) );

    
// Render the scene
    if( SUCCEEDED( pd3dDevice->BeginScene() ) )
    {
        RenderText();

        V(g_button_dlg.OnRender(fElapsedTime));
        V(g_control_dlg.OnRender(fElapsedTime));

        V( pd3dDevice
->EndScene() );
    }
}


//--------------------------------------------------------------------------------------
// Handle messages to the application 
//--------------------------------------------------------------------------------------
LRESULT CALLBACK MsgProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, 
                          
bool* pbNoFurtherProcessing, void* pUserContext )
{
    
*pbNoFurtherProcessing = g_dlg_resource_manager.MsgProc(hWnd, uMsg, wParam, lParam);
    
if(*pbNoFurtherProcessing)
        
return 0;

    
if(g_settings_dlg.IsActive())
    {
        g_settings_dlg.MsgProc(hWnd, uMsg, wParam, lParam);
        
return 0;
    }

    
*pbNoFurtherProcessing = g_button_dlg.MsgProc(hWnd, uMsg, wParam, lParam);
    
if(*pbNoFurtherProcessing)
        
return 0;

    
*pbNoFurtherProcessing = g_control_dlg.MsgProc(hWnd, uMsg, wParam, lParam);
    
if(*pbNoFurtherProcessing)
        
return 0;

    
return 0;
}


//--------------------------------------------------------------------------------------
// Handle keybaord event
//--------------------------------------------------------------------------------------
void CALLBACK OnKeyboardProc(UINT charater, bool is_key_down, bool is_alt_down, void* user_context)
{
    
if(is_key_down)
    {
        
switch(charater)
        {
        
case VK_F1:
            g_show_help 
= !g_show_help;
            
break;
        }
    }
}

//--------------------------------------------------------------------------------------
// Handle events for controls
//--------------------------------------------------------------------------------------
void CALLBACK OnGUIEvent(UINT eventint control_id, CDXUTControl* control, void* user_context)
{
    
switch(control_id)
    {
    
case IDC_TOGGLE_FULLSCREEN:
        DXUTToggleFullScreen();
        
break;

    
case IDC_TOGGLE_REF:
        DXUTToggleREF();
        
break;

    
case IDC_CHANGE_DEVICE:
        g_settings_dlg.SetActive(
true);
        
break;
    }
}

//--------------------------------------------------------------------------------------
// Initialize dialogs
//--------------------------------------------------------------------------------------
void InitDialogs()
{
    g_settings_dlg.Init(
&g_dlg_resource_manager);
    g_button_dlg.Init(
&g_dlg_resource_manager);
    g_control_dlg.Init(
&g_dlg_resource_manager);

    g_button_dlg.SetCallback(OnGUIEvent);

    
int x = 35, y = 10, width = 125, height = 22;

    g_button_dlg.AddButton(IDC_TOGGLE_FULLSCREEN, L
"Toggle full screen", x, y,         width, height);
    g_button_dlg.AddButton(IDC_TOGGLE_REF,          L
"Toggle REF (F3)",     x, y += 24, width, height);
    g_button_dlg.AddButton(IDC_CHANGE_DEVICE,      L
"Change device (F2)", x, y += 24, width, height, VK_F2);

    g_button_dlg.SetCallback(OnGUIEvent);

    y 
= 10;

    g_control_dlg.AddComboBox(IDC_COMBO, x, y 
+= 24, width, height);
    g_control_dlg.GetComboBox(IDC_COMBO)
->AddItem(L"Text1", NULL);
    g_control_dlg.GetComboBox(IDC_COMBO)
->AddItem(L"Text2", NULL);
    g_control_dlg.GetComboBox(IDC_COMBO)
->AddItem(L"Text3", NULL);
    g_control_dlg.GetComboBox(IDC_COMBO)
->AddItem(L"Text4", NULL);

    g_control_dlg.AddCheckBox(IDC_CHECK_BOX_1, L
"CheckBox1", x, y += 24, width, height);
    g_control_dlg.AddCheckBox(IDC_CHECK_BOX_2, L
"CheckBox2", x, y += 24, width, height);

    g_control_dlg.AddRadioButton(IDC_RADIO_1, IDC_RADIO_GROUP_1, L
"Radio1G1", x, y += 24, width, height);
    g_control_dlg.AddRadioButton(IDC_RADIO_2, IDC_RADIO_GROUP_1, L
"Radio2G1", x, y += 24, width, height);
    g_control_dlg.AddRadioButton(IDC_RADIO_3, IDC_RADIO_GROUP_1, L
"Radio3G1", x, y += 24, width, height);
    g_control_dlg.GetRadioButton(IDC_RADIO_3)
->SetChecked(true);

    g_control_dlg.AddButton(IDC_BUTTON_1, L
"Button1", x, y += 24, width, height);
    g_control_dlg.AddButton(IDC_BUTTON_2, L
"Button2", x, y += 24, width, height);

    g_control_dlg.AddRadioButton(IDC_RADIO_4, IDC_RADIO_GROUP_2, L
"Radio1G2", x, y += 24, width, height);
    g_control_dlg.AddRadioButton(IDC_RADIO_5, IDC_RADIO_GROUP_2, L
"Radio2G2", x, y += 24, width, height);
    g_control_dlg.GetRadioButton(IDC_RADIO_5)
->SetChecked(true);

    g_control_dlg.AddSlider(IDC_SLIDER, 
50, y += 24100, height);
    g_control_dlg.GetSlider(IDC_SLIDER)
->SetRange(0100);
    g_control_dlg.GetSlider(IDC_SLIDER)
->SetValue(50);

    g_control_dlg.AddEditBox(IDC_EDIT, L
"Test", x, y += 24, width, 32);
}

//--------------------------------------------------------------------------------------
// Initialize everything and go into a render loop
//--------------------------------------------------------------------------------------
INT WINAPI WinMain( HINSTANCE, HINSTANCE, LPSTR, int )
{
    
// Enable run-time memory check for debug builds.
#if defined(DEBUG) | defined(_DEBUG)
    _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF 
| _CRTDBG_LEAK_CHECK_DF );
#endif

    
// Set the callback functions
    DXUTSetCallbackDeviceCreated( OnCreateDevice );
    DXUTSetCallbackDeviceReset( OnResetDevice );
    DXUTSetCallbackDeviceLost( OnLostDevice );
    DXUTSetCallbackDeviceDestroyed( OnDestroyDevice );
    DXUTSetCallbackMsgProc( MsgProc );
    DXUTSetCallbackFrameRender( OnFrameRender );
    DXUTSetCallbackFrameMove( OnFrameMove );
    DXUTSetCallbackKeyboard(OnKeyboardProc);
   
    
// TODO: Perform any application-level initialization here
    InitDialogs();

    
// Initialize DXUT and create the desired Win32 window and Direct3D device for the application
    DXUTInit( truetruetrue ); // Parse the command line, handle the default hotkeys, and show msgboxes
    DXUTSetCursorSettings( truetrue ); // Show the cursor and clip it when in full screen
    DXUTCreateWindow( L"AddControl" );
    DXUTCreateDevice( D3DADAPTER_DEFAULT, 
true640480, IsDeviceAcceptable, ModifyDeviceSettings );

    
// Start the render loop
    DXUTMainLoop();

    
// TODO: Perform any application-level cleanup here

    
return DXUTGetExitCode();
}

 

下載示例工程


posted on 2008-05-19 14:28 lovedday 閱讀(2242) 評論(1)  編輯 收藏 引用

評論

# re: DXUT框架剖析(14) 2011-09-22 15:32

你好 我用的DX2009年3月版+VS2008
結果加入那四個文件后提示打不開包含文件
在主程序的.cpp中加入兩個的頭文件后
出現一堆:無法解析的外部符號
找了一個能運行的例子 把lib拷過來加進去 少了幾個 但是還有兩個無法識別的外部符號 不知道該怎么解決 希望指點一下啊
謝謝  回復  更多評論   


只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


公告

導航

統計

常用鏈接

隨筆分類(178)

3D游戲編程相關鏈接

搜索

最新評論

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            日韩一级二级三级| 99综合在线| 久久久亚洲精品一区二区三区 | 久久视频在线免费观看| 亚洲欧美一区在线| 国产一区二区三区网站| 玖玖视频精品| 欧美丰满少妇xxxbbb| 日韩亚洲欧美高清| 一区二区三区产品免费精品久久75| 欧美午夜免费影院| 久久超碰97人人做人人爱| 欧美亚洲专区| 亚洲国产精品成人一区二区| 亚洲精品美女91| 欧美日韩中文字幕日韩欧美| 久久成人人人人精品欧| 久久久噜噜噜久久人人看| 亚洲三级免费电影| 亚洲图片在线| …久久精品99久久香蕉国产| 亚洲免费成人av电影| 国产精品视频yy9299一区| 久久午夜精品| 欧美日韩中文另类| 久久人人爽人人| 欧美日韩mp4| 久久国产手机看片| 欧美激情日韩| 久久久久久97三级| 欧美日本视频在线| 久久人体大胆视频| 欧美日韩国产经典色站一区二区三区| 久久精品国产免费| 欧美日本国产在线| 欧美aⅴ一区二区三区视频| 国产精品久久久久久福利一牛影视| 麻豆国产精品一区二区三区 | 性做久久久久久久免费看| 亚洲精品护士| 欧美在线资源| 午夜精品一区二区三区在线| 欧美成人激情视频免费观看| 久久精品成人一区二区三区蜜臀| 欧美日韩天天操| 欧美成人精品在线| 国产一区二区视频在线观看| 国产精品99久久久久久久久 | 国产一区二区三区高清播放| 亚洲精品中文字幕有码专区| 最新成人在线| 久久综合999| 麻豆成人在线观看| 国产午夜精品久久| 亚洲永久精品大片| 亚洲综合999| 国产精品va在线播放我和闺蜜| 亚洲激情视频网| 亚洲国产成人午夜在线一区| 久久激情视频免费观看| 久久精品国产亚洲a| 国产精品主播| 亚洲欧美日韩另类精品一区二区三区| 亚洲一二三区视频在线观看| 欧美日韩国产成人| 亚洲国产精品小视频| 亚洲黑丝一区二区| 嫩草国产精品入口| 亚洲电影激情视频网站| 亚洲国产婷婷| 欧美另类在线观看| 亚洲免费不卡| 午夜精品久久久久久久| 国产精品久久久久永久免费观看 | 久久免费视频网站| 黑人巨大精品欧美一区二区小视频| 亚洲视频欧美在线| 欧美一区二区三区免费观看| 国产免费成人在线视频| 欧美亚洲一区三区| 毛片基地黄久久久久久天堂| 亚洲国产裸拍裸体视频在线观看乱了中文 | 激情欧美一区| 女人天堂亚洲aⅴ在线观看| 亚洲国产欧美日韩| 亚洲午夜未删减在线观看| 国产精品国产a级| 欧美在线91| 亚洲国产日韩欧美| 亚洲网在线观看| 国产美女精品免费电影| 久久久噜噜噜久久中文字免| 亚洲精品欧洲| 欧美一区二区视频网站| 国内成人精品一区| 欧美肥婆在线| 午夜视频一区| 亚洲三级电影全部在线观看高清| 亚洲欧洲av一区二区| 国产亚洲精品一区二555| 美女脱光内衣内裤视频久久网站| 夜夜嗨av一区二区三区四区| 久久精品视频在线观看| 亚洲精品国产精品乱码不99按摩 | 乱中年女人伦av一区二区| 最新日韩中文字幕| 久久精彩免费视频| 99re这里只有精品6| 国产亚洲精品综合一区91| 欧美国产高清| 久久九九国产| 亚洲网站在线看| 91久久极品少妇xxxxⅹ软件| 亚欧成人在线| 一本久久精品一区二区| 国内精品国产成人| 国产精品高潮粉嫩av| 欧美69视频| 久久天天躁夜夜躁狠狠躁2022| 中文国产成人精品久久一| 亚洲国产精品va| 久热精品视频在线免费观看 | 亚洲高清免费在线| 国产一区91| 国产精品亚洲一区| 欧美精品亚洲二区| 美女久久网站| 久久嫩草精品久久久精品| 午夜宅男久久久| 亚洲一区二区三区免费观看| 亚洲精品少妇网址| 亚洲激情欧美| 91久久国产精品91久久性色| 欧美1区2区3区| 久久综合伊人77777| 久久精品水蜜桃av综合天堂| 亚洲欧美日韩国产综合| 亚洲视频你懂的| 夜夜嗨网站十八久久| 亚洲精品日韩在线| 亚洲片在线观看| 亚洲精品久久久久久下一站| 一色屋精品视频免费看| 国产亚洲一区二区精品| 国产婷婷色一区二区三区在线 | 久久夜色精品国产噜噜av| 久久高清福利视频| 久久大逼视频| 久久综合九色综合欧美就去吻| 久久久久九九九九| 久久久久久网站| 裸体一区二区| 欧美精品www| 欧美婷婷久久| 国产精品久久久一区二区三区| 国产精品久久久久久久久久ktv| 国产精品www网站| 国产欧美一区二区在线观看| 国产日韩欧美自拍| 精品二区久久| 最新日韩在线视频| 亚洲午夜性刺激影院| 欧美一区二区三区精品电影| 巨乳诱惑日韩免费av| 亚洲电影网站| 9色国产精品| 久久精精品视频| 欧美激情精品久久久久久黑人 | 久久综合久色欧美综合狠狠 | 欧美日韩国产色视频| 国产精品你懂的| 影院欧美亚洲| 一区二区三区高清| 久久国产视频网站| 亚洲第一二三四五区| 一本一本久久a久久精品牛牛影视| 午夜日韩福利| 欧美国产第一页| 国产日韩精品一区| 亚洲激情二区| 欧美影院一区| 亚洲日本乱码在线观看| 亚洲一区二区免费视频| 久久尤物视频| 国产精品久久久久秋霞鲁丝| 亚洲国产mv| 欧美一区三区三区高中清蜜桃| 亚洲电影免费观看高清完整版| 亚洲免费在线看| 欧美精品亚洲二区| 国产一区二区黄| 亚洲一区二区三区四区视频| 蜜臀av国产精品久久久久| 9i看片成人免费高清| 乱人伦精品视频在线观看| 国产麻豆视频精品| 一本大道av伊人久久综合| 久久在线精品| 欧美在线三级| 国产精品久久久一区二区|