From 68c7514c2c45c2d048fcd7d7b4723a3e1fba33c5 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 26 Oct 2019 17:02:20 +0200 Subject: [PATCH] clear shaders on resetGL --- basegraph.cpp | 4 ++++ raycaster.cpp | 2 +- shaders.cpp | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/basegraph.cpp b/basegraph.cpp index 7ed75bb8..a3152e45 100644 --- a/basegraph.cpp +++ b/basegraph.cpp @@ -596,6 +596,10 @@ EX void resetGL() { if(GDIM == 3 && !floor_textures) make_floor_textures(); #endif cgi.initPolyForGL(); + compiled_programs.clear(); + matched_programs.clear(); + glhr::current_glprogram = nullptr; + ray::reset_raycaster(); } #endif diff --git a/raycaster.cpp b/raycaster.cpp index 10f1717b..51080117 100644 --- a/raycaster.cpp +++ b/raycaster.cpp @@ -102,7 +102,7 @@ struct raycaster : glhr::GLprogram { shared_ptr our_raycaster; -void reset_raycaster() { our_raycaster = nullptr; }; +EX void reset_raycaster() { our_raycaster = nullptr; }; void enable_raycaster() { if(!our_raycaster) { diff --git a/shaders.cpp b/shaders.cpp index e672f74e..21e64ee5 100644 --- a/shaders.cpp +++ b/shaders.cpp @@ -37,9 +37,9 @@ constexpr int aTexture = 8; constexpr int INVERSE_EXP_BINDING = 2; #endif -map> compiled_programs; +EX map> compiled_programs; -map> matched_programs; +EX map> matched_programs; glhr::glmatrix model_orientation_gl() { glhr::glmatrix s = glhr::id;