debug window: use crosshair type from slider in shader
parent
9d2d0c8772
commit
52696f2dde
|
@ -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<int*>(parameters.at("crosshair_type_return")), 0, 1);
|
||||
ImGui::SliderInt("Block to place",
|
||||
&block_type, 2, 6);
|
||||
block_type, 2, 6);
|
||||
}
|
||||
|
||||
if(ImGui::CollapsingHeader("Mesh")){
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue