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

天行健 君子當自強而不息

DXUT框架剖析(7)

(2)幀事件

框架也提供了幀事件,它在渲染過程中的每一幀被調用,應用程序應該注冊并實現這些回調函數,如下表所示:

應用程序回調函數 注冊回調函數 框架調用時機 場景渲染
LPDXUTCALLBACK-
FRAMEMOVE
DXUTSetCallback-
FrameMove
在每一幀開始時調用一次 這個回調函數是應用程序處理場景更新的最好位置,但它不應包括實際的渲染調用,渲染調用應放在幀渲染回調函數中。
LPDXUTCALLBACK-
D3D9FRAMERENDER
DXUTSetCallback-
D3D9FrameRender
在每一幀結束或窗口需要重畫時調用 所有對場景的渲染調用都應在此回調函數中完成,在這個回調函數返回后,框架將調用Present()來顯示交換鏈中下一緩沖區的內容。


 

DXUTSetCallbackFrameMove

Sets the frame update callback function.

 VOID DXUTSetCallbackFrameMove( 
LPDXUTCALLBACKFRAMEMOVE pCallbackFrameMove ,
void* pUserContext
) ;

Parameters

pCallbackFrameMove
[in] Pointer to a LPDXUTCALLBACKFRAMEMOVE callback function. If the callback function is supplied, it will be called at the beginning of every frame to facilitate updates to the scene. If NULL, DXUT will not notify the application about new frames.
pUserContext
[in] Pointer to a user-defined value which is passed to the callback function. Typically used by an application to pass a pointer to a data structure that provides context information for the callback function. The default value is NULL

Return Values

No return value.

Remarks

The LPDXUTCALLBACKFRAMEMOVE callback function is the appropriate location for the application to handle updates to the scene. However, LPDXUTCALLBACKFRAMEMOVE is not intended to contain actual rendering calls, which should instead be placed in the LPDXUTCALLBACKD3D9FRAMERENDER or LPDXUTCALLBACKD3D10FRAMERENDER callback function. These callbacks is called when rendering with either Direct3D 9 or Direct3D 10 respectively.

The LPDXUTCALLBACKFRAMEMOVE callback function will be called once per frame, while the render callback function will be called whenever the scene needs to be rendered, which might be more than once per frame on rare occasion if a WM_PAINT message occurs.


 

LPDXUTCALLBACKFRAMEMOVE

Application-defined callback function that allows for updating the scene. This function is called by DXUT once each frame, before the application renders the scene.

 VOID LPDXUTCALLBACKFRAMEMOVE( 
DOUBLE fTime ,
FLOAT fElapsedTime ,
void* pUserContext
) ;

Parameters

fTime
[in] Time elapsed since the application started, in seconds.
fElapsedTime
[in] Time elapsed since the last frame, in seconds.
pUserContext
[in] Pointer to a user-defined value which is passed to the callback function. Typically used by an application to pass a pointer to a data structure that provides context information for the callback function. The default value is NULL

Return Values

No return value.

Remarks

The LPDXUTCALLBACKFRAMEMOVE callback function is the appropriate location for the application to handle updates to the scene. However, LPDXUTCALLBACKFRAMEMOVE is not intended to contain actual rendering calls, which should instead be placed in the LPDXUTCALLBACKD3D9FRAMERENDER or LPDXUTCALLBACKD3D10FRAMERENDER callback function. These callbacks is called when rendering with either Direct3D 9 or Direct3D 10 respectively.

The LPDXUTCALLBACKFRAMEMOVE callback function will be called once per frame, while the render callback function will be called whenever the scene needs to be rendered, which might be more than once per frame on rare occasion if a WM_PAINT message occurs.


 

DXUTSetCallbackD3D9FrameRender

Sets the Direct3D 9 frame render callback function.

 VOID DXUTSetCallbackD3D9FrameRender( 
LPDXUTCALLBACKD3D9FRAMERENDER pCallback ,
void* pUserContext
) ;

Parameters

pCallback
[in] Pointer to a LPDXUTCALLBACKD3D9FRAMERENDER callback function. If the callback function is supplied, it will be called once per frame for the application to render the current scene using the Direct3D 9 device. If NULL, DXUT will not prompt the application to render the scene.
pUserContext
[in] Pointer to a user-defined value which is passed to the callback function. Typically used by an application to pass a pointer to a data structure that provides context information for the callback function. The default value is NULL

Return Values

No return value.

Remarks

This function only needs to be called if the application supports rendering with Direct3D 9 device.

