Archived

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

Fullscreen app with DX 8.1

This topic is 5535 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 folks, I am currently working on a 3D game which uses DirectX 8.1. I wanted to use fullscreen mode, so I tried to set the "windowed" param of the present parameters structure to "FALSE". Unfortunately, it does not work: DirectX tells me that the mode is not supported and that "CreateDevice" failed. Any suggestions what could solve the problem? I don''''t need any signature ;-)

Share this post


Link to post
Share on other sites
If you could post your code, it would be more helpful.

It''s probably not your windowed parameter that is screwing up, but something else (ie, setting the display mode to 254515x215151).

¬_¬

Share this post


Link to post
Share on other sites
No, that format does not work, too. And everything works fine when using windowed mode.

WIDTH=GetSystemMetrics(SM_CXSCREEN);
HEIGHT=GetSystemMetrics(SM_CYSCREEN);

WNDCLASS WndClass;

WndClass.nostyle=CS_HREDRAW | CS_VREDRAW;
WndClass.cbClsExtra=0;
WndClass.cbWndExtra=sizeof(DWORD);
WndClass.lpfnWndProc=(WNDPROC)WndProc;
WndClass.hInstance=hInstance;
WndClass.hbrBackground=(HBRUSH)GetStockObject(BLACK_BRUSH);
WndClass.hCursor=LoadCursor(NULL,IDC_ARROW);
WndClass.hIcon=NULL;
WndClass.lpszMenuName=NULL;
WndClass.lpszClassName="Voxel3DWndClass";

//Register class
if(RegisterClass(&WndClass)==NULL) return 1;

//Create window
hWnd=CreateWindowEx(0,"Voxel3DWndClass",APP_TITLEVERSION, WS_POPUP,0,0,WIDTH,HEIGHT,NULL,NULL,hInstance,NULL);
if(hWnd == NULL) return 1;

//...
//message loop etc.
//...

//Create D3D Object
lpD3D=Direct3DCreate8(D3D_SDK_VERSION);

//Determine display mode
D3DDISPLAYMODE d3ddm;
lpD3D->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &d3ddm);

//Init params
D3DPRESENT_PARAMETERS d3dpp;
ZeroMemory( &d3dpp, sizeof(d3dpp));
d3dpp.Windowed = FALSE;
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.BackBufferCount = 1;

//Create device ### ERROR OCCURS HERE WHEN CALLING CREATEDEVICE ###
d3dpp.BackBufferFormat=D3DFMT_A8R8G8B8;
CreateDevice(D3DDEVTYPE_HAL,&d3dpp);


I don''''t need any signature ;-)

Share this post


Link to post
Share on other sites
Yes, it works now! Thanks! The problem was that I did not set the back buffer height and width. But why did it work in windowed mode then?

I don''''t need any signature ;-)

Share this post


Link to post
Share on other sites
quote:
Original post by Shooter
Yes, it works now! Thanks! The problem was that I did not set the back buffer height and width. But why did it work in windowed mode then?

I don''t need any signature ;-)


Because you don''t need to set those parameters for windowed mode.



Share this post


Link to post
Share on other sites