This is an old revision of the document!
You can identify whether the software or OpenGL renderer is currently being used by using the IsOpenGL function from ACSUtils.
GetCVar(“vid_renderer”) – the user may also have gl_nogl set to true.vid_renderer and gl_nogl – the user may be playing in ZDoom, which doesn't have the OpenGL renderer. Nonetheless, many badly coded mods do a lot of the above and get incorrect results.
bool IsOpenGL() – returns true if the mod is being played in the OpenGL renederer, false if in software renderer.
If called serverside, IsOpenGL logs an error and returns true.
vid_renderer or gl_nogl is changed mid-game because the renderer only actually switches after restart, but the values of the cvars change immediately.
First, IsOpenGL checks if it's running serverside (see above).
Then IsOpenGL calls 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.