Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - glu4it

Pages: [1]
1
Audio / Failed to open the audio device
« on: December 11, 2013, 12:29:37 pm »
Here is my code:
#include <SFML/Audio.hpp>

int main () {
sf::Music Music;
return 0;
}
 
I use Windows 8.1, sfml 2.1. Also i tried it on Windows 7.
and whenever I create my music file I get an error in the console window that says

"Failed to open the audio device"

I've added the audio to the linker.
Graphics and stuff work fine. I just started on music today and now I can't figure out the problem.
Help me please!

2
Audio / Music doesn't work
« on: November 20, 2013, 04:35:08 pm »
Hi. I make a game and try to add a music. But it doesn't work and game crashes :(
What i do wrong?
Music mMusic;
if(!mMusic.openFromFile("sounds/mMusic.mid"))
        return EXIT_FAILURE;
 

3
System / pause in a game
« on: November 15, 2013, 04:27:19 pm »
Hi. I'm making a game. And now i want to make a pause. Here my code
while(window.isOpen())
        if(Keyboard::isKeyPressed(Keyboard::Return))
        {
                while(window.isOpen())
                {

                                Event event;
                                while(window.pollEvent(event))
                                {
                                        if(event.type == Event::Closed)
                                                window.close();
                                        else
                                                if (event.type == Event::KeyPressed)
                                                        wait=false;
                                       
                                }
                                if(!wait){
                                               
                               
                                if(Keyboard::isKeyPressed(Keyboard::Escape))
                                {
                                        window.close();
                                }
                               
                               
                                if( Keyboard::isKeyPressed(Keyboard::P))
                                {
                                        wait = true;
                                }

                        window.display();
                  }

           }
 
So, after I press P in game, it stop's, I press P again but game still soped. And when I press another key game starts. What am I doing wrong?
PS Sorry for my bad English.

Pages: [1]