Overview
System state constants configure HGE behavior. Use System_SetState() before System_Initiate() for initialization settings, and at runtime for dynamic settings.
Callback Functions
| Constant | Type | Description |
| HGE_FRAMEFUNC | hgeCallback | Frame update function |
| HGE_RENDERFUNC | hgeCallback | Render function |
| HGE_FOCUSLOSTFUNC | hgeCallback | Called when window loses focus |
| HGE_FOCUSGAINFUNC | hgeCallback | Called when window gains focus |
| HGE_EXITFUNC | hgeCallback | Called before exiting |
Window Settings
| Constant | Type | Description |
| HGE_WINDOWED | bool | Windowed mode (true) or fullscreen (false) |
| HGE_SCREENWIDTH | int | Screen/window width |
| HGE_SCREENHEIGHT | int | Screen/window height |
| HGE_SCREENBPP | int | Bits per pixel (fullscreen) |
| HGE_TITLE | const char* | Window title |
| HGE_ICON | const char* | Icon resource name |
| HGE_CURSOR | const char* | Cursor resource name |
| HGE_HIDEMOUSE | bool | Hide system cursor |
Graphics Settings
| Constant | Type | Description |
| HGE_ZBUFFER | bool | Enable z-buffer |
| HGE_TEXTUREFILTER | bool | Bilinear texture filtering |
| HGE_USESOUND | bool | Enable audio system |
| HGE_FPS | int | Target frame rate (0 = vsync, HGEFPS_UNLIMITED = no limit) |
File System
| Constant | Type | Description |
| HGE_LOGFILE | const char* | Log file path |
| HGE_INIFILE | const char* | INI file for config saving |
Read-Only States
| Constant | Type | Description |
| HGE_HWND | HWND | Window handle |
| HGE_HWNDPARENT | HWND | Parent 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
| Constant | Value | Description |
| HGEFPS_UNLIMITED | 0 | No frame rate limit |
| HGEFPS_VSYNC | -1 | Sync to vertical refresh |
See Also