diff --git a/basegraph.cpp b/basegraph.cpp index c99aecf4..6c61c71d 100644 --- a/basegraph.cpp +++ b/basegraph.cpp @@ -363,20 +363,17 @@ void display_data::set_projection(int ed) { } - glUniform1i(glhr::current->tInvExpTable, glhr::INVERSE_EXP_BINDING); glActiveTexture(GL_TEXTURE0 + glhr::INVERSE_EXP_BINDING); glBindTexture(GL_TEXTURE_3D, invexpid); glActiveTexture(GL_TEXTURE0 + 0); - glUniform1f(glhr::current->uPRECX, solv::PRECX); - glUniform1f(glhr::current->uPRECY, solv::PRECY); - glUniform1f(glhr::current->uPRECZ, solv::PRECZ); + glhr::set_solv_prec(solv::PRECX, solv::PRECY, solv::PRECZ); } if(glhr::new_shader_projection == glhr::shader_projection::standardSL2) { - glUniform1f(glhr::current->uIndexSL, 0); - glUniform1i(glhr::current->uIterations, slr::steps); + glhr::set_index_sl(0); + glhr::set_sl_iterations(slr::steps); } auto cd = current_display; diff --git a/drawing.cpp b/drawing.cpp index dcfaf823..fbab8013 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -661,7 +661,7 @@ void dqi_poly::gldraw() { if(min_slr < max_slr) { min_slr++; - glUniform1f(glhr::current->uIndexSL, M_PI * min_slr); + glhr::set_index_sl(M_PI * min_slr); goto next_slr; } } @@ -1159,7 +1159,7 @@ void dqi_poly::draw() { min_slr = ceil((-zr - z) / M_PI); max_slr = floor((zr - z) / M_PI); if(min_slr > max_slr) return; - glUniform1f(glhr::current->uIndexSL, M_PI * min_slr); + glhr::set_index_sl(M_PI * min_slr); } set_width(get_width(this)); flags &= ~POLY_INVERSE; diff --git a/shaders.cpp b/shaders.cpp index 9fddda03..297272c5 100644 --- a/shaders.cpp +++ b/shaders.cpp @@ -381,6 +381,21 @@ struct GLprogram { }; +EX void set_index_sl(ld x) { + glUniform1f(glhr::current->uIndexSL, x); + } + +EX void set_sl_iterations(int steps) { + glUniform1i(glhr::current->uIterations, steps); + } + +EX void set_solv_prec(int x, int y, int z) { + glUniform1i(glhr::current->tInvExpTable, glhr::INVERSE_EXP_BINDING); + glUniform1f(glhr::current->uPRECX, x); + glUniform1f(glhr::current->uPRECY, y); + glUniform1f(glhr::current->uPRECZ, z); + } + GLprogram *programs[gmMAX][int(shader_projection::MAX)]; string stringbuilder() { return ""; }