Use the keyboard around the key to move the image left and right,
GLM::MAT4 Trans; 0.0f 0.0f )); " Transform " 1, Gl_false, Glm::value_ptr (trans));
1 voidProcessInput (glfwwindow*window)2 {3 if(Glfwgetkey (window, glfw_key_escape) = =glfw_press)4Glfwsetwindowshouldclose (window,true);5 if(Glfwgetkey (window, glfw_key_left) = =glfw_press)6 {7Translation-=0.001f;8 if(Translation <=-0.5f)9Translation =-0.5f;Ten } One A if(Glfwgetkey (window, glfw_key_right) = =glfw_press) - { -Translation + =0.001f; the if(Translation >=0.5f) -Translation =0.5f; - } -}
Up and down keys adjust the two texture visibility scales of an image
1Ourshader.setfloat ("Mixvalue", mixvalue);2 voidProcessInput (glfwwindow*window)3 {4 if(Glfwgetkey (window, glfw_key_escape) = =glfw_press)5Glfwsetwindowshouldclose (window,true);6 7 //control the visibility ratio of two textures with keyboard up and down keys8 if(Glfwgetkey (window, glfw_key_up) = =glfw_press)9 {TenMixvalue + =0.001f; One if(Mixvalue >=1.0f) AMixvalue =1.0f; - } - if(Glfwgetkey (window, glfw_key_down) = =glfw_press) the { -Mixvalue-=0.001f; - if(Mixvalue <=0.0f) -Mixvalue =0.0f; + } -}
Use the keyboard around the key to move the image left and right, the upper and lower keys to make the image two texture visibility scale up and down