锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久久女人与动物群交毛片,91久久精品国产免费直播,亚洲精品午夜国产va久久http://www.shnenglu.com/Daywei0123/category/18411.html鎶鏈拷姹傚崜瓚?姊︽兂鍒涢犳湭鏉?/description>zh-cnSat, 28 Apr 2012 20:17:46 GMTSat, 28 Apr 2012 20:17:46 GMT60Recording DirectX and OpenGL Rendered Animations錛堢炕璇戯級http://www.shnenglu.com/Daywei0123/archive/2012/04/28/173044.htmlDayweiDayweiSat, 28 Apr 2012 07:08:00 GMThttp://www.shnenglu.com/Daywei0123/archive/2012/04/28/173044.htmlhttp://www.shnenglu.com/Daywei0123/comments/173044.htmlhttp://www.shnenglu.com/Daywei0123/archive/2012/04/28/173044.html#Feedback0http://www.shnenglu.com/Daywei0123/comments/commentRss/173044.htmlhttp://www.shnenglu.com/Daywei0123/services/trackbacks/173044.html璁板綍DirectX鍜孫penGL娓叉煋鐨勫姩鐢?/span>
綆浠?/strong>
    褰撴垜浠垱寤烘父鎴忓拰浠跨湡妯℃嫙鏃訛紝鏈夋椂鎴戜滑鏈夊繀瑕佽褰曟覆鏌撶殑鍐呭銆傚湪鏌愪簺鎯呭喌涓嬫覆鏌撹繃浜庡鏉傚拰鑰楁椂錛岃繖鏄笉鍙伩鍏嶇殑銆?br />     鍦―irectX涓紝搴撳嚱鏁癉3DXSaveSurfaceToFile()淇濆瓨琛ㄩ潰涓轟竴寮犲浘鐗囨枃浠躲傚OpenGL錛屾垜浠敤glReadPixels()鏉ヨ娓叉煋鐨勫浘鍍忓儚绱犵劧鍚庢墜鍔ㄧ殑淇濆瓨瀹冧滑涓轟竴寮犲浘鐗囨枃浠躲傜劧鑰岃繖浜涜〃闈㈠彧鏄拡瀵瑰崟甯ц褰曠殑錛屽璁板綍涓孌佃繛緇撫娌℃湁綆鍗曠殑鏂規(guī)硶瀛樺湪銆傛崲鍙ヨ瘽璇?娌℃湁搴撳嚱鏁版潵璁板綍鎴戜滑鐨勫畬鏁村瓨鍦ㄦ覆鏌撳姩鐢繪晥鏋溿?br />    鍦ㄨ繖鏂歸潰,鏈枃鎻愬嚭浜嗗嚑綾?榪欐湁鍔╀簬鍒涢犵數(shù)褰盌irectX鐨勬柟娉曞拰鍔ㄧ敾銆傜敤綾籆DxToMovie鍜?CGLToMovie鐢?shù)濯勫彲浠ラ夋嫨鎬у湴鎴栬繛緇殑浠嶥irectX鍜孫penGL娓叉煋甯ф潵鍒涘緩銆備竴鑸潵璇?涓涓吀鍨嬬殑鐢?shù)濯勫垱浣湗q囩▼娑夊強(qiáng)澶嶆潅鐨勪換鍔?渚嬪璇誨浘鐨勫唴瀹?閫夋嫨甯ч熺巼璁劇疆,緙栬В鐮佸櫒鐨勮緗?鍒濆鍖栧獟浣撴祦,鍐欏獟浣撴祦絳夛紙璇︾粏璁ㄨ鍏充簬濡備綍鍒涘緩浣嶅浘鍥懼儚搴忓垪鐨勭數(shù)褰?璇峰弬鑰冭繖綃囨枃绔?a >Create Movie from HBitmap錛夈傜被CDxToMovie鍜孋GLToMovie榪欓噷浠嬬粛鐨勬娊璞″嚭鎵鏈変笉蹇呰鐨勫鏉傛у拰鏄撲簬浣跨敤鐨勭晫闈?鎻愪緵綆鍗曟柟娉曡В閲婂涓?br />浠嶥irectX娓叉煋搴忓垪璁板綍涓涓數(shù)褰?br />    綾籆DxToMovie鍙互璁板綍DirectX娓叉煋搴忓垪鎴愮數(shù)褰辨枃浠躲傝綾葷敤鍒癉irectX 9.0鎺ュ彛渚嬪LPDIRECT3DSURFACE9錛屽洜姝や綘搴旇鐢―irectX 9.0 SDK 鎴栬呭叾浠栫殑鍏煎鐨勫湴鏂逛嬌鐢ㄨ繖涓被 銆?br />      寮濮嬩粠鏈枃涓殑DirectX浠g爜鎷瘋礉鏂囦歡DxToMovie.h錛孯enderTarget.h錛孉viFile.h鍜孉viFile.cpp鍒頒綘鐨勫伐紼嬬洰褰曚笅鐒跺悗娣誨姞浠栦滑鍒頒綘鐨勫伐紼嬩腑錛岀劧鍚庢坊鍔爒fw.lib錛屼竴鏃︽坊鍔犲埌浣犵殑宸ョ▼涓紝浣犲彲浠ラ氳繃#include "DxToMovie.h"璁塊棶銆侰DxToMovie鏋勯犲嚱鏁版帴鍙椾笉鍚岀殑鍙傛暟濡傝緭鍑虹數(shù)褰辨枃浠跺悕,鐢?shù)濯勫抚鐨勫搴﹀拰楂樺害鐨勮姹?姣忓儚绱犳瘮鐗規(guī)暟絳?#8230;濡備笅鎵紺?
