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

天行健 君子當自強而不息

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>
            久久精品免费播放| 欧美在线亚洲综合一区| 欧美成人国产| 久色婷婷小香蕉久久| 狠狠色综合播放一区二区| 久久美女性网| 久久综合久久久| 日韩一区二区精品在线观看| 亚洲免费高清视频| 国产欧美一区二区精品性| 久久婷婷影院| 欧美极品色图| 午夜一区二区三区不卡视频| 欧美一区二区三区四区视频| 亚洲国产经典视频| 亚洲视频电影在线| 国产亚洲精品bv在线观看| 欧美成人国产一区二区| 欧美三级视频在线播放| 久久精品综合网| 欧美精品一区二区蜜臀亚洲| 午夜精品久久久久久久99黑人| 久久久久国内| 亚洲欧美春色| 免费一级欧美在线大片| 亚洲一区二区三区视频| 久久久久久电影| 亚洲自拍偷拍一区| 嫩草伊人久久精品少妇av杨幂| 亚洲综合视频1区| 麻豆成人av| 欧美资源在线观看| 欧美人妖另类| 欧美国产在线观看| 国产美女一区| av成人免费在线观看| 影音先锋亚洲电影| 亚洲欧美成人在线| 正在播放亚洲| 免费91麻豆精品国产自产在线观看| 亚洲欧美视频在线| 欧美日韩视频在线观看一区二区三区| 久久婷婷成人综合色| 国产精品福利在线| 亚洲精品一线二线三线无人区| 一色屋精品视频在线观看网站| 亚洲永久免费av| 亚洲在线一区二区| 欧美欧美全黄| 亚洲激情视频网| 激情综合在线| 久久av最新网址| 欧美一级大片在线观看| 国产精品video| 夜夜嗨av一区二区三区免费区| 亚洲国产精品成人综合色在线婷婷 | 午夜亚洲影视| 欧美一级播放| 国产精品三级视频| 亚洲一区二区三区国产| 中文欧美字幕免费| 欧美日韩在线一区二区三区| 亚洲国产精品999| 亚洲精品久久久久久久久久久久久 | 欧美一区二区视频观看视频| 午夜精品福利一区二区三区av| 欧美视频精品一区| 亚洲视频在线播放| 性做久久久久久免费观看欧美| 国产精品三级视频| 午夜亚洲影视| 美女尤物久久精品| 亚洲激情在线播放| 欧美另类99xxxxx| 99视频有精品| 欧美一区二区三区四区视频| 国产欧美二区| 久久婷婷蜜乳一本欲蜜臀| 免费成人毛片| 日韩一级黄色av| 国产精品久久久久国产a级| 亚洲欧美精品在线观看| 久久久综合网站| 亚洲精品亚洲人成人网| 欧美三级黄美女| 欧美在线中文字幕| 亚洲国产精品va在线看黑人| 99在线视频精品| 国产精品一区二区a| 久久久成人精品| 亚洲精品午夜| 久久国产黑丝| 日韩视频免费看| 国产精品午夜电影| 久久综合亚州| 亚洲欧美国产精品桃花| 免费在线成人| 午夜精品久久久久久久蜜桃app| 国产亚洲欧美日韩一区二区| 欧美成人精品福利| 亚洲欧美综合一区| 亚洲国产va精品久久久不卡综合| 亚洲尤物精选| 亚洲国产精品久久久久| 国产精品久久久一区二区三区| 久久久久久久久蜜桃| 99在线热播精品免费| 免费日韩av电影| 欧美在线精品免播放器视频| 亚洲青涩在线| 一区二区三区在线视频播放| 欧美日韩亚洲视频| 老司机67194精品线观看| 一区二区三区日韩欧美精品| 另类av导航| 欧美亚洲尤物久久| 一区二区三区国产在线| 在线观看精品一区| 国产日韩欧美综合| 欧美亚州一区二区三区| 欧美成人免费网| 久久久国产精品一区二区中文| 亚洲天天影视| 一本色道久久| 亚洲精品视频啊美女在线直播| 久久一区亚洲| 久久婷婷久久一区二区三区| 亚洲欧美日韩精品一区二区| 日韩一区二区精品视频| 亚洲国产婷婷| 亚洲福利视频专区| 精品二区视频| 国产一区在线看| 国产日韩欧美亚洲一区| 国产精品看片你懂得| 欧美系列精品| 国产精品久久久久久久久久久久久| 欧美激情亚洲自拍| 欧美精品二区三区四区免费看视频| 老色鬼精品视频在线观看播放| 久久大综合网| 久久久久免费视频| 久久婷婷蜜乳一本欲蜜臀| 欧美激情精品久久久久久久变态 | 欧美性感一类影片在线播放 | 欧美好吊妞视频| 蜜桃av综合| 欧美成人a∨高清免费观看| 久久国产一二区| 久久视频一区| 欧美搞黄网站| 欧美日韩精品欧美日韩精品| 欧美激情按摩| 欧美天天影院| 国产欧美视频一区二区三区| 国产欧美日韩综合一区在线观看 | 亚洲高清色综合| 亚洲理论电影网| 亚洲一区免费看| 欧美在线观看一区| 免费欧美网站| 亚洲欧洲一区| 亚洲女ⅴideoshd黑人| 欧美一级在线播放| 你懂的视频欧美| 欧美日韩免费一区二区三区| 国产精品网曝门| 在线免费高清一区二区三区| 亚洲国产婷婷| 午夜精品亚洲| 欧美不卡一卡二卡免费版| 91久久精品网| 欧美一级大片在线观看| 葵司免费一区二区三区四区五区| 欧美精品久久久久久久久老牛影院| 欧美三级视频在线播放| 狠狠干成人综合网| 一本到高清视频免费精品| 午夜久久tv| 亚洲高清一二三区| 午夜国产精品视频| 欧美aa在线视频| 国产精品一区二区在线观看网站| 红桃视频国产精品| 午夜精品久久久久99热蜜桃导演| 久久野战av| 亚洲性夜色噜噜噜7777| 老司机精品视频网站| 国产精品日韩在线一区| 亚洲国产你懂的| 久久国产一区二区| 99精品视频网| 欧美xx视频| 伊人狠狠色j香婷婷综合| 亚洲制服丝袜在线| 亚洲欧洲日本一区二区三区| 久久久久国产精品午夜一区| 欧美午夜一区二区| 99在线精品视频在线观看| 美乳少妇欧美精品|