From 94b2fc68afd73578caa22ce69d554965802695e7 Mon Sep 17 00:00:00 2001 From: pogokeen Date: Tue, 27 Feb 2018 00:52:28 +0000 Subject: [PATCH] astub.cpp: only call GL functions if we are in a GL mode git-svn-id: https://svn.eduke32.com/eduke32@6709 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/astub.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/source/duke3d/src/astub.cpp b/source/duke3d/src/astub.cpp index 6f4ef111d..daed2d6a5 100644 --- a/source/duke3d/src/astub.cpp +++ b/source/duke3d/src/astub.cpp @@ -2509,15 +2509,21 @@ static int32_t DrawTiles(int32_t iTopLeft, int32_t iSelected, int32_t nXTiles, i static inline void pushDisableFog(void) { #ifdef USE_OPENGL - glPushAttrib(GL_ENABLE_BIT); - glDisable(GL_FOG); + if (getrendermode() >= REND_POLYMOST) + { + glPushAttrib(GL_ENABLE_BIT); + glDisable(GL_FOG); + } #endif } static inline void popDisableFog(void) { #ifdef USE_OPENGL - glPopAttrib(); + if (getrendermode() >= REND_POLYMOST) + { + glPopAttrib(); + } #endif } @@ -3264,7 +3270,10 @@ static int32_t OnSelectTile(int32_t tileNum) setpolymost2dview(); #ifdef USE_OPENGL - glEnable(GL_TEXTURE_2D); + if (getrendermode() >= REND_POLYMOST) + { + glEnable(GL_TEXTURE_2D); + } #endif clearview(-1);