CDxToMovie(LPCTSTR lpszOutputMovieFileName = _T("Output.avi"),
                
int nFrameWidth = GetSystemMetrics(SM_CXSCREEN),  /*Movie Frame Width*/
                
int nFrameHeight = GetSystemMetrics(SM_CYSCREEN), /*Movie Frame Height*/
                
int nBitsPerPixel = 32,     /*Bits per Pixel*/
                DWORD dwCodec 
= mmioFOURCC('M','P','G','4'),  /*Video Codec for Compression*/
                DWORD dwFrameRate 
= 1)      /*Frame Rate (FPS) setting for the Movie*/
鐒惰?搴旇娉ㄦ剰鍒扮殑鏄?榪欐槸涓涓椂闂磋緗紝鍚庢潵鍦ㄧ數(shù)褰辮褰曟椂鍊欎笉鑳芥敼鍙?nbsp;銆傛瘡涓狢DxToMovie瀵瑰簲涓涓笉鍚岀殑鐢?shù)濯勬枃錃g鍜屽啀閫犱竴涓狢DxToMovie瀵硅薄鍏鋒湁鐩稿悓鐨勮緭鍑烘枃浠剁殑鍚嶅瓧涓嶄細(xì)榪藉姞浠ュ墠鐨勭數(shù)褰卞唴瀹?灝嗚鐩栧畠銆?
CDxToMovie g_MovieRecorder("Output.Avi", 320, 240);
    涓鏃﹀垱寤篊DxToMovie瀵硅薄錛屾柟娉旵DxToMovie::OnCreateDevice()鍦ㄤ綘鐨勭▼搴廌irect3D璁懼鍒涘緩鐨勬椂鍊欎細(xì)琚皟鐢ㄣ傜被浼肩殑錛孋DxToMovie::OnLostDevice(),CDxToMovie::OnResetDevice()鍜孋DxToMovie::OnDestroyDevice()涔熶細(xì)鍦ㄨ澶囦涪澶遍攢姣佺殑鏃跺欏悇鑷璋冪敤銆傝繖浜涘嚱鏁扮殑鍘熷瀷鏄劇ず濡備笅
class CDxToMovie
{
HRESULT OnCreateDevice(LPDIRECT3DDEVICE9 pd3dDevice);
HRESULT OnDestroyDevice(LPDIRECT3DDEVICE9 pd3dDevice);
HRESULT OnLostDevice();
HRESULT OnResetDevice(LPDIRECT3DDEVICE9 pd3dDevice,
const D3DSURFACE_DESC* pBackBufferSurfaceDesc);
}
;
鍑芥暟OnCreateDevice()鍜孫nDestroyDevice()鎺ュ彈涓涓崟鍗曞弬鏁幫紝鎸囧悜浣犵▼搴忕殑Direct3D璁懼瀵硅薄銆侽nLostDevice()娌℃湁鍙傛暟錛屼絾鏄疧nResetDevice()榪樿鏈変竴涓寚閽堟寚鍚戜綘璁懼鐨勫悗緙撳啿鍖鴻〃闈?D3DSURFACE_DESC*銆侰DxToMovie瀵硅薄鎻愪緵涓浜涗俊鎭湪D3DSURFACE_DESC閲?鍒涢犱竴涓悎閫傜殑offscreen娓叉煋鐩爣,鍙互鐢ㄦ潵璁板綍浣犵殑搴旂敤紼嬪簭鐨勬覆鏌撱?br />鐪熸璁板綍鐨勫姛鑳芥槸閫氳繃鍑芥暟CDxToMovie::StartRecordingMovie()鍜孋DxToMovie::PauseRecordingMovie().榪欎袱涓嚱鏁板繀欏繪瘡涓甯ч兘瑕佸湪IDirect3DDevice9::BeginScene() 鍜?IDirect3DDevice9::EndScene()涔嬮棿銆傚涓嬫墍紺?
g_pd3dDevice->BeginScene();

    
// Capture the Rendering onto CDxToMovie's Render Target
    g_MovieRecorder.StartRecordingMovie(g_pd3dDevice);
        
// Render as usual..    
        g_pd3dDevice->Clear(0,NULL,D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0,0,200),1,0);
        g_pd3dDevice
->SetStreamSource(0,g_pVB,0,sizeof(CUSTOMVERTEX));
        g_pd3dDevice
->SetFVF(D3DFVF_CUSTOMVERTEX);
        g_pd3dDevice
->DrawPrimitive(D3DPT_TRIANGLELIST,0,1);
    g_MovieRecorder.PauseRecordingMovie(g_pd3dDevice);

    
// Copy the CDxToMovie's Render Target content back onto BackBuffer's Surface
    g_pd3dDevice->StretchRect(g_MovieRecorder.RecordingSurface(),
                              NULL,pBackSurface,
                              
0,D3DTEXF_NONE);

    g_pd3dDevice
