After ive changed the display mode to whatever resolution i want, what do i do with the window? I mean how do i make it take up the whole screen with no borders? Then, how do i make it go back?
Posted on 2002-06-16 12:32:19 by ChimpFace9000
IDirect3D8::CreateDevice - you should have all the parameters.
Look at the examples here: http://www.btinternet.com/~tonymcmahon40/dxgnotes.html
(bottom of the page)
Posted on 2002-06-16 13:09:04 by bitRAKE
I usually use a window with a BLACK_BRUSH hbrBackground,
sized to the entire screen, and style set to "WS_POPUP | WS_VISIBLE".
This looks a lot nicer when doing DDraw/D3D/OpenGL modeswitching,
unlike what most games and demos use (ie, you see a normal app
window for a sec, the screen resizes, everything looks ugly).
Posted on 2002-06-16 13:21:54 by f0dder
bitRake: Im using openGL.

fodder: Thanks, i got it to go to fullscreen and back, but when i go from full screen to a normal window, the entire desktop goes black and stays black until i move a window to that area forcing it re-draw itself. Anyway to stop this?
Posted on 2002-06-16 13:43:46 by ChimpFace9000
Sounds strange, you must be doing something wrong :).
Or perhaps it's OpenGL playing tricks on you... perhaps you should
paste the full->windowed code here so some of the clever OpenGL
users can take a look.
Posted on 2002-06-16 15:19:02 by f0dder
Actually its windows code that im having trouble with, not so much opengl.

Heres the section...
case IDC_PANEL_CHECK_FULLSCREEN:

switch(appFullScreen)
{
case true:
appFullScreen = false;
::SetWindowLong(hWndGL, GWL_EXSTYLE, WS_EX_CLIENTEDGE);
::SetWindowLong(hWndMain, GWL_STYLE, WS_OVERLAPPEDWINDOW);
::SetWindowPos(hWndMain, HWND_TOP, rectWndMain.left,
rectWndMain.top, rectWndMain.right - rectWndMain.left,
rectWndMain.bottom - rectWndMain.top,
SWP_SHOWWINDOW);
break;

case false:
int cx, cy;

appFullScreen = true;
::SetWindowLong(hWndGL, GWL_EXSTYLE, NULL);
::GetWindowRect(hWndMain, &rectWndMain);
::SetWindowLong(hWndMain, GWL_STYLE, WS_POPUP);
cx = ::GetSystemMetrics(SM_CXSCREEN);
cy = ::GetSystemMetrics(SM_CYSCREEN);
::SetWindowPos(hWndMain, HWND_TOP, 0, 0, cx, cy, SWP_SHOWWINDOW);
break;
}
break;


hWndMain is the specific window that im trying to make full screen.

Ill also attach the exe, maybe it only happens in win98.
Posted on 2002-06-16 16:50:38 by ChimpFace9000
Figured it out.
::ChangeDisplaySettings(NULL, 0);

Does it.
Posted on 2002-06-16 23:32:33 by ChimpFace9000
Here's the code I used to use, you may find it helpfull
  	mov Wth, 800	; If fullscreen mode is selected make sure

mov Hgt, 600 ; this is a valid screen resolution.
mov BitsPP, 16
mov FullScrn, 0 ; 0 = Windowed, 1 = Fullscreen

test FullScrn, 1
jz @F
mov dmScreenSettings.dmSize, sizeof dmScreenSettings
mov eax, Wth
mov dmScreenSettings.dmPelsWidth, eax
mov eax, Hgt
mov dmScreenSettings.dmPelsHeight, eax
mov eax, BitsPP
mov dmScreenSettings.dmBitsPerPel, eax
mov dmScreenSettings.dmFields, DM_BITSPERPEL or DM_PELSWIDTH or DM_PELSHEIGHT
invoke ChangeDisplaySettings, ADDR dmScreenSettings, CDS_FULLSCREEN
@@:

mov wc.cbSize,SIZEOF WNDCLASSEX
mov wc.style, CS_HREDRAW or CS_VREDRAW
mov wc.lpfnWndProc, OFFSET WndProc
mov wc.cbClsExtra,NULL
mov wc.cbWndExtra,NULL
mov eax, hInstance
mov wc.hInstance, eax
mov wc.hbrBackground,COLOR_WINDOW+1
mov wc.lpszMenuName,NULL
mov wc.lpszClassName,OFFSET ClassName
invoke LoadIcon,NULL,IDI_APPLICATION
mov wc.hIcon,eax
mov wc.hIconSm,eax
invoke LoadCursor,NULL,IDC_ARROW
mov wc.hCursor,eax
invoke RegisterClassEx, addr wc
test FullScrn, 1
jz nFs ; <= Fullscreen
invoke ShowCursor, 0
invoke CreateWindowEx,WS_EX_APPWINDOW, ADDR ClassName, addr AppName,\
WS_POPUP or WS_CLIPSIBLINGS or WS_CLIPCHILDREN, CW_USEDEFAULT,\
CW_USEDEFAULT, Wth, Hgt, NULL, NULL,\
hInst, NULL
jmp @F
nFs: ; <= Not Fullscreen
invoke CreateWindowEx,WS_EX_APPWINDOW or WS_EX_WINDOWEDGE, ADDR ClassName, addr AppName,\
WS_OVERLAPPEDWINDOW or WS_CLIPSIBLINGS or WS_CLIPCHILDREN, CW_USEDEFAULT,\
CW_USEDEFAULT, Wth, Hgt, NULL, NULL,\
hInst, NULL
@@:
mov hwnd,eax
invoke ShowWindow, hwnd, SW_SHOWNORMAL
invoke UpdateWindow, hwnd
Posted on 2002-06-17 05:41:06 by Eóin