Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include <iostream>
- #include <GL/glut.h>
- #include <GL/glext.h>
- void onMouse(int button, int state, int x, int y);
- int main(int argc, char** argv) {
- glutInit(&argc,argv);
- glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
- glutInitWindowPosition(100,100);
- glutInitWindowSize(256,256);
- glutCreateWindow("Mousewheel Test");
- glutMouseFunc(onMouse);
- glutMainLoop();
- }
- void onMouse(int button, int state, int x, int y){
- //Here, an event is generated for left, right, and middle clicks (though middle is the same as right...),
- //but not scrolling!
- std::cout << "Mouse event. Button: " << button << " state: " << state << 'n';
- }
Add Comment
Please, Sign In to add comment