->EndScene();
鍦ㄤ笂闈㈢殑浠g爜孌典腑錛?nbsp;g_MovieRecorder.StartRecordingMovie(g_pd3dDevice)灝嗘墍鏈夐殢鍚庣殑娓叉煋鍦–DxToMovie鐨勫唴閮ㄦ覆鏌撶洰鏍囩洿鍒?font face="Courier New">g_MovieRecorder.PauseRecordingMovie(g_pd3dDevice)琚皟鐢ㄣ傛墍鏈夌殑娓叉煋宸ヤ綔鍦–DxToMovie鐨勫唴閮ㄦ覆鏌撶洰鏍囦笂鍋氾紝浣犵殑紼嬪簭back surface灝嗘病鏈変換浣曟湁鏁堢殑鍐呭鏄劇ず鍦ㄤ綘鐨勫簲鐢ㄧ▼搴忕獥鍙c傝繖涓嶈绱?濡傛灉浣犵殑鐢寵涓嶅彧鏄垱浣滆繖閮ㄧ數(shù)褰辨病鏈変換浣曞姩鐢葷洿鎺ュ憟鐜板湪灞忓箷涓娿傜劧鑰?濡傛灉浣犺褰曠數(shù)褰變粠涓涓簰鍔ㄦ父鎴忎細(xì)璇濅笂,瀹冧細(xì)鍙樺潖灞忓箷涓嶆洿鏂板埌鏈鏂扮殑娓叉煋鐨勫唴瀹?鍥犱負(fù)閫氳繃閲嶆柊娓叉煋鐩爣錛孋DxToMovie鍐呭琚伔浜?銆備負(fù)浜嗛伩鍏嶅畠,浣犲彲浠ラ夋嫨鎬у湴澶嶅埗鍥濩DxToMovie鍐呴儴鐨勬覆鏌撶洰鏍囩殑鍐呭鍒頒綘鐨勫簲鐢ㄧ▼搴忕殑back surface 浣跨敤鏂規(guī)硶IDirect3DDevice9:StretchRect(),鍏舵鏄父瑙佺殑g_pd3dDevice - > EndScene()鍜実_pd3dDevice - >Present()鐨勮姹備細(xì)鏇存柊鍐呭鐨勫憟鐜板湪灞忓箷涓婅儗緙撳啿鍖?浣垮睆騫曚笂鏇存柊銆?br />濡傛灉浣犳兂閬垮厤涓浜涘撫琚夋嫨鎬ц褰曞湪榪欓儴鐢?shù)濯?鍙槸涓嶈鍙玤_MovieRecorder.StartRecordingMovie鍜実_MovieRecorder.PauseRecordingMovie()(鐩稿簲鐨?g_pd3dDevice - > StretchRect())瀵歸偅浜涘撫,騫朵細(xì)鐩存帴娓叉煋鍔ㄧ敾鍦ㄥ睆騫曚笂(娌℃湁琚噸瀹氬悜鍒癈DxToMovie鍐呴儴鐨勬覆鏌撶洰鏍?銆?br />婕旂ず浠g爜鎻愪緵榪欎釜欏圭洰鎻愪緵浜嗕竴涓畝鍗曠殑搴旂敤紼嬪簭,浣垮緱DirectX灞忓箷涓婄殑涓涓笁瑙掑艦鐨勫姩浣?榧犳爣縐誨姩紿楁埛涓?榪欏皢simulatenously琚覆鏌撴垚鐢?shù)濯勬枃錃g鍜岃褰?鍚嶅彨output.avi)銆傝窇婕旂ず鐨勫彲鎵ц紼嬪簭,紜繚浣犳湁MPG4緙栬В鐮佸櫒鐨勮綆楁満涓婂畨瑁?鐩綍鏈夊啓鏉冮檺鍘誨垱寤鴻緭鍑虹數(shù)褰辨枃浠躲傝鎯呰璁劇疆瑙g爜鍣ㄥ拰騫寵 ,璇峰弬鑰冭繖綃囨枃绔?a >Create Movie from HBitmap

Recording a Movie from OpenGL Rendered Sequence
鍏堟殏鏃朵笉緲昏瘧浜嗭紝浠ュ悗鍐嶇炕銆?br />
娉細(xì)絎竴嬈$炕璇戯紝姘村鉤姣旇緝宸紝榪樻湜鍚勪綅鐪嬪瑙佽皡銆?br />Reference錛?nbsp;Recording DirectX and OpenGL Rendered Animations

