Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include <string>
- #include<SFML\Graphics.hpp>
- #include"SFML\Window.hpp"
- #include"SFML\System.hpp"
- #include <windows.h>
- using namespace std;
- using namespace sf;
- int main()
- {
- string s="app";
- RenderWindow window(VideoMode(600,600),s);
- window.setFramerateLimit(60);
- while (window.isOpen())
- {
- Event event;
- while (window.pollEvent(event))
- {
- if (event.type == Event::Closed)
- window.close();
- if (event.KeyPressed && event.key.code == Keyboard::Escape)
- window.close();
- if (event.type == sf::Event::MouseButtonPressed)
- {
- if (event.mouseButton.button == Mouse::Right)
- {
- std::cout << "the right button was pressed" << std::endl;
- std::cout << "mouse x: " << event.mouseButton.x << std::endl;
- std::cout << "mouse y: " << event.mouseButton.y << std::endl;
- }
- }
- if (event.type==Event::MouseWheelMoved)
- {
- cout<<event.mouseWheel.delta;
- }
- }
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement