Source port identification

Introduction

You can identify what engine your mod is running in using ACSUtils. This may be useful to avoid using features if they're not present in the engine your mod is running in.

Don't use IsGZDoom to check for OpenGL renderer. Use IsOpenGL!

How it works

The detection function 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.

To avoid rerunning these checks every time you call one of the below functions, they are only run the first time any of the functions is called and the result is stored into a map variable. Subsequent function calls simply read the map variable.

Functions

IsZDoom

IsGZDoom

IsZandronum

IdentifySourcePort