Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

TheToad

The tortoise or the hare - I need some advice.

This topic is 5814 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

Howdy all, I have been steadily plodding along learning D3DX8 and have run into a situation. I have a PC at home and one at work. The one I use at home has a very nice new vid card. The one at work is old and stock vid card. When running my games at home I can create the device with D3DDEVTYPE_HAL and it works fine: r = pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWndTarget,D3DCREATE_SOFTWARE_VERTEXPROCESSING,&d3dpp, ppDevice ); when I try to run it at work it creates a fun memory exception and wont run so that I have to change it to D3DDEVTYPE_REF to get it to work: r = pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_REF, hWndTarget,D3DCREATE_SOFTWARE_VERTEXPROCESSING,&d3dpp, ppDevice ); IS THERE A CHECK I CAN MAKE BEFORE CREATING THE DEVICE THAT INDICATES WHICH I SHOULD USE? IF THERE IS A CHECK, CAN ANY OF YOU POINT ME IN THE RIGHT DIRECTION? thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
This may help:


  
d3dpp.Windowed = FALSE;
d3dpp.SwapEffect = D3DSWAPEFFECT_FLIP;
d3dpp.BackBufferWidth = m_Width;
d3dpp.BackBufferHeight = m_Height;
d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_ONE;

// Configure display format to use

if(m_BPP == 32)
{
Format = D3DFMT_X8R8G8B8;
AltFormat = D3DFMT_X8R8G8B8;
}
else if(m_BPP == 24)
{
Format = D3DFMT_R8G8B8;
AltFormat = D3DFMT_R8G8B8;
}
else if(m_BPP == 16)
{
Format = D3DFMT_R5G6B5;
AltFormat = D3DFMT_X1R5G5B5;
}
else if(m_BPP == 8)
{
Format = D3DFMT_P8;
AltFormat = D3DFMT_P8;
}

// Check for HAL device

if(CheckFormat(Format, FALSE, TRUE))
{
m_HAL = TRUE;
}
else
{
// Check for HAL device in alternate format

if(CheckFormat(AltFormat, FALSE, TRUE))
{
m_HAL = TRUE;
Format = AltFormat;
}
else
{
// Check for Emulation device

if(!CheckFormat(Format, FALSE, FALSE))
{
// Check for Emulation device in alternate format

if(!CheckFormat(AltFormat, FALSE, FALSE))
{
return(FALSE);
}
else
{
Format = AltFormat;
}
}
}
}

d3dpp.BackBufferFormat = Format;

// Create the Direct3D Device object

if(FAILED(m_pD3D->CreateDevice(D3DADAPTER_DEFAULT,
(m_HAL == TRUE) ? D3DDEVTYPE_HAL : D3DDEVTYPE_REF,
hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&d3dpp, &m_pD3DDevice)))
{
// Error

}



pan narrans
Study + Hard Work + Loud Profanity = Good Code

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!