ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


source_port_identification

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
source_port_identification [2019/08/26 02:05] korshunsource_port_identification [2019/08/26 03:48] korshun
Line 5: Line 5:
 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. 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.
  
-<note important>Don't use [[functions:IsGZDoom]] to check for OpenGL renderer. Use [[functions:IsOpenGL]]!</note>+<note important>Don't use these functions to check for renderer. Use [[renderer_identification|IsOpenGL]]!</note> 
 + 
 +===== Functions ===== 
 + 
 +==== Is<Port> ==== 
 + 
 +  * ''bool IsZDoom()'' -- returns true if the mod is running in ZDoom, but not GZDoom or Zandronum. 
 +  * ''bool IsGZDoom()'' -- returns true if the mod is running in GZDoom or a GZDoom-based engine like Zandronum. 
 +  * ''bool IsZandronum()'' -- returns true if the mod is running in Zandronum. 
 + 
 +==== IdentifySourcePort ==== 
 + 
 +''int IdentifySourcePort()'' -- returns the exact source port the mod is running in. It can be one of the following constants: 
 +  * ''PORT_ZDOOM'' -- ZDoom 
 +  * ''PORT_GZDOOM'' - GZDoom 
 +  * ''PORT_ZANDRONUM'' -- Zandronum 
 + 
  
 ===== How it works ===== ===== How it works =====
Line 15: Line 32:
 If both these checks fail, the port is assumed to be ZDoom. 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. +To avoid rerunning these checks every time you call one of the source port identification 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 ===== +
- +
-  * [[functions:IsZDoom]] +
-  * [[functions:IsGZDoom]] +
-  * [[functions:IsZandronum]] +
-  * [[functions:IdentifySourcePort]] +