Here you continue to look at the window-related functions, and the parts you see earlier can generate a window. In the HGE code, we can see other functions dealing with window related things, of course not referring to the message handler function.
In Hge, the message handler function is one of the most important functions, which completes the information input of the whole game.
Additional window-related functions are
Graphics.cpp |
void Hge_impl::_adjustwindow () |
void Hge_impl::_resize (intint height) |
As you can see from the name of the function is the function that handles the change of the window
|
Realize |
where it appears |
Role |
Adjustwindow |
voidHge_impl::_adjustwindow () {RECT*RC; LONG style; if(bwindowed) {rc=&rectw; style=Stylew;} Else{rc=&rectfs; style=Stylefs;} SetWindowLong (hwnd, Gwl_style, STYLE); Style=GetWindowLong (hwnd, Gwl_exstyle); if(bwindowed) {SetWindowLong (hwnd, Gwl_exstyle, style& (~ws_ex_topmost)); SetWindowPos (hwnd, Hwnd_notopmost, RC->left, Rc->top, Rc->right-rc->left, rc->bottom-rc->top, swp_framechanged); } Else{SetWindowLong (hwnd, Gwl_exstyle, style|ws_ex_topmost); SetWindowPos (hwnd, hwnd_topmost, RC->left, Rc->top, Rc->right-rc->left, rc->bottom-rc->top, swp_framechanged); }} View Code |
is defined in Graphics.cpp 1. Called when set to Window mode (system.cpp:368); 2. Called when the DX is initialized (graphics.cpp:720) |
Format and position the window |
Resize |
void hge_impl::_resize (int width, int height) { if (hwndparent) { // if (Procfocuslostfunc) Procfocuslostfunc (); d3dppw.backbufferwidth =width; D3dppw.backbufferheight =height; Nscreenwidth =width; Nscreenheight =height; _setprojectionmatrix (Nscreenwidth, nscreenheight); _gfxrestore (); // if (Procfocusgainfunc) Procfocusgainfunc (); View Code |
is defined in Graphics.cpp 1. Called when the window has a size change (system.cpp:849) |
To reset the size in the case of a parent window |
For the Resize function: 1. In windowed mode, the HGE is not resizable in the window mode. 2. In full-screen mode, switch to desktop |
Hge source Explor 0x3 Windows module