diff --git a/src/debugwindow.cpp b/src/debugwindow.cpp index 870d18d..b82a5c9 100644 --- a/src/debugwindow.cpp +++ b/src/debugwindow.cpp @@ -59,7 +59,6 @@ namespace debug{ parameters[key] = value; } - int ch_type{0}; int block_type{0}; void show_debug_window(){ ImGui::Begin("Debug Window"); @@ -91,9 +90,9 @@ namespace debug{ } ImGui::SliderInt("Crosshair type", - &ch_type, 0, 1); + std::any_cast(parameters.at("crosshair_type_return")), 0, 1); ImGui::SliderInt("Block to place", - &block_type, 2, 6); + block_type, 2, 6); } if(ImGui::CollapsingHeader("Mesh")){ diff --git a/src/renderer.cpp b/src/renderer.cpp index 7f0180b..c402382 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp @@ -25,6 +25,7 @@ namespace renderer{ GLuint renderTexFrameBuffer, renderTex, renderTexDepthBuffer, quadVAO, quadVBO; int screenWidth, screenHeight; + int crosshair_type{0}; void init(GLFWwindow* window){ // Setup rendering @@ -104,6 +105,8 @@ namespace renderer{ glTexParameteri(GL_TEXTURE_2D_ARRAY,GL_TEXTURE_MAG_FILTER,GL_NEAREST); glTexParameteri(GL_TEXTURE_2D_ARRAY,GL_TEXTURE_WRAP_S,GL_REPEAT); glTexParameteri(GL_TEXTURE_2D_ARRAY,GL_TEXTURE_WRAP_T,GL_REPEAT); + + debug::window::set_parameter("crosshair_type_return", &crosshair_type); } @@ -238,7 +241,7 @@ namespace renderer{ quadShader->use(); quadShader->setInt("screenWidth", screenWidth); quadShader->setInt("screenHeight", screenHeight); - quadShader->setInt("crosshairType", 1); + quadShader->setInt("crosshairType", crosshair_type); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); glBindVertexArray(0);