ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


renderer_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
renderer_identification [2019/08/26 03:39] – [IsOpenGL] korshunrenderer_identification [2019/08/26 03:55] (current) – removed korshun
Line 1: Line 1:
-====== Renderer identification ====== 
- 
-===== Introduction ===== 
- 
-You can identify whether the software or OpenGL renderer is currently being used by using the ''IsOpenGL'' function from ACSUtils. 
- 
-<note warning> 
-**Things not to do:** 
-  * don't just check ''GetCVar("vid_renderer")'' -- the user may also have ''gl_nogl'' set to true. 
-  * don't just check for ''vid_renderer'' and ''gl_nogl'' -- the user may be playing in ZDoom, which doesn't have the OpenGL renderer.  
-  * don't just use [[source_port_identification|IsGZDoom]] and assume that if the engine is GZDoom, the user is playing in OpenGL renderer. 
-  * don't store the value of ''IsOpenGL'' in a variable -- the renderer can change mid-game. 
-  * don't check the renderer serverside -- the server has no renderer. 
- 
-Nonetheless, many badly coded mods do a lot of the above and get incorrect results. 
-</note> 
- 
-===== IsOpenGL ===== 
- 
-''bool IsOpenGL()'' -- returns true if the mod is being played in the OpenGL renederer, false if software renderer. 
- 
-If called serverside, ''IsOpenGL'' logs an [[error]] and returns true. 
- 
-<note warning>The renderer can change mid-game. Don't store the result of ''IsOpenGL'' in a variable. Instead, simply call it every time.</note> 
- 
-===== How it works ===== 
- 
-First, ''IsOpenGL'' checks if it's running serverside (see above). 
- 
-Then ''IsOpenGL'' calls [[renderer_identification|IsZDoom]] to check if it's running in ZDoom. Since ZDoom doesn't have an OpenGL renderer, the renderer is assumed to be software in this case. 
- 
-Then, ''IsOpenGL'' checks for ''gl_nogl'' - a CVar that lets the user to disable the OpenGL renderer in GZDoom and Zandronum. If it's set, the renderer is assumed to be software. 
- 
-And only then ''IsOpenGL'' checks for ''vid_renderer''. If its value is not 0, the renderer is assumed to be OpenGL. 
- 
  
renderer_identification.1566779977.txt.gz · Last modified: 2019/08/26 03:39 by korshun