New API: GetScreenRect and define g_rcScr as a macro calling GetScreenRect

This commit is contained in:
Vincent Wei
2020-01-12 14:26:51 +08:00
parent 43c4570b87
commit 9547020633
2 changed files with 20 additions and 4 deletions
+14 -4
View File
@@ -81,16 +81,26 @@ extern "C" {
*/
/**
* \var RECT g_rcScr
* \brief Contains the rectangle of the whole screen.
* \fn RECT GUIAPI GetScreenRect (void);
* \brief Return the rectangle of the physical screen.
*
* Since 4.2.0
*/
extern MG_EXPORT RECT g_rcScr;
MG_EXPORT RECT GUIAPI GetScreenRect (void);
/**
* \def g_rcScr
* \brief Contains the rectangle of the whole screen.
*
* \note Since 4.2.0, g_rcScr is defined a macro to call \a GetScreenRect.
*/
#define g_rcScr (GetScreenRect())
/**
* \def g_rcDesktop
* \brief Contains the rectangle of desktop of the application.
*
* \a g_rcDesktop is defined as an alias (macro) of \a g_rcScr.
* \note This global variable is defined as an alias (macro) of \a g_rcScr.
*
* \sa g_rcScr
*/
+6
View File
@@ -65,6 +65,12 @@
GAL_Surface* __gal_screen;
RECT GUIAPI GetScreenRect (void)
{
RECT rc = { 0, 0, __gal_screen->w, __gal_screen->h };
return rc;
}
BOOL GAL_ParseVideoMode (const char* mode, int* w, int* h, int* depth)
{
const char* tmp;