Daywei 2012-04-28 15:08 鍙戣〃璇勮
]]>
鍏充簬DirectX浣跨敤鐨勪竴浜涙敞鎰忎簨欏?/title><link>http://www.shnenglu.com/Daywei0123/archive/2012/02/16/165746.html</link><dc:creator>Daywei</dc:creator><author>Daywei</author><pubDate>Thu, 16 Feb 2012 07:24:00 GMT</pubDate><guid>http://www.shnenglu.com/Daywei0123/archive/2012/02/16/165746.html</guid><wfw:comment>http://www.shnenglu.com/Daywei0123/comments/165746.html</wfw:comment><comments>http://www.shnenglu.com/Daywei0123/archive/2012/02/16/165746.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/Daywei0123/comments/commentRss/165746.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/Daywei0123/services/trackbacks/165746.html</trackback:ping><description><![CDATA[<div>1.鍏充簬鍒涘緩Direct3D璁懼瀵硅薄<br />   鍒涘緩Direct3D璁懼瀵硅薄鏃訛紝闇瑕佸厛鍒涘緩Direct3D瀵硅薄錛岀劧鍚庡啀璋冪敤Direct3D瀵硅薄鐨勬帴鍙e嚱鏁癐Direct3D9錛氾細(xì)CreateDevice鍒涘緩Direct3D璁懼瀵硅薄銆傞氳繃鍚屼竴涓狣irect3D瀵硅薄鍒涘緩鐨勬墍鏈塂irect3D璁懼瀵硅薄鍏變韓鐩稿悓鐨勭墿鐞嗚祫婧愶紙鏄懼崱錛夈傚洜涓哄叡浜悓涓紜歡錛屾墍浠ュ鏋滈氳繃涓涓狣irect3D瀵硅薄鍒涘緩澶氫釜Direct3D娓叉煋璁懼瀵硅薄浼?xì)鏄庢橓N檷浣庣郴緇熸ц兘銆?br />   鍦ㄥ垱寤篋irect3D璁懼瀵硅薄涔嬪墠錛岃繕闇瑕佸厛鍒濆鍖朌3DPRESENT_PARAMENTERS緇撴瀯錛岃緇撴瀯鐢ㄤ簬鍒涘緩Direct3D璁懼瀵硅薄銆傛緇撴瀯灝嗕細(xì)褰卞搷Direct3D璁懼鐨勬樉紺烘柟娉曘?br />       <h1>D3DPRESENT_PARAMETERS</h1> <p>Describes the presentation parameters.</p><pre class="syntax">typedef struct D3DPRESENT_PARAMETERS { UINT BackBufferWidth, BackBufferHeight; D3DFORMAT BackBufferFormat; UINT BackBufferCount; D3DMULTISAMPLE_TYPE MultiSampleType; DWORD MultiSampleQuality; D3DSWAPEFFECT SwapEffect; HWND hDeviceWindow; BOOL Windowed; BOOL EnableAutoDepthStencil; D3DFORMAT AutoDepthStencilFormat; DWORD Flags; UINT FullScreen_RefreshRateInHz; UINT PresentationInterval; } D3DPRESENT_PARAMETERS, *LPD3DPRESENT_PARAMETERS;</pre> <h4><a name="members"></a>Members</h4> <dl> <dt><strong>BackBufferWidth, BackBufferHeight</strong> <dd>Width and height of the new swap chain's back buffers, in pixels. If Windowed is FALSE (the presentation is full-screen), these values must equal the width and height of one of the enumerated display modes found through <a href="mk:@MSITStore:C:\Program%20Files\Microsoft%20DirectX%20SDK%20(February%202010)\Documentation\DirectX9\windows_graphics.chm::/IDirect3D9__EnumAdapterModes.htm">IDirect3D9::EnumAdapterModes</a>. If Windowed is TRUE and either of these values is zero, the corresponding dimension of the client area of the hDeviceWindow (or the focus window, if hDeviceWindow is NULL) is taken. <dt><strong>BackBufferFormat</strong> <dd>The back buffer format. For more information about formats, see <a href="mk:@MSITStore:C:\Program%20Files\Microsoft%20DirectX%20SDK%20(February%202010)\Documentation\DirectX9\windows_graphics.chm::/D3DFORMAT.htm">D3DFORMAT</a>. This value must be one of the render-target formats as validated by <a href="mk:@MSITStore:C:\Program%20Files\Microsoft%20DirectX%20SDK%20(February%202010)\Documentation\DirectX9\windows_graphics.chm::/IDirect3D9__CheckDeviceType.htm">IDirect3D9::CheckDeviceType</a>. You can use <a href="mk:@MSITStore:C:\Program%20Files\Microsoft%20DirectX%20SDK%20(February%202010)\Documentation\DirectX9\windows_graphics.chm::/IDirect3DDevice9__Getdisplaymode.htm">IDirect3DDevice9::GetDisplayMode</a> to obtain the current format. <p>In fact, D3DFMT_UNKNOWN can be specified for the BackBufferFormat while in windowed mode. This tells the runtime to use the current display-mode format and eliminates the need to call <strong>IDirect3DDevice9::GetDisplayMode</strong>.</p> <p>For windowed applications, the back buffer format no longer needs to match the display-mode format because color conversion can now be done by the hardware (if the hardware supports color conversion). The set of possible back buffer formats is constrained, but the runtime will allow any valid back buffer format to be presented to any desktop format. (There is the additional requirement that the device be operable in the desktop mode; devices typically do not operate in 8 bits per pixel modes.)</p> <p>Full-screen applications cannot do color conversion.</p> <dt><strong>BackBufferCount</strong> <dd>This value can be between 0 and <a href="mk:@MSITStore:C:\Program%20Files\Microsoft%20DirectX%20SDK%20(February%202010)\Documentation\DirectX9\windows_graphics.chm::/D3DPRESENT_BACK_BUFFERS.htm">D3DPRESENT_BACK_BUFFERS_MAX</a> (or <a href="mk:@MSITStore:C:\Program%20Files\Microsoft%20DirectX%20SDK%20(February%202010)\Documentation\DirectX9\windows_graphics.chm::/D3DPRESENT_BACK_BUFFERS.htm">D3DPRESENT_BACK_BUFFERS_MAX_EX</a> when using Direct3D 9Ex). Values of 0 are treated as 1. If the number of back buffers cannot be created, the runtime will fail the method call and fill this value with the number of back buffers that could be created. As a result, an application can call the method twice with the same D3DPRESENT_PARAMETERS structure and expect it to work the second time. <p>The method fails if one back buffer cannot be created. The value of BackBufferCount influences what set of swap effects are allowed. Specifically, any D3DSWAPEFFECT_COPY swap effect requires that there be exactly one back buffer.</p> <dt><strong>MultiSampleType</strong> <dd>Member of the <a href="mk:@MSITStore:C:\Program%20Files\Microsoft%20DirectX%20SDK%20(February%202010)\Documentation\DirectX9\windows_graphics.chm::/d3dmultisample_type.htm">D3DMULTISAMPLE_TYPE</a> enumerated type. The value must be D3DMULTISAMPLE_NONE unless SwapEffect has been set to D3DSWAPEFFECT_DISCARD. Multisampling is supported only if the swap effect is D3DSWAPEFFECT_DISCARD. <dt><strong>MultiSampleQuality</strong> <dd>Quality level. The valid range is between zero and one less than the level returned by pQualityLevels used by <a href="mk:@MSITStore:C:\Program%20Files\Microsoft%20DirectX%20SDK%20(February%202010)\Documentation\DirectX9\windows_graphics.chm::/IDirect3D9__CheckDeviceMultiSampleType.htm">IDirect3D9::CheckDeviceMultiSampleType</a>. Passing a larger value returns the error D3DERR_INVALIDCALL. Paired values of render targets or of depth stencil surfaces and <strong>D3DMULTISAMPLE_TYPE</strong> must match. <dt><strong>SwapEffect</strong> <dd>Member of the <a href="mk:@MSITStore:C:\Program%20Files\Microsoft%20DirectX%20SDK%20(February%202010)\Documentation\DirectX9\windows_graphics.chm::/D3DSWAPEFFECT.htm">D3DSWAPEFFECT</a> enumerated type. The runtime will guarantee the implied semantics concerning buffer swap behavior; therefore, if Windowed is TRUE and SwapEffect is set to D3DSWAPEFFECT_FLIP, the runtime will create one extra back buffer and copy whichever becomes the front buffer at presentation time. <p>D3DSWAPEFFECT_COPY requires that BackBufferCount be set to 1.</p> <p>D3DSWAPEFFECT_DISCARD will be enforced in the debug runtime by filling any buffer with noise after it is presented.</p> <table> <tbody> <tr> <td> <p>Differences between Direct3D9 and Direct3D9Ex</p> <p>In Direct3D9Ex, D3DSWAPEFFECT_FLIPEX is added to designate when an application is adopting flip mode. That is, whan an application's frame is passed in window's mode (instead of copied) to the Desktop Window Manager(DWM) for composition. Flip mode provides more efficient memory bandwidth and enables an application to take advantage of full-screen-present statistics. It does not change full screen behavior. Flip mode behavior is available beginning with Windows 7.</p></td></tr></tbody></table> <dt><strong>hDeviceWindow</strong> <dd>The device window determines the location and size of the back buffer on screen. This is used by Direct3D when the back buffer contents are copied to the front buffer during <a href="mk:@MSITStore:C:\Program%20Files\Microsoft%20DirectX%20SDK%20(February%202010)\Documentation\DirectX9\windows_graphics.chm::/IDirect3DDevice9__Present.htm">IDirect3DDevice9::Present</a>. <ul><li> <p>For a full-screen application, this is a handle to the top window (which is the focus window). </p> <p>For applications that use multiple full-screen devices (such as a multimonitor system), exactly one device can use the focus window as the device window. All other devices must have unique device windows.</p></li><li>For a windowed-mode application, this handle will be the default target window for <strong>IDirect3DDevice9::Present</strong>. If this handle is NULL, the focus window will be taken. </li></ul> <p>Note that no attempt is made by the runtime to reflect user changes in window size. The back buffer is not implicitly reset when this window is reset. However, the <strong>IDirect3DDevice9::Present</strong> method does automatically track window position changes.</p> <dt><strong>Windowed</strong> <dd>TRUE if the application runs windowed; FALSE if the application runs full-screen. <dt><strong>EnableAutoDepthStencil</strong> <dd>If this value is TRUE, Direct3D will manage depth buffers for the application. The device will create a depth-stencil buffer when it is created. The depth-stencil buffer will be automatically set as the render target of the device. When the device is reset, the depth-stencil buffer will be automatically destroyed and recreated in the new size. <p>If EnableAutoDepthStencil is TRUE, then AutoDepthStencilFormat must be a valid depth-stencil format.</p> <dt><strong>AutoDepthStencilFormat</strong> <dd>Member of the <strong>D3DFORMAT</strong> enumerated type. The format of the automatic depth-stencil surface that the device will create. This member is ignored unless EnableAutoDepthStencil is TRUE. <dt><strong>Flags</strong> <dd>One of the <a href="mk:@MSITStore:C:\Program%20Files\Microsoft%20DirectX%20SDK%20(February%202010)\Documentation\DirectX9\windows_graphics.chm::/D3DPRESENTFLAG.htm">D3DPRESENTFLAG</a> constants. <dt><strong>FullScreen_RefreshRateInHz</strong> <dd>The rate at which the display adapter refreshes the screen. The value depends on the mode in which the application is running: <ul><li>For windowed mode, the refresh rate must be 0.</li><li>For full-screen mode, the refresh rate is one of the refresh rates returned by <strong>IDirect3D9::EnumAdapterModes</strong>. </li></ul> <dt><strong>PresentationInterval</strong> <dd>The maximum rate at which the swap chain's back buffers can be presented to the front buffer. For a detailed explanation of the modes and the intervals that are supported, see <a href="mk:@MSITStore:C:\Program%20Files\Microsoft%20DirectX%20SDK%20(February%202010)\Documentation\DirectX9\windows_graphics.chm::/D3DPRESENT.htm">D3DPRESENT</a>. </dd></dl> <h4><a name="requirements"></a>Requirements</h4> <p class="clsInfo"><strong>Header: </strong>Declared in D3D9Types.h. <br />      鍑犱釜閲嶈鐨勫弬鏁板姞浠ヨВ閲婅鏄庝竴涓嬶紝鍏朵腑BackBufferWidth鍜孊ackBufferHeight鎸囧畾鍚庡彴緙撳瓨鍖虹殑瀹介珮錛堜互鍍忕礌涓哄崟浣嶏級銆傚鏋滃浘褰互紿楀彛鏂瑰紡鏄劇ず騫朵笖璇ユ垚鍛樺彉閲忚璁劇疆涓?錛屽垯緋葷粺鑷姩浣跨敤鏄劇ず紿楀彛瀹㈡埛鍖虹殑瀹介珮浣滀負(fù)鍚庡彴緙撳啿鍖虹殑瀹介珮銆侭ackBufferCount鎸囧畾鍚庡彴緙撳啿鍖虹殑鏁伴噺銆傝鍊煎彲浠ヤ負(fù)0銆?銆?銆?錛屽叾涓?鍜?鏃墮兘琛ㄧず鍒涘緩涓涓悗鍙扮紦鍐插尯銆傞氬父浣跨敤涓涓悗鍙扮紦鍐插尯鍜屼竴涓富緙撳瓨錛屼富緙撳瓨灝嗗叾鏄劇ず鍦ㄥ睆騫曚笂銆?br /></p></div><img src ="http://www.shnenglu.com/Daywei0123/aggbug/165746.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/Daywei0123/" target="_blank">Daywei</a> 2012-02-16 15:24 <a href="http://www.shnenglu.com/Daywei0123/archive/2012/02/16/165746.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍏充簬Direct2D浣跨敤鐨勯棶棰?/title><link>http://www.shnenglu.com/Daywei0123/archive/2012/01/30/164689.html</link><dc:creator>Daywei</dc:creator><author>Daywei</author><pubDate>Mon, 30 Jan 2012 09:13:00 GMT</pubDate><guid>http://www.shnenglu.com/Daywei0123/archive/2012/01/30/164689.html</guid><wfw:comment>http://www.shnenglu.com/Daywei0123/comments/164689.html</wfw:comment><comments>http://www.shnenglu.com/Daywei0123/archive/2012/01/30/164689.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/Daywei0123/comments/commentRss/164689.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/Daywei0123/services/trackbacks/164689.html</trackback:ping><description><![CDATA[       榪欎袱澶╄冭檻鎶奃irectX 鐗堟湰鍗囩駭錛屽悓鏃舵妸鐩稿叧鐨勫姛鑳戒篃鍗囩駭錛屾瘮濡傜敾鍥撅紝涔嬪墠鐢ㄧ殑鏄疍irectDraw姣旇緝鑰侊紝鐜板湪鎯蟲敼鐢―irect2D銆?br />      Direct2D鏄疍irectX11涓殑鏂扮壒鎬э紝鍙互璇存槸DirectDraw鐨勫崌綰х増銆侱irectX鏈鏂扮増鏈?a >http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=6812</a>錛屽綋鐒惰鎯充嬌鐢―irectX11闇瑕佺郴緇熸敮鎸侊紝win7涓氨宸插甫DirectX11錛岃寁ista涓嬌鐢ㄥ氨闇瑕乁pdate錛屼互涓嬫潵鑷狹SDN鏂囨。<br />      <strong>Direct3D 11 Runtime<br /><br /></strong>To obtain the Direct3D 11 runtime, please install the release version of Windows 7 or Windows Server 2008 R2. Windows Vista users can follow the procedure described in <a >KB 971644</a> (or <a >KB 971512</a> for corporate network users). <br /><br /><a >http://support.microsoft.com/kb/971644</a><br /><br />鍏蜂綋濡備綍鍘誨疄鐜頒竴涓狣irectX2D Application  鍙傝DirectX 2010.6 鐗堟湰涓璖DK鏂囨。——Windows DirectX Graphics Documention——Direct2D<br /><br />Direct2D鍏ラ棬錛?a >http://blog.pfan.cn/lym51/52200.html</a><br />浣跨敤Direct2D緇樺浘<a >http://msdn.microsoft.com/zh-cn/magazine/ee413543.aspx</a><img src ="http://www.shnenglu.com/Daywei0123/aggbug/164689.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/Daywei0123/" target="_blank">Daywei</a> 2012-01-30 17:13 <a href="http://www.shnenglu.com/Daywei0123/archive/2012/01/30/164689.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>濡備綍浠嶥irectX涓幏鍙栧浘鍍?/title><link>http://www.shnenglu.com/Daywei0123/archive/2011/12/23/162678.html</link><dc:creator>Daywei</dc:creator><author>Daywei</author><pubDate>Fri, 23 Dec 2011 09:45:00 GMT</pubDate><guid>http://www.shnenglu.com/Daywei0123/archive/2011/12/23/162678.html</guid><wfw:comment>http://www.shnenglu.com/Daywei0123/comments/162678.html</wfw:comment><comments>http://www.shnenglu.com/Daywei0123/archive/2011/12/23/162678.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/Daywei0123/comments/commentRss/162678.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/Daywei0123/services/trackbacks/162678.html</trackback:ping><description><![CDATA[<div style="padding-bottom: 0px; overflow-y: auto; background-color: rgb(255,255,255); margin: 5px; padding-left: 0px; padding-right: 0px; font-family: Arial, Verdana, sans-serif; word-wrap: break-word; font-size: 12px; padding-top: 0px"> <p style="padding-bottom: 2px; margin: 4px 0px; padding-left: 0px; padding-right: 0px; padding-top: 2px"><pre style="background-color: rgb(240,240,240); margin: 4px 0px" class="cpp" name="code"><br class="Apple-interchange-newline" />BOOL CD3DCameraViewWnd::GetImageInfo(DWORD* pPixelBuffer, int& width,int& height) { BOOL result = FALSE; IDirect3DSurface9 *_surfaceback = NULL; if (FAILED(m_pDevice->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &_surfaceback))) { result = FALSE; } D3DSURFACE_DESC surfaceDesc; if (!FAILED(_surfaceback->GetDesc(&surfaceDesc))) { width = surfaceDesc.Width; height = surfaceDesc.Height; } D3DLOCKED_RECT lockedRect; HRESULT hr = _surfaceback->LockRect( &lockedRect,0, 0); /* pointer to receive locked data鎸囧悜鐢寵鍒扮殑鍐呭瓨鍖哄煙*/ /* lock entire surface*/// no lock flags specified if (!FAILED(hr)) { pPixelBuffer = (DWORD*)lockedRect.pBits; result = TRUE; } _surfaceback->UnlockRect(); _surfaceback->Release(); return result; }</pre> <p style="padding-bottom: 2px; margin: 4px 0px; padding-left: 0px; padding-right: 0px; padding-top: 2px"><br /></p>浣嗘槸榪欐牱瀛樺湪鐫鎬ц兘鐨勯棶棰橈紝緇忔祴璇曡幏鍙栦竴甯ч渶瑕?00ms宸﹀彸錛屼負(fù)浠涔堜細(xì)瀛樺湪榪欐牱鐨勯棶棰橈紵鍥犱負(fù)榪欒竟鏈夎祫婧愰攣瀹氭搷浣溿? <p> </p> <p style="padding-bottom: 2px; margin: 4px 0px; padding-left: 0px; padding-right: 0px; padding-top: 2px"> <p style="padding-bottom: 2px; margin: 4px 0px; padding-left: 0px; padding-right: 0px; padding-top: 2px">鐜板湪鍏抽敭鐨勯棶棰樺氨鍦ㄤ簬,璧勬簮閿佸畾鐨勬搷浣滈熷害鎬繪槸闈炲父涔嬫參.褰撶劧,浣犱細(xì)璺熸垜鎻? OpenGL浼間箮鑳藉蹇嵎鍦板畬鎴愯繖欏逛換鍔?浣嗘槸,鍦―irect3D涓?璧勬簮閿佸畾鎿嶄綔紜疄鏄緢鎱㈢殑.榪欓噷闈竴涓富瑕佺殑鍘熷洜鏄?API,椹卞姩,浠ュ強(qiáng)紜歡瑕佸鐞嗕竴浜涗笉鍙洖閬跨殑鍚庡彴鎿嶄綔.閭e氨鏄疓PU涓嶤PU鏄茍琛岃繍琛岀殑,鑻ヤ笉鍔犱換浣曟帾鏂?灝嗗紩璧風(fēng)被浼煎綰跨▼紼嬪簭鍚屾鏃剁殑绔炴佹潯浠剁殑闂.</p> <p style="padding-bottom: 2px; margin: 4px 0px; padding-left: 0px; padding-right: 0px; padding-top: 2px">濡傛灉浣犺瘯鍥懼幓淇敼鐨勮祫婧愭鍚屾椂琚竴涓綅浜嶨PU澶勭悊搴忓垪涓殑鎸囦護(hù)浣跨敤,閭d箞鏁翠釜娓叉煋嫻佺▼灝變細(xì)鍥犱負(fù)浣犵殑璧勬簮閿佸畾鑰屽仠欏挎垨寮哄埗鍒鋒柊(stalls and flushes).鍋滈】(stall)浼?xì)涓鐩存寔緇埌浣犲畬鎴愪簡瀵硅祫婧愮殑淇敼騫惰皟鐢║nlock().鑰屽己鍒跺埛鏂?flush)鍒欎細(xì)瑕佹眰GPU鍦ㄤ綘寰楀埌榪欎釜璧勬簮鐨勮闂潈涔嬪墠瀹屾垚鐩墠鎵鏈夌殑浠誨姟.</p> <p style="padding-bottom: 2px; margin: 4px 0px; padding-left: 0px; padding-right: 0px; padding-top: 2px">濡備綍鍘昏В鍐寵繖涓棶棰橈紵涓嬮潰鐨勫弬鑰冭祫鏂欎腑鏈変竴浜涜В鍐蟲柟妗堬紝鎴戞病鏈夌粡榪囪鐪熸祴璇曪紝鎴戣瘯浜嗗叾涓竴涓狦etRenderTargetData 榪欐牱鐨勪竴縐嶆柟娉?錛屾劅瑙変笉澶ソ鐢紝why璇風(fēng)湅Reference3</p> <p style="padding-bottom: 2px; margin: 4px 0px; padding-left: 0px; padding-right: 0px; padding-top: 2px"><br /></p> <p style="padding-bottom: 2px; margin: 4px 0px; padding-left: 0px; padding-right: 0px; padding-top: 2px">涓嬮潰緇欏嚭鎴戠殑瑙e喅鏂規(guī)</p> <p style="padding-bottom: 2px; margin: 4px 0px; padding-left: 0px; padding-right: 0px; padding-top: 2px"><pre style="background-color: rgb(240,240,240); margin: 4px 0px" class="cpp" name="code">BOOL CD3DCameraViewWnd::GetImageInfo(DWORD* pPixelBuffer, int& width,int& height) { BOOL result = FALSE; IDirect3DSurface9 *_surfaceback = NULL; if (FAILED(m_pDevice->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &_surfaceback))) { result = FALSE; } D3DSURFACE_DESC surfaceDesc; if (!FAILED(_surfaceback->GetDesc(&surfaceDesc))) { width = surfaceDesc.Width; height = surfaceDesc.Height; }</pre><pre style="background-color: rgb(240,240,240); margin: 4px 0px" class="cpp" name="code"><br /></pre><pre style="background-color: rgb(240,240,240); margin: 4px 0px" class="cpp" name="code"><span style="white-space: pre" class="Apple-tab-span"> </span>LPDIREC3DSURFACE9 surf;</pre><pre style="background-color: rgb(240,240,240); margin: 4px 0px" class="cpp" name="code"><span style="white-space: pre" class="Apple-tab-span"> </span>if(FAILED(m_pDevice->CreateOffscreenPlainSurface(width, height,D3DFMT_A8R8G8B8,D3DPOOL_SYSTEMMEM, &surf,NULL)))</pre><pre style="background-color: rgb(240,240,240); margin: 4px 0px" class="cpp" name="code"><span style="white-space: pre" class="Apple-tab-span"> </span>{</pre><pre style="background-color: rgb(240,240,240); margin: 4px 0px" class="cpp" name="code"><span style="white-space: pre" class="Apple-tab-span"> </span>result = FALSE;</pre><pre style="background-color: rgb(240,240,240); margin: 4px 0px" class="cpp" name="code"><span style="white-space: pre" class="Apple-tab-span"> </span>}</pre><pre style="background-color: rgb(240,240,240); margin: 4px 0px" class="cpp" name="code"><span style="white-space: pre" class="Apple-tab-span"> </span>D3DXLoadSurfaceFromSurface(surf, NULL,NULL,_surfaceback,NULL,NULL,D3DX_FILTER_NONE,0); D3DLOCKED_RECT lockedRect; HRESULT hr = surf->LockRect( &lockedRect,0, 0); /* pointer to receive locked data鎸囧悜鐢寵鍒扮殑鍐呭瓨鍖哄煙*/ /* lock entire surface*/// no lock flags specified if (!FAILED(hr)) { pPixelBuffer = (DWORD*)lockedRect.pBits; result = TRUE; } surf->UnlockRect();</pre><pre style="background-color: rgb(240,240,240); margin: 4px 0px" class="cpp" name="code"><pre style="background-color: rgb(240,240,240); margin: 4px 0px" class="cpp" name="code"><span style="white-space: pre" class="Apple-tab-span"> </span>surf->Release();</pre> _surfaceback->Release(); return result; }</pre><br /><br /> <p> </p><br /> <p> </p> <p style="padding-bottom: 2px; margin: 4px 0px; padding-left: 0px; padding-right: 0px; padding-top: 2px">鍙傝冭祫鏂欙細(xì)Reference1.http://www.cnblogs.com/mixiyou/archive/2010/02/25/1673060.html</p> <p style="padding-bottom: 2px; margin: 4px 0px; padding-left: 0px; padding-right: 0px; padding-top: 2px"><span style="white-space: pre" class="Apple-tab-span"></span>   Reference<span id="tztlzjd" class="Apple-converted-space"> </span>2.http://www.cnblogs.com/mixiyou/archive/2010/02/25/1673425.html</p> <p style="padding-bottom: 2px; margin: 4px 0px; padding-left: 0px; padding-right: 0px; padding-top: 2px"><span style="white-space: pre" class="Apple-tab-span"></span>   Reference 3.<a _xhe_>http://blog.csdn.net/Nightmare/article/details/1707362</a></p> <p style="padding-bottom: 2px; margin: 4px 0px; padding-left: 0px; padding-right: 0px; padding-top: 2px"><span style="white-space: pre" class="Apple-tab-span"></span>   Reference 4.<a _xhe_>http://www.cnblogs.com/lancidie/archive/2011/3/14.html</a><br /></p></div> <img src ="http://www.shnenglu.com/Daywei0123/aggbug/162678.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/Daywei0123/" target="_blank">Daywei</a> 2011-12-23 17:45 <a href="http://www.shnenglu.com/Daywei0123/archive/2011/12/23/162678.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://www.shnenglu.com/" title="精品视频久久久久">精品视频久久久久</a> <div class="friend-links"> </div> </div> </footer> <a href="http://www.leaow.cn" target="_blank">久久国产精品无码网站</a>| <a href="http://www.longfee.cn" target="_blank">久久精品二区</a>| <a href="http://www.webfi.cn" target="_blank">国产精品美女久久久久久2018</a>| <a href="http://www.021cp.cn" target="_blank">久久久久人妻精品一区二区三区 </a>| <a href="http://www.vtqqv.cn" target="_blank">国内精品久久国产大陆</a>| <a href="http://www.six-dream.cn" target="_blank">久久亚洲欧美日本精品</a>| <a href="http://www.111net.org.cn" target="_blank">久久亚洲国产成人精品无码区</a>| <a href="http://www.52liansuo.com.cn" target="_blank">亚洲国产精品综合久久网络 </a>| <a href="http://www.navas.cn" target="_blank">99久久国产热无码精品免费久久久久</a>| <a href="http://www.pudlv.cn" target="_blank">99精品久久久久久久婷婷</a>| <a href="http://www.m20008.cn" target="_blank">国产精品久久久久a影院</a>| <a href="http://www.kwig.cn" target="_blank">99精品国产在热久久无毒不卡</a>| <a href="http://www.djz1000.cn" target="_blank">热久久国产欧美一区二区精品</a>| <a href="http://www.tfy8.cn" target="_blank">久久亚洲精品人成综合网</a>| <a href="http://www.wwcx.com.cn" target="_blank">久久久久久久综合日本</a>| <a href="http://www.zmlxs.cn" target="_blank">国产精品久久久久久影院 </a>| <a href="http://www.zgwlptw.cn" target="_blank">色婷婷久久久SWAG精品</a>| <a href="http://www.11649.cn" target="_blank">99久久精品国产高清一区二区</a>| <a href="http://www.lpnppddrppp.cn" target="_blank">久久黄色视频</a>| <a href="http://www.323r.cn" target="_blank">久久996热精品xxxx</a>| <a href="http://www.3second.cn" target="_blank">国产成人精品久久二区二区</a>| <a href="http://www.cizbuk.cn" target="_blank">国产成人无码精品久久久性色</a>| <a href="http://www.ebuxy.cn" target="_blank">精品久久综合1区2区3区激情 </a>| <a href="http://www.jvfl.cn" target="_blank">久久精品亚洲精品国产欧美</a>| <a href="http://www.z42195.cn" target="_blank">2021久久精品国产99国产精品</a>| <a href="http://www.y447.cn" target="_blank">无码任你躁久久久久久老妇App</a>| <a href="http://www.haoxiaoli.cn" target="_blank">久久99精品九九九久久婷婷</a>| <a href="http://www.91jay.cn" target="_blank">久久本道伊人久久</a>| <a href="http://www.d5430.cn" target="_blank">国产亚洲精品自在久久</a>| <a href="http://www.fzbn.net.cn" target="_blank">亚洲∧v久久久无码精品</a>| <a href="http://www.cc5ujj.cn" target="_blank">人妻无码精品久久亚瑟影视 </a>| <a href="http://www.3secshop.cn" target="_blank">国产麻豆精品久久一二三</a>| <a href="http://www.grayhound.cn" target="_blank">久久91精品国产91久</a>| <a href="http://www.fuxingjiguang.cn" target="_blank">久久高清一级毛片</a>| <a href="http://www.iysb.cn" target="_blank">久久久无码精品午夜</a>| <a href="http://www.maituogangwan.cn" target="_blank">久久青青国产</a>| <a href="http://www.freejavbt.cn" target="_blank">久久国产精品偷99</a>| <a href="http://www.o6uo86.cn" target="_blank">人妻精品久久久久中文字幕</a>| <a href="http://www.888su.cn" target="_blank">少妇久久久久久被弄到高潮</a>| <a href="http://www.haiyunfu.cn" target="_blank">久久91精品国产91</a>| <a href="http://www.danongyao.cn" target="_blank">中文字幕无码免费久久</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>