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

天行健 君子當自強而不息

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 閱讀(1384) 評論(0)  編輯 收藏 引用


只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   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>
            久久国内精品自在自线400部| 久久偷窥视频| 欧美性色aⅴ视频一区日韩精品| 亚洲破处大片| 亚洲久久成人| 欧美午夜免费| 欧美亚洲视频| 午夜视频在线观看一区二区三区 | 一区二区冒白浆视频| 欧美色视频一区| 欧美亚洲视频一区二区| 久久久激情视频| 亚洲国产日韩欧美| 亚洲三级影院| 欧美午夜视频网站| 久久久久久亚洲精品中文字幕 | 亚洲高清不卡在线观看| 欧美精品手机在线| 99精品久久免费看蜜臀剧情介绍| 欧美三日本三级三级在线播放| 午夜精品久久| 久久精品中文字幕免费mv| 在线观看亚洲精品视频| 美女诱惑黄网站一区| 欧美丰满少妇xxxbbb| 一区二区三区国产精华| 一区二区三区四区在线| 国产乱码精品一区二区三区忘忧草| 欧美一区1区三区3区公司| 久久精品日韩一区二区三区| 日韩一级在线| 欧美在线精品一区| 亚洲天堂视频在线观看| 欧美特黄一区| 久久成人精品| 欧美国产高清| 久久婷婷久久| 欧美午夜电影在线观看| 欧美成人免费大片| 国产日韩欧美一区| 亚洲人成毛片在线播放女女| 国产欧美日韩一区二区三区在线| 亚洲第一精品夜夜躁人人爽| 国产精品久久久久久久9999| 欧美黄色网络| 一色屋精品亚洲香蕉网站| 99综合在线| 亚洲精品一区二区三区福利| 小辣椒精品导航| 亚洲私拍自拍| 欧美激情aaaa| 欧美黄色小视频| 一区视频在线看| 欧美有码在线观看视频| 午夜在线电影亚洲一区| 欧美日韩在线视频一区二区| 亚洲高清资源| 在线观看亚洲视频| 久久精品在线免费观看| 久久久久久久欧美精品| 国产日韩视频一区二区三区| 亚洲午夜精品久久| 亚洲一区网站| 欧美午夜不卡在线观看免费 | 亚洲欧美日韩中文在线制服| 欧美大片在线看| 亚洲黄色成人网| 亚洲精品免费网站| 欧美精品一区二区三区高清aⅴ| 久久亚洲国产成人| 欲香欲色天天天综合和网| 久久精品国产欧美激情| 久久综合九色综合欧美就去吻| 国产一区二区日韩精品| 久久精品国产v日韩v亚洲 | 免费不卡亚洲欧美| 在线精品一区二区| 欧美99在线视频观看| 亚洲电影第三页| 亚洲精品一区二区三区蜜桃久 | 亚洲一级在线| 欧美一区二区三区四区视频| 国产麻豆9l精品三级站| 欧美在线亚洲一区| 亚洲高清资源综合久久精品| 99热这里只有精品8| 欧美日韩在线播放一区二区| 亚洲一区欧美二区| 麻豆精品一区二区综合av | 国产精品免费观看视频| 亚洲免费在线观看| 久久中文在线| 99国产精品99久久久久久| 欧美日韩日本视频| 欧美在线资源| 亚洲黄色高清| 久久本道综合色狠狠五月| 精品不卡在线| 欧美视频手机在线| 久久疯狂做爰流白浆xx| 久久先锋影音av| 亚洲精品在线电影| 国产精品亚洲一区二区三区在线| 欧美一级专区免费大片| 久久亚洲精品伦理| 韩国一区二区在线观看| 欧美ed2k| 亚洲一区二区av电影| 久久精品2019中文字幕| 在线看片欧美| 国产精品成人v| 免费观看在线综合| 欧美亚洲专区| 亚洲精品乱码| 麻豆成人精品| 午夜精品视频在线| 91久久久久久久久| 国产欧美在线播放| 欧美日韩精品一区二区三区四区| 欧美一级欧美一级在线播放| 亚洲免费观看视频| 欧美激情第9页| 欧美资源在线观看| 亚洲免费视频网站| 亚洲精品美女久久7777777| 国产午夜精品在线| 国产精品一区二区三区四区| 欧美精品一区二区蜜臀亚洲| 久久久精品国产免费观看同学| 亚洲色图在线视频| a4yy欧美一区二区三区| 亚洲高清电影| 欧美a级一区二区| 欧美中文字幕不卡| 午夜影院日韩| 午夜欧美不卡精品aaaaa| av不卡在线看| 99精品国产一区二区青青牛奶| 亚洲电影专区| 91久久精品日日躁夜夜躁国产| 在线播放日韩| **网站欧美大片在线观看| 狠狠综合久久av一区二区小说| 国产网站欧美日韩免费精品在线观看| 欧美日韩在线大尺度| 欧美视频二区36p| 国产精品乱人伦一区二区| 欧美性大战久久久久久久| 欧美视频网站| 国产精品欧美久久| 国产精品一二一区| 国产精品中文字幕欧美| 国产亚洲一区二区精品| 国产一区二区三区久久悠悠色av | 麻豆91精品91久久久的内涵| 久久国产色av| 久久综合电影| 欧美激情日韩| 国产精品久久久久久久9999| 国产精品捆绑调教| 国产三区精品| 尤物yw午夜国产精品视频明星| 在线精品亚洲| 一区二区日韩精品| 香蕉av777xxx色综合一区| 久久久综合网站| 欧美岛国在线观看| 一级成人国产| 久久国产精彩视频| 欧美久久综合| 国产日韩一区在线| 亚洲欧洲精品成人久久奇米网| 一本色道久久综合精品竹菊| 欧美一级在线播放| 欧美韩日一区| 亚洲一区二区在线看| 久久精品一区二区国产| 欧美日韩日本视频| 一区二区在线视频观看| aa成人免费视频| 久久亚洲精品网站| 99视频在线精品国自产拍免费观看| 亚洲一区久久| 欧美久久久久免费| 一区久久精品| 亚洲嫩草精品久久| 欧美va天堂va视频va在线| 亚洲一二三区在线| 欧美国产在线视频| 国产在线精品一区二区夜色| 亚洲精品少妇| 久久九九国产精品怡红院| 日韩性生活视频| 久久婷婷久久一区二区三区| 欧美三级在线视频| 亚洲激情影视| 美女在线一区二区| 亚洲欧美中文另类| 欧美午夜在线| 夜色激情一区二区|