ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


engine_info

This is an old revision of the document!


Engine information

ACSUtils provides functions to identify the exact source port (ZDoom, GZDoom, Zandronum) and renderer (software, OpenGL).

Identifying source port

Detection methods

The detection module first checks for presence of GetPlayerAccountName, which is a Zandronum-exclusive function. It returns a string (usually an empty string) if it exists, while unimplemented ACS functions return 0. If the function is present, the port is assumed to be Zandronum.

If the port is not Zandronum, the detection module attempts to spawn an actor of type DynamicLight, which is present in GZDoom, but not in ZDoom. If the actor spawns successfully, the port is assumed to be GZDoom.

If both these checks fail, the port is assumed to be ZDoom.

Caching

The above checks are not rerun every time the source port is queried. After identification, the type of the source port is saved into a map variable. Subsequent queries simply return the value of that variable.

IdentifySourcePort

int IdentifySourcePort()

Identifies the engine that the mod is running in and returns one of the following constants:

  • PORT_ZDOOM โ€“ ZDoom
  • PORT_GZDOOM โ€“ GZDoom
  • PORT_ZANDRONUM โ€“ Zandronum

IsGZDoom

bool IsGZDoom()

Returns true if the port is GZDoom or a derivative.

This function returns true for Zandronum, since Zandronum is a derivative of GZDoom and includes its OpenGL renderer.
If you want to check for OpenGL renderer, don't use this function. Use IsOpenGL.

IsZandronum

bool IsZandronum()

Returns true if the port is Zandronum or a derivative.

Identifying renderer

IsOpenGL

bool IsOpenGL()

Returns true if the engine is currently running in an OpenGL renderer.

engine_info.1555881327.txt.gz ยท Last modified: 2019/04/22 00:15 by korshun