Guest User

Untitled

a guest
Mar 23rd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #pragma once
  2. #include <iostream>
  3.  
  4. #include <GL/glut.h>
  5. #include <GL/glext.h>
  6.  
  7. void onMouse(int button, int state, int x, int y);
  8.  
  9. int main(int argc, char** argv) {
  10. glutInit(&argc,argv);
  11. glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
  12. glutInitWindowPosition(100,100);
  13. glutInitWindowSize(256,256);
  14.  
  15. glutCreateWindow("Mousewheel Test");
  16.  
  17. glutMouseFunc(onMouse);
  18.  
  19. glutMainLoop();
  20. }
  21.  
  22. void onMouse(int button, int state, int x, int y){
  23. //Here, an event is generated for left, right, and middle clicks (though middle is the same as right...),
  24. //but not scrolling!
  25. std::cout << "Mouse event. Button: " << button << " state: " << state << 'n';
  26. }
Add Comment
Please, Sign In to add comment