Sign in to follow this  
ryan20fun

Which piece of code is better ?

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 [i]Drunken Hyena[/i]
[code]
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 }
[/code]

and here is what i used to use

[code]
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;
}
[/code]

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this