Skip to main content
gamedev.net
🔒 Locked

how do i?

Started by KingMXF 6 replies 500+ views
Original Post
KingMXF
KingMXF
how do i make a window FULLSCREEN in WIN32? and!!!!! why is it bad to have your HWND a global?
Qw3r7yU10p!
Qw3r7yU10p!
try using a better subject title. most people here are asking how to do things, so calling your post ''how do i?'' doesn''t attract the eye in the same way as ''going fullscreen'' would.

in answer to you question, I don''t know.
Miserable
Miserable
quote:
Original post by KingMXF
why is it bad to have your HWND a global?

For the same reasons why it''s ''bad'' to make any other variable global. Encapsulation is ''good''. Not knowing who or what will access it, from where and in what fashion, is ''bad''.
navigator
navigator
quote:
Original post by KingMXF
how do i make a window FULLSCREEN in WIN32?


I think you would succeed with

ShowWindow(hWnd, SW_MAXIMIZE) 


quote:
why is it bad to have your HWND a global?


As others have already said, global variables are generally
dangerous because you can''t control who can access them.

In other words, you will learn not to use globals after you first
spend some hours searching for who the hell is overwriting
that variable...
---Never trust a Troglotroll.
owl
owl
how do i make a window FULLSCREEN in WIN32?

What are you talking about? Maximizing a window, or going fullscreen with DirectX, OpenGL, etc.?
How old are you?

quote:
Original post by petewood
in answer to you question, I don''t know.


hehehe

[size="2"]I like the Walrus best.
KingMXF
KingMXF
hahaha, how old am i? woooohoooo!
ga
ga
I got this function from somewhere:


  
bool DDrawFullScreen()
{
HRESULT ddrval;

ddrval=DirectDrawCreate(NULL,&dDraw,NULL);
if (ddrval!=DD_OK) return false;

ddrval=dDraw->SetCooperativeLevel(hwnd,DDSCL_EXCLUSIVE|DDSCL_FULLSCREEN);
if (ddrval!=DD_OK) return false;

ddrval=dDraw->SetDisplayMode(scr_x, scr_y, 32);
if (ddrval!=DD_OK ) return false;

// Workaround for RIVA 128

ddrval=dDraw->SetCooperativeLevel(hwnd,DDSCL_EXCLUSIVE|DDSCL_FULLSCREEN);
if (ddrval != DD_OK) return false;

return true;
}


dDraw is of type LPDIRECTDRAW, you should store it until you''re switching back to windows:


  
void DDShut()
{
dDraw->Release();
dDraw = NULL;
}
Visit our homepage: www.rarebyte.de.stGA

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.