The LPDXUTCALLBACKD3D9FRAMERENDER callback function is the appropriate location for the application to render the current scene using the Direct3D 9 device. The LPDXUTCALLBACKFRAMEMOVE callback function will be called once per frame, while LPDXUTCALLBACKD3D9FRAMERENDER will be called when the scene needs to be rendered, which might be more than once per frame.


 

LPDXUTCALLBACKD3D9FRAMERENDER

Application-defined callback function that allows for rendering the scene using a Direct3D 9 device. This function is called by DXUT at the end of every frame, and whenever the application needs to paint the scene.

 VOID LPDXUTCALLBACKD3D9FRAMERENDER( 
IDirect3DDevice9 * pd3dDevice ,
DOUBLE fTime ,
FLOAT fElapsedTime ,
void* pUserContext
) ;

Parameters

pd3dDevice
[in] Pointer to the Direct3D 9 device used for rendering.
fTime
[in] Time elapsed since the application started, in seconds.
fElapsedTime
[in] Time elapsed since the last frame, in seconds.
pUserContext
[in] Pointer to a user-defined value which is passed to the callback function. Typically used by an application to pass a pointer to a data structure that provides context information for the callback function. The default value is NULL

Return Values

No return value.

Remarks

The LPDXUTCALLBACKD3D9FRAMERENDER callback function is the appropriate location for the application to render the current scene using the Direct3D 9 device. The LPDXUTCALLBACKFRAMEMOVE callback function will be called once per frame, while LPDXUTCALLBACKD3D9FRAMERENDER will be called when the scene needs to be rendered, which might be more than once per frame.

DXUT will call this function after the LPDXUTCALLBACKFRAMEMOVE callback function.

在函數 LPDXUTCALLBACKFRAMEMOVE 中,通常進行數據變換,比如設置坐標變換矩陣。在函數 LPDXUTCALLBACKD3D9FRAMERENDER 中,主要進行圖形的渲染,類似于Direct3D API中的Render()函數。

 

(3)消息事件

框架通過下表中的回調函數和相應的注冊函數來傳遞窗口消息、鍵盤事件和鼠標事件,編寫應用程序對這些事件做出適當反應。

應用程序回調函數 注冊回調函數 描述
LPDXUTCALLBACKMSGPROC DXUTSetCallbackMsgProc 處理來自DXUT消息泵的窗口消息
LPDXUTCALLBACKKEYBOARD DXUTSetCallbackKeyboard 處理來自DXUT消息泵的鍵盤事件
LPDXUTCALLBACKMOUSE DXUTSetCallbackMouse 處理來自DXUT消息泵的鼠標事件


 

DXUTSetCallbackKeyboard

Sets the keyboard event callback function.

 VOID DXUTSetCallbackKeyboard( 
LPDXUTCALLBACKKEYBOARD pCallbackKeyboard ,
void* pUserContext
) ;

Parameters

pCallbackKeyboard
[in] Pointer to a LPDXUTCALLBACKKEYBOARD keyboard event callback function. If supplied, the callback function will be called for keyboard events. If NULL, DXUT will not notify the application about keyboard events.
pUserContext
[in] Pointer to a user-defined value which is passed to the callback function. Typically used by an application to pass a pointer to a data structure that provides context information for the callback function. The default value is NULL

Return Values

No return value.

Remarks

The pCallbackKeyboard keyboard event callback function will be called when any keyboard event occurs.

This callback mechanism is provided to simplify handling keyboard messages through the windows message pump, but does not preclude the application from handling those messages directly through the LPDXUTCALLBACKMSGPROC callback.


 

LPDXUTCALLBACKKEYBOARD

Application-defined keyboard event callback function, called by DXUT.

 VOID LPDXUTCALLBACKKEYBOARD( 
UINT nChar ,
bool bKeyDown ,
bool bAltDown ,
void* pUserContext
) ;

Parameters

nChar
[in] A virtual-key code for the key. See Virtual-Key Codes for a listing.
bKeyDown
[in] TRUE if key is down. FALSE if the key is up
bAltDown
[in] TRUE if the ALT key is also down.
pUserContext
[in] Pointer to a user-defined value which is passed to the callback function. Typically used by an application to pass a pointer to a data structure that provides context information for the callback function. The default value is NULL

Return Values

No return value.

Remarks

The pCallbackKeyboard keyboard event callback function will be called when any keyboard event occurs.

This callback mechanism is provided to simplify handling keyboard messages through the windows message pump, but does not preclude the application from handling those messages directly through the LPDXUTCALLBACKMSGPROC callback.


 

DXUTSetCallbackMouse

