HGE Functions

Here you'll find description of all HGE system layer functions:

Interface functions

hgeCreate Returns a pointer to HGE interface.
Release Releases obtained HGE interface.

System functions

System_Initiate Initializes hardware and software needed to run engine.
System_Shutdown Restores video mode and frees allocated resources.
System_Start Starts running user defined frame function.
System_SetState Sets internal system states.
System_GetState Returns internal system state values.
System_GetErrorMessage Returns last occured HGE error description.
System_Log Writes a formatted message to the log file.
System_Launch Launches an URL or external executable/data file.
System_Snapshot Saves current screen snapshot into a file.

Resource functions

Resource_Load Loads a resource into memory from disk.
Resource_Free Deletes a previously loaded resource from memory.
Resource_AttachPack Attaches a resource pack.
Resource_RemovePack Removes a resource pack.
Resource_RemoveAllPacks Removes all resource packs previously attached.
Resource_MakePath Builds absolute file path.
Resource_EnumFiles Enumerates files by given wildcard.
Resource_EnumFolders Enumerates folders by given wildcard.

Initialization file functions

Ini_SetInt Writes an integer value to initialization file.
Ini_GetInt Reads an integer value from initialization file.
Ini_SetFloat Writes a float value to initialization file.
Ini_GetFloat Reads a float value from initialization file.
Ini_SetString Writes a string to initialization file.
Ini_GetString Reads a string from initialization file.

Random number generation functions

Random_Seed Sets random number generator's seed.
Random_Int Generates int random number.
Random_Float Generates float random number.

Timer functions

Timer_GetTime Returns time elapsed since System_Initiate call.
Timer_GetDelta Returns time elapsed since last frame function call.
Timer_GetFPS Returns current frames-per-second rate.

Sound effect functions

Effect_Load Loads a sound effect from disk or memory.
Effect_Free Deletes loaded effect and associated resources.
Effect_Play Starts playing sound effect.
Effect_PlayEx Starts playing sound effect with additional parameters.

Music functions

Music_Load Loads a music from disk or memory.
Music_Free Deletes loaded music and associated resources.
Music_Play Starts playing music.
Music_SetAmplification Sets level of amplification for a music.
Music_GetAmplification Returns level of amplification of a music.
Music_GetLength Returns length of a music's patterns list.
Music_SetPos Sets music position in patterns and rows.
Music_GetPos Returns current position of a music in patterns and rows.
Music_SetInstrVolume Sets volume of a specific instrument in a music.
Music_GetInstrVolume Returns volume of a specific instrument in a music.
Music_SetChannelVolume Sets volume of a specific channel in a music.
Music_GetChannelVolume Returns volume of a specific channel in a music.

Compressed audio stream functions

Stream_Load Loads a stream from disk or memory.
Stream_Free Deletes loaded stream and associated resources.
Stream_Play Starts playing stream.

Audio channel functions

Channel_SetPanning Changes an audio channel panning.
Channel_SetVolume Changes an audio channel volume.
Channel_SetPitch Changes an audio channel pitch.
Channel_Pause Pauses an audio channel.
Channel_Resume Resumes a paused audio channel.
Channel_Stop Stops an audio channel.
Channel_PauseAll Pauses all active audio channels.
Channel_ResumeAll Resumes all active audio channels.
Channel_StopAll Stops all active audio channels.
Channel_IsPlaying Tests if an audio channel is playing.
Channel_GetLength Retrieves the total length of a playing channel.
Channel_SetPos Skips forwards or backwards in a playing channel.
Channel_GetPos Retrieves a playing channel's position.
Channel_SlideTo Starts sliding a channel volume, panning or pitch.
Channel_IsSliding Tests if a channel parameters are sliding.

Input functions

Input_GetMousePos Returns current mouse cursor position.
Input_SetMousePos Sets current mouse cursor position.
Input_GetMouseWheel Returns the mouse wheel shift since last frame.
Input_IsMouseOver Tests if mouse cursor is inside HGE window or not.
Input_KeyDown Tests if a key was pressed down during the last frame.
Input_KeyUp Tests if a key was released during the last frame.
Input_GetKeyName Returns a key or mouse button name from it's code.
Input_GetKeyState Tests if a key or mouse button is down.
Input_GetKey Returns the last pressed key code.
Input_GetChar Returns the last pressed character.
Input_GetEvent Gets the next input event from the queue.

Graphics functions

Gfx_BeginScene Starts rendering graphics.
Gfx_EndScene Ends rendering and updates the screen.
Gfx_Clear Clears render target and z-buffer.
Gfx_RenderLine Renders a line.
Gfx_RenderTriple Renders a triple.
Gfx_RenderQuad Renders a quad.
Gfx_StartBatch Starts rendering of graphic primitives batch.
Gfx_FinishBatch Ends rendering of graphic primitives batch.
Gfx_SetClipping Sets the clipping region.
Gfx_SetTransform Sets global scene transformation.

Render target functions

Target_Create Creates a render target.
Target_Free Deletes a render target and associated resources.
Target_GetTexture Returns a render target's texture handle.

Texture functions

Texture_Create Creates an empty texture.
Texture_Load Loads a texture from disk or memory.
Texture_Free Deletes loaded texture and associated resources.
Texture_GetWidth Returns a texture width in pixels.
Texture_GetHeight Returns a texture height in pixels.
Texture_Lock Locks a texture for direct access.
Texture_Unlock Unlocks a texture.