Jump to content
  • Advertisement
Sign in to follow this  
BigBeginner

Is it stupid? Direct3D8 graphics init (windowed) doesn't works in 16 bit

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

Hi, this error is annoying. I can run the init on 32 bit color mode, but in 16 bit not. It dies at init steps: Windowed:= TRUE; BackBufferWidth:= WINDOWWIDTH BackBufferHeight:= WINDOWHEIGHT BackBufferCount:= 1; BackBufferFormat:= D3DFMT_A8R8G8B8; SwapEffect:= D3DSWAPEFFECT_DISCARD; hDeviceWindow:= MYWINDOWHANDLE Direct3D.CreateDevice (D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, InitedRec.hWindow, D3DCREATE_SOFTWARE_VERTEXPROCESSING, D3DInit, Device); So, its works on 32 bit color mode. Why do it make me angry?

Share this post


Link to post
Share on other sites
Advertisement
In 16-bit desktop mode, the backbuffer format of a windowed D3D application should be either R5G6B5 or X1R5G5B5, depending on which the desktop uses. You can use the validation methods of the D3D8 object to determine suitable formats for the backbuffer.

D3D9 doesn't have this particular limitation anymore, if the hardware supports image transfer between modes.

Share this post


Link to post
Share on other sites
In D3D8 the backbuffer of a windowed app must be equal to that of the desktop. In fullscreen it don't matter since it's not sharing the backbuffer. I bet your desktop is set to 32-bit [smile].


Edit: What language is that? VB?


D3DDISPLAYMODE D3DDM;
Direct3D.GetAdapterDisplayMode(D3DADAPTER_DEFAULT,&D3DDM);

Windowed:= TRUE;
BackBufferWidth:= WINDOWWIDTH
BackBufferHeight:= WINDOWHEIGHT
BackBufferCount:= 1;
BackBufferFormat:= D3DDM.Format;
SwapEffect:= D3DSWAPEFFECT_DISCARD;
hDeviceWindow:= MYWINDOWHANDLE


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.

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!