-
Notifications
You must be signed in to change notification settings - Fork 1
GameLib_GameWindow
Wow, That's a lot of function to document.....
That's alotta DAM-AGE for me.
Well, Here we go again.
window pointer used by static WndProc to call the actual window process
bool
whether window is Active or Not
bool
whether window is fullscreen or Not
HWND
Window Handler
int
width of window
int
height of window
(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
static WndProc entry
(bool bCreateFullScr, int width, int height)
Creates GameWindow size of width and height and sets the property (WindowRect.left, WindowRect.right, WindowRect.top, WindowRect.bottom, m_bFullScr, m_width, m_height) of GameWindow
if bCreateFullScr, clears memory, ChangeDisplaySettings with the system, if failed, returns false.
if bCreateFullScr, adjust Window with WS_EX_APPWINDOW and WS_POPUP. else, adjust Window with WS_EX_APPWINDOW|WS_EX_WINDOWEDGE and WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX.
Create Window with CreateWindowEx, with class MyGameWindowClass and set the title depending on _TRIAL flag. (_TRIAL : true.東方怪綺談 ~ Mystic Square ver 0.01 / false.東方怪綺談 ~ Mystic Square ver 1.00) with Window setting declared at above.
Create new CGLContext (delete if it is not NULL) as m_pGLContext, and call m_pGLContext->MakeCurrent()
set the glViewPort to the Window and set it as foreground window and give window a focus.
()
DestroyWindow(m_hWnd) and unregister class
()
Basically Toggles Full Screen
(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM, lParam)
The Process of the Window
Function of this function depends on which uMsg was sent,
if WM_PAINT, if it is not Active, it calls game->OnPaintInactivate()
if WM_ACTIVATE,
if wParam's LOW-Order is WA_INACTIVE,
Show Minimized Window if fullscreen flag is active.
execute Game->Deactivate() is activated
if it is not WA_INACTIVE,
showWindow with hWnd, Create Window with dmScreenSettings(DEVMODE)
and set the m_bActive = true and call Game->OnActivate();
-> Needs to be transcribed to human-readable documentation.
if WM_SYSCOMMAND,
disables screensaver and monitor powersave
if WM_COMMAND,
if wParam's LOW-Order is 0,
call ToggleFullScreen();
if WM_CLOSE,
call PostQuitMessage(0);
return 0
everything without return 0 is processed DefWindowProc() afterwards.