   Can't create directX device
  Hey everyoneI'm a noob to directX, so I really don't know what I'm doing. I tried compiling the sample source from my book and I get the error "Unable to create DirectX device". I'm assuming the problem is in here:// fill the presentation parameters structureD3DPRESENT_PARAMETERS d3dpp; ZeroMemory( &d3dpp, sizeof(d3dpp) );d3dpp.Windowed    = TRUE;d3dpp.SwapEffect  = D3DSWAPEFFECT_DISCARD;d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;d3dpp.BackBufferCount  = 1;d3dpp.BackBufferHeight = 480;d3dpp.BackBufferWidth  = 640;d3dpp.hDeviceWindow    = wndHandle;// create a default directx deviceif( FAILED( pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_REF, wndHandle,  D3DCREATE_SOFTWARE_VERTEXPROCESSING,  &d3dpp, &pd3dDevice ) ) ){   MessageBox(NULL, "Unable to create directX device", "ERROR", MB_OK);   return false;}What's going on? How do I fix this? Thank you,tlakEDIT: Cleaned up source code   
  My best guess would be something in the present parameters structure is not getting filled out correctly, or your computer just can't handle it, which is probably not the case since you have it set to run in the REF device, which works on almost all computers. I would try activating the DirectX debug mode. To do this, go the Control Panel, go to the DirectX tab, and then set the debug version from retail to debug. Then set debug output to the highest setting. Then, run your application under Visual Studio, and once the program is finished running their will be debugging information put out by DirectX on your Output tab. This should give you a clue on what is going wrong.   ;  I have dev-C++ on a comp w/512 mb vid card. If visual studio is free, can you please give me the url to the actual download page?Thank you,tlak   ;Quote:Original post by TLAK1001If visual studio is free, can you please give me the url to the actual download page?Thank you,tlakGet the express editions here. You can download whichever languages you plan on using. If you plan to write win32 apps (which I assume you are with directX), you will also need to download the Platform SDK. Use this guide to set them both up.   ;  Thank you very much sir guapoI installed visual as well as the sdk, but I couldn't even get the program to compile. After half an hour of moving directories and adding libraries, I gave up. I would like to stick with Dev-C++ if possible. Can I still debug my program with the SDK while running Dev-C++? Visual is just too much too fast for someone still trying to master the basics.Thanks,tlak   ;  Just kidding everyone!Somehow it works now. It must be because I didn't have the sdk installed at first. Anyway, thanks for all the help everyone.tlak   