Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifdef SFML_STATIC
- #pragma comment(lib, "glew.lib")
- #pragma comment(lib, "freetype.lib")
- #pragma comment(lib, "jpeg.lib")
- #pragma comment(lib, "opengl32.lib")
- #pragma comment(lib, "winmm.lib")
- #pragma comment(lib, "gdi32.lib")
- #endif // SFML_STATIC
- #include <SFML/Graphics.hpp>
- #include <SFML/Audio.hpp>
- #include <iostream>
- int main()
- {
- sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
- sf::CircleShape shape(100.f);
- shape.setFillColor(sf::Color::Green);
- while (window.isOpen())
- {
- sf::SoundBuffer buffer;
- sf::Event event;
- sf::Sound sound;
- if (sound.getStatus() == 2){
- std::cout << "HOLY SHIT ITS PLAYING";
- }
- else if (sound.getStatus() == 0){
- std::cout << "0";
- }
- while (window.pollEvent(event))
- {
- if (sf::Mouse::isButtonPressed(sf::Mouse::Left)){
- if (!buffer.loadFromFile("01.wav")){
- std::cout << "Failure";
- }
- sound.setBuffer(buffer);
- sound.play();
- //std::cout << "Playing sound";
- sound.setVolume(100);
- }
- if (event.type == sf::Event::Closed)
- window.close();
- }
- window.clear();
- window.draw(shape);
- window.display();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement