Hge source Explor 0x3 Windows module

Source: Internet
Author: User

Windows window

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.