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

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.