sincerely Singaporean

If you have not done so, read this full tutorial on how to use SGEXTN to build an application.

SGXCentral

see header file

see source file

class SGXCentral;

part of SGEXTN module SG_Core

class controlling initialisation and termination of the application

detailed description

list of all including inherited members

implementation details

preprocessor file inclusion directive: #include ‹SGXCentral.h›

CMake target for BuildLah: SGEXTN::SG_Core

see this link for more information about BuildLah

parent class: (none)

children classes: (none)

static member variables

static SGXString applicationName;

static SGXString applicationVersion;

static void (*customInitialise)();

static void (*customTerminate)();

static SGXString folderName;

static void (*importCustomFonts)();

static SGXString infoWebsite;

static void (*interpretCmdArgs)(int, char**);

static SGXString organisationName;

static SGXString pathToAppIcon;

static void (*setCustomTheme)();

Detailed Description

SGXCentral contains general information about the application, including the functions that should be called during the application's initialisation and termination. Initialisation and termination of SGEXTN applications rely significantly on the entry point. You should read the tutorial to learn how to use the entry point.

Implementation Details

SGXCentral stores function pointers as static variables to initialise every module that are defined at compile time using preprocessor conditionals and then set at runtime.

static SGXString applicationName;

Name of the application and is displayed as the window name. This must be set in the entry point.

Setting this after the entry point has no effect.

static SGXString applicationVersion;

Version number of the application. This must be set in the entry point.

The version number is a SGXString, not a number. You are strongly encouraged to use semantic versioning for your application.

static void (*customInitialise)();

Function pointer to the initialisation function of your custom code. This must be set in the entry point but is run after SGEXTN initialisation.

Setting this after the entry point has no effect.

SGEXTN is fully initialised when this function runs, but this function is run before the event loop starts.

static void (*customTerminate)();

Function pointer to the termination function of your custom code.

You are strongly encouraged to set this in the entry point.

This runs before the termination function of SGEXTN.

All memory allocated by your custom code should be freed by the end of this function's execution.

static SGXString folderName;

Name of the folder where your application stores data. This must be set in the entry point.

Setting this after the entry point has no effect.

This must be a valid folder name, otherwise the SGEXTN file system module will not work. You are strongly recommended to only use English letters in the folder name.

static void (*importCustomFonts)();

Function pointer to the function import custom fonts. This must be set in the entry point if needed.

Setting this after the entry point has no effect.

Use SGWDefaultFonts::addFont to import custom fonts.

You may import custom fonts outside this function.

SGEXTN will warn if the application icon ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ font is not found by the end of this function's execution.

Using SGWIconLabel or SGWIconButton when there is no application icon ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ font will render nonsense.

static SGXString infoWebsite;

link to the website with information about this application

Setting this after the entry point has no effect.

If the application does not have a information website, use the GitHub repository link instead. If it also does not have a GitHub repository link, you can leave this unset.

The website link should not include the https:// part

static void (*interpretCmdArgs)(int, char**);

Function pointer to function interpreting command line arguments. This must be set in the entry point.

Setting this after the entry point has no effect.

The function that this points to should interpret the arguments passed and use them to set static variables.

Creating any registered SGXIdentifier, registering any SGXIdentifier, and using any class from the SGEXTN file system, widgets, and renderer interface modules within this function is undefined behaviour. Instead, do this in the function that is provided to SGXCentral::customInitialise.

static SGXString organisationName;

Name of your company or yourself. This must be set in the entry point.

This should match the name shown on your company website or personal website, or at least be similar enough to not confuse users.

static SGXString pathToAppIcon;

Path to the application icon which is shown when users run the application. This must be set in the entry point.

Setting this after the entry point has no effect.

The matching file must exist in the resource system. To ensure that, put the app icon in the assets folder. For more information about the resource system, see this tutorial.

If this is not set then the app will use the SGEXTN icon.

static void (*setCustomTheme)();

Function pointer to the function setting custom theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ for your application. This must be set in the entry point if needed.

Setting this after the entry point has no effect.

This does not bypass custom theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ applied to celebrate National Day.

Running anything apart from setting theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ in this function is undefined behaviour.

©2025 05524F.sg (Singapore)

contact 05524F / report a bug / make a suggestion

about 05524F SINGAPORE values

list of 05524F projects