Archived

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

INitializing D3D8 with full screen

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

Hey. I''ve just started tinkering around with Direct3D 8, but I can''t even get it initialized in full-screen. Windows mode is easy, because you can just use the current adaptor mode. Whenever I try to create a device using full-screen, my Create Device function always fails. Does anyone know what some common mistakes are? Here''s my parameters: D3DPRESENT_PARAMETERS d3dpp; ZeroMemory( &d3dpp, sizeof(d3dpp) ); d3dpp.Windowed = FALSE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD ; d3dpp.BackBufferFormat = D3DFMT_A8R8G8B8; d3dpp.BackBufferWidth = 800; d3dpp.BackBufferHeight = 600; d3dpp.BackBufferCount = 1; d3dpp.MultiSampleType = D3DMULTISAMPLE_2_SAMPLES; d3dpp.hDeviceWindow = hwnd; d3dpp.EnableAutoDepthStencil = TRUE; d3dpp.AutoDepthStencilFormat = D3DFMT_A8R8G8B8; d3dpp.Flags = D3DPRESENTFLAG_LOCKABLE_BACKBUFFER; d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT; d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT ; Is there any tuturials on initializing Direct3D? The SDK help sucks. -Forcas
"Elvis is alive. He is Barney the purple dinosaur. He is the pied piper that leads our children into the wages of sin and eternal damnation."

Share this post


Link to post
Share on other sites
Just go to http://nexe.gamedev.net and look at one of the first 2 tutorials and you will find the code needed for what you want to do.

Eric Wright o0Programmer0o
AcidRain Productions
http://www.acidrainproductions.com

Share this post


Link to post
Share on other sites
Try changing d3dpp.SwapEffect from D3DSWAPEFFECT_DISCARD to D3DSWAPEFFECT_FLIP. Another thing that I just spotted is instead of setting the back buffer and z-buffer format to a 32 bit format, try setting it to a 16 bit format instead.

Share this post


Link to post
Share on other sites
G''day!

There is nothing wrong with using DISCARD, it works very well. 32-bit is fine too.

I think the problem is your back buffer format. Very few cards support D3DFMT_A8R8G8B8, try using D3DFMT_X8R8G8B8.

Also I think you can''t set a lockable back buffer and multisample. I could be wrong and don''t have docs to check at the moment.


Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
your not using a correct depth stencil format
try D3DFMT_D16

Share this post


Link to post
Share on other sites