Sets the mouse event callback function.

 VOID DXUTSetCallbackMouse( 
LPDXUTCALLBACKMOUSE pCallbackMouse ,
BOOL bIncludeMouseMove ,
void* pUserContext
) ;

Parameters

pCallbackMouse
[in] Pointer to an LPDXUTCALLBACKMOUSE mouse event callback function. If supplied, the callback function will be called for mouse events. If NULL, DXUT will not notify the application about mouse events.
bIncludeMouseMove
[in] If TRUE, the mouse movement events are passed to the pCallbackMouse callback function. Default value is FALSE.
pUserContext
[in] Pointer to a user-defined value which is passed to the callback function. Typically used by an application to pass a pointer to a data structure that provides context information for the callback function. The default value is NULL

Return Values

No return value.

Remarks

The pCallbackMouse mouse event callback function will be called when any mouse events occurs

This callback mechanism is provided to simplify handling mouse messages through the Windows message pump, but does not preclude the application from handling those messages directly in the LPDXUTCALLBACKMSGPROC callback function.


 

LPDXUTCALLBACKMOUSE

Application-defined mouse event callback function, called by DXUT when it receives mouse events.

 VOID LPDXUTCALLBACKMOUSE( 
bool bLeftButtonDown ,
bool bRightButtonDown ,
bool bMiddleButtonDown ,
bool bSideButton1Down ,
bool bSideButton2Down ,
INT nMouseWheelDelta ,
INT xPos ,
INT yPos ,
void* pUserContext
) ;

Parameters

bLeftButtonDown
[in] The left mouse button is down.
bRightButtonDown
[in] The right mouse button is down.
bMiddleButtonDown
[in] The middle mouse button is down.
bSideButton1Down
[in] Windows 2000/Windows XP: The first side button is down.
bSideButton2Down
[in] Windows 2000/Windows XP: The second side button is down.
nMouseWheelDelta
[in] The distance and direction the mouse wheel has rolled, expressed in multiples or divisions of WHEEL_DELTA, which is 120. A positive value indicates that the wheel was rotated forward, away from the user; a negative value indicates that the wheel was rotated backward, toward the user.
xPos
[in] x-coordinate of the pointer, relative to the upper-left corner of the client area.
yPos
[in] y-coordinate of the pointer, relative to the upper-left corner of the client area.
pUserContext
[in] Pointer to a user-defined value which is passed to the callback function. Typically used by an application to pass a pointer to a data structure that provides context information for the callback function. The default value is NULL

Return Values

No return value.

Remarks

The pCallbackMouse mouse event callback function will be called when any mouse events occurs

This callback mechanism is provided to simplify handling mouse messages through the Windows message pump, but does not preclude the application from handling those messages directly in the LPDXUTCALLBACKMSGPROC callback function.


posted on 2008-05-15 18:10 lovedday 閱讀(1375) 評論(0)  編輯 收藏 引用

公告

導航

統計

常用鏈接

