mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-23 13:07:16 +00:00
accessors created for shader uniforms
This commit is contained in:
parent
339f6820fe
commit
caf838ed22
@ -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;
|
||||
|
@ -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;
|
||||
|
15
shaders.cpp
15
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 ""; }
|
||||
|
Loading…
Reference in New Issue
Block a user