• Advertisement
Sign in to follow this  

Which piece of code is better ?

This topic is 2474 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi Again :D.
but im kinda confused :blink: right now over selecting and checking if a BackBuffer Format is usable.

here is the code from Drunken Hyena

HRESULT hr; hr=d3d->CheckDeviceType(D3DADAPTER_DEFAULT,//Adapter D3DDEVTYPE_HAL, //DeviceType D3DFMT_R5G6B5, //DisplayFormat D3DFMT_R5G6B5, //BackBufferFormat false); //Windowed if(SUCCEEDED(hr)){ //This mode is valid }else{ //Either an error occurred or the mode is unavailable }


and here is what i used to use


HRESULT hr;

if( FAILED( hr = g_pD3D->CheckDeviceFormat( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
d3ddm.Format, D3DUSAGE_DEPTHSTENCIL,
D3DRTYPE_SURFACE, D3DFMT_UNKOWN ) ) )
{
if( hr == D3DERR_NOTAVAILABLE )
// POTENTIAL PROBLEM: We need at least a 16-bit z-buffer!
return;
}


and what can you kindly give pointers or code as to how you select a appropriete format ?
Thanks in Advance.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement