System State Constants

Configuration constants for System_SetState and System_GetState.

Overview

System state constants configure HGE behavior. Use System_SetState() before System_Initiate() for initialization settings, and at runtime for dynamic settings.

Callback Functions

ConstantTypeDescription
HGE_FRAMEFUNChgeCallbackFrame update function
HGE_RENDERFUNChgeCallbackRender function
HGE_FOCUSLOSTFUNChgeCallbackCalled when window loses focus
HGE_FOCUSGAINFUNChgeCallbackCalled when window gains focus
HGE_EXITFUNChgeCallbackCalled before exiting

Window Settings

ConstantTypeDescription
HGE_WINDOWEDboolWindowed mode (true) or fullscreen (false)
HGE_SCREENWIDTHintScreen/window width
HGE_SCREENHEIGHTintScreen/window height
HGE_SCREENBPPintBits per pixel (fullscreen)
HGE_TITLEconst char*Window title
HGE_ICONconst char*Icon resource name
HGE_CURSORconst char*Cursor resource name
HGE_HIDEMOUSEboolHide system cursor

Graphics Settings

ConstantTypeDescription
HGE_ZBUFFERboolEnable z-buffer
HGE_TEXTUREFILTERboolBilinear texture filtering
HGE_USESOUNDboolEnable audio system
HGE_FPSintTarget frame rate (0 = vsync, HGEFPS_UNLIMITED = no limit)

File System

ConstantTypeDescription
HGE_LOGFILEconst char*Log file path
HGE_INIFILEconst char*INI file for config saving

Read-Only States

ConstantTypeDescription
HGE_HWNDHWNDWindow handle
HGE_HWNDPARENTHWNDParent window handle

Example

int main()
{
    HGE *hge = hgeCreate(HGE_VERSION);
    
    // Set callbacks
    hge->System_SetState(HGE_FRAMEFUNC, FrameFunc);
    hge->System_SetState(HGE_RENDERFUNC, RenderFunc);
    
    // Window settings
    hge->System_SetState(HGE_WINDOWED, true);
    hge->System_SetState(HGE_SCREENWIDTH, 800);
    hge->System_SetState(HGE_SCREENHEIGHT, 600);
    hge->System_SetState(HGE_TITLE, "My Game");
    
    // Graphics settings
    hge->System_SetState(HGE_USESOUND, true);
    hge->System_SetState(HGE_FPS, 60);
    
    if (hge->System_Initiate())
    {
        hge->System_Start();
    }
    
    hge->System_Shutdown();
    hge->Release();
    return 0;
}

Frame Rate Constants

ConstantValueDescription
HGEFPS_UNLIMITED0No frame rate limit
HGEFPS_VSYNC-1Sync to vertical refresh

See Also