From 124ee9a467ef4e8c5815528ddd809849d6442be0 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 5 Mar 2020 22:35:06 +0100 Subject: [PATCH] fixed no-GL crash again --- glhr.cpp | 1 + shaders.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/glhr.cpp b/glhr.cpp index da4fe0dc..e23d454f 100644 --- a/glhr.cpp +++ b/glhr.cpp @@ -485,6 +485,7 @@ EX void full_enable(shared_ptr p) { auto& cur = current_glprogram; flagtype oldflags = cur ? cur->shader_flags : 0; if(p == cur) return; + if(!vid.usingGL) return; cur = p; GLERR("pre_switch_mode"); WITHSHADER({ diff --git a/shaders.cpp b/shaders.cpp index 301794e1..cbe6d2f6 100644 --- a/shaders.cpp +++ b/shaders.cpp @@ -286,7 +286,7 @@ shared_ptr write_shader(flagtype shader_flags) { vsh += varying; vsh += vmain; - if(glhr::noshaders) fsh = vsh = ""; + if(glhr::noshaders || !vid.usingGL) fsh = vsh = ""; string both = fsh + "*" + vsh + "*" + its(shader_flags); if(compiled_programs.count(both))