隨筆分類(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>
            亚洲二区在线视频| 香蕉久久国产| 久久精品欧美日韩| 国产欧美韩日| 西西人体一区二区| 亚欧成人在线| 亚洲大片av| 亚洲第一久久影院| 欧美三级不卡| 欧美一区二区啪啪| 久久裸体艺术| 亚洲精品孕妇| 在线视频日韩精品| 国外精品视频| 最新亚洲电影| 国产精品免费看片| 开心色5月久久精品| 久久天堂av综合合色| 99精品国产高清一区二区| 一本色道婷婷久久欧美| 国产一区清纯| 亚洲区中文字幕| 国产欧美日韩高清| 亚洲国产婷婷香蕉久久久久久| 欧美日韩福利视频| 久久久久久精| 欧美日韩精品不卡| 巨胸喷奶水www久久久免费动漫| 欧美福利电影网| 久久成人18免费网站| 欧美韩国日本综合| 亚洲第一在线综合网站| 亚洲欧美日韩久久精品| 性xx色xx综合久久久xx| 欧美激情aaaa| 欧美国产在线视频| 久久美女性网| 国产精品国码视频| 亚洲精品乱码久久久久久| 国产欧美日韩视频一区二区三区 | 欧美成人免费在线视频| 欧美亚洲色图校园春色| 欧美激情视频一区二区三区免费 | 在线观看中文字幕亚洲| 亚洲一二三四久久| 亚洲毛片av| 久久在线播放| 欧美一区二区成人| 欧美日韩精品免费观看视一区二区| 久久久久久午夜| 国产日产欧美精品| 国产精品99久久99久久久二8| 亚洲精品国产拍免费91在线| 久久久福利视频| 欧美中文字幕视频在线观看| 国产精品久久久久99| 欧美激情一区二区三区全黄 | 国产欧美精品在线播放| 在线午夜精品自拍| 亚洲永久在线| 欧美色网在线| 一区二区三区四区五区精品视频 | 亚洲大胆av| 久久综合中文色婷婷| 麻豆精品91| 好男人免费精品视频| 亚洲欧美区自拍先锋| 亚洲欧美久久| avtt综合网| 一本色道久久综合亚洲精品不卡| 一区二区三区日韩在线观看| 欧美日本久久| 一区二区三区不卡视频在线观看| 亚洲一区二区在线观看视频| 欧美色123| 亚洲综合精品一区二区| 久久国产精品毛片| 黄色成人av网| 麻豆精品视频| 亚洲老司机av| 香蕉乱码成人久久天堂爱免费| 国产免费观看久久黄| 久久成人在线| 欧美激情视频网站| 99这里只有精品| 欧美系列精品| 午夜久久久久久| 欧美1区3d| 一区二区三区久久久| 国产老女人精品毛片久久| 亚洲欧美另类国产| 欧美高清自拍一区| 亚洲一区三区视频在线观看 | 久久久99免费视频| 亚洲高清在线观看一区| 亚洲美女视频在线观看| 国产精品欧美日韩| 久久久999精品免费| 亚洲人成网在线播放| 午夜精品视频| 亚洲福利视频网| 欧美视频一区二| 久久精品视频免费观看| 亚洲精品社区| 久久久久一区二区三区| 99ri日韩精品视频| 国产精品久久婷婷六月丁香| 欧美在线观看天堂一区二区三区| 亚洲国产日韩欧美一区二区三区| 亚洲伊人网站| 亚洲观看高清完整版在线观看| 欧美日韩在线视频一区二区| 欧美一级一区| 一本大道久久a久久精品综合| 久久久免费观看视频| 亚洲一区二区三区高清不卡| 亚洲国产精品久久久久秋霞影院 | 久久精品国产亚洲a| 日韩视频在线永久播放| 免费人成精品欧美精品| 亚洲欧美制服另类日韩| 99香蕉国产精品偷在线观看| 尤物精品国产第一福利三区| 国产精品主播| 欧美日本国产| 欧美精品一卡| 久久天天躁狠狠躁夜夜av| 欧美亚洲色图校园春色| 亚洲精品在线一区二区| 欧美成人资源网| 久久蜜桃精品| 久久久99精品免费观看不卡| 欧美一区二区视频在线| 一区二区三区国产精品| 一区二区三区av| 亚洲精品视频二区| 亚洲久久一区二区| 亚洲欧洲一区| 亚洲精品一区二区网址 | 欧美日韩在线视频首页| 欧美精品一区二区视频| 欧美激情在线狂野欧美精品| 欧美大成色www永久网站婷| 免费试看一区| 久久综合中文色婷婷| 乱码第一页成人| 久久亚洲一区| 欧美a级片网| 欧美—级高清免费播放| 欧美女主播在线| 欧美日韩亚洲一区二区三区四区| 欧美屁股在线| 国产精品国色综合久久| 国产老肥熟一区二区三区| 国产免费一区二区三区香蕉精| 国产精品系列在线播放| 国产日韩欧美精品一区| 国产婷婷精品| 国产综合精品| 亚洲区中文字幕| 一本色道久久88综合日韩精品| 在线性视频日韩欧美| 午夜在线精品| 欧美一区二区播放| 久久理论片午夜琪琪电影网| 久色婷婷小香蕉久久| 亚洲国产欧洲综合997久久| 亚洲福利视频一区二区| 一本色道综合亚洲| 久久国产手机看片| 欧美高清视频在线| 国产精品视频| 亚洲国产福利在线| 亚洲欧美国产制服动漫| 久久久在线视频| 亚洲第一精品电影| 亚洲一区二区三区777| 久久久五月婷婷| 欧美日韩一区二区精品| 国产一区二区中文| 亚洲卡通欧美制服中文| 欧美在线播放视频| 亚洲国产精品一区在线观看不卡| 亚洲永久字幕| 欧美成人在线免费观看| 国产嫩草一区二区三区在线观看| 亚洲高清不卡在线观看| 亚洲欧美中文日韩v在线观看| 欧美大片免费看| 亚洲欧美日韩国产成人精品影院| 老牛影视一区二区三区| 国产精品网站在线| av成人免费| 美女视频黄a大片欧美| 亚洲一区精彩视频| 欧美激情第8页| 韩国在线视频一区| 久久成人av少妇免费| 日韩一区二区高清| 免费在线看一区|