Jump to content
  • Advertisement
Sign in to follow this  
BloodLust666

Creating DX device error

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

what's wrong with this code?? i keep getting that messagebox that says it has an error... bool cGraphics::CreateDevice() { IDirect3DDevice9* Device; D3DPRESENT_PARAMETERS d3dpp; d3dpp.AutoDepthStencilFormat = D3DFMT_D24S8; d3dpp.BackBufferCount = 1; d3dpp.BackBufferFormat = D3DFMT_A8R8G8B8; d3dpp.BackBufferHeight = 600; d3dpp.BackBufferWidth = 800; d3dpp.EnableAutoDepthStencil = true; d3dpp.Flags = 0; d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT; d3dpp.hDeviceWindow = GetWindow(); d3dpp.MultiSampleQuality = 0; d3dpp.MultiSampleType = D3DMULTISAMPLE_NONE; d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; d3dpp.Windowed = false; if ((m_pD3d->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL/*m_DevType*/, GetWindow(), D3DCREATE_HARDWARE_VERTEXPROCESSING, &d3dpp, &Device)) == false) { MessageBox(0, "Error in cGraphics::CreateDevice()",0,0); return false; } return true; }

Share this post


Link to post
Share on other sites
Advertisement
If you read the Forum FAQ it has a section on debuggin DX apps, and it is absolutely wonderful at pointing the reasons behind problems like this. The debug runtime is your best friend.

Share this post


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

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!