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.


Messages - Jonny

Pages: 1 ... 6 7 [8]
106
Yep we use the openAL provided with SFML, unchanged. Those logs are from my windows 7 PC, using VS2013. I expect it should be reproducable on most, if not all windows machines. Haven't tested on other platforms though.

107
Sure:

AL lib: (EE) MMDevApiOpenPlayback: Device init failed: 0x80070490
Failed to open the audio device
An internal OpenAL call failed in SoundSource.cpp(37).
Expression:
   alGenSources(1, &m_source)
Error description:
   AL_INVALID_OPERATION
   The specified operation is not allowed in the current state.

An internal OpenAL call failed in SoundSource.cpp(38).
Expression:
   alSourcei(m_source, AL_BUFFER, 0)
Error description:
   AL_INVALID_OPERATION
   The specified operation is not allowed in the current state.

An internal OpenAL call failed in SoundSource.cpp(37).
Expression:
   alGenSources(1, &m_source)
Error description:
   AL_INVALID_OPERATION
   The specified operation is not allowed in the current state.

An internal OpenAL call failed in SoundSource.cpp(38).
Expression:
   alSourcei(m_source, AL_BUFFER, 0)
Error description:
   AL_INVALID_OPERATION
   The specified operation is not allowed in the current state.

An internal OpenAL call failed in SoundStream.cpp(280).
Expression:
   alGenBuffers(BufferCount, m_buffers)
Error description:
   AL_INVALID_OPERATION
   The specified operation is not allowed in the current state.

An internal OpenAL call failed in SoundStream.cpp(435).
Expression:
   alBufferData(buffer, m_format, data.samples, size, m_sampleRate)
Error description:
   AL_INVALID_OPERATION
   The specified operation is not allowed in the current state.

An internal OpenAL call failed in SoundStream.cpp(438).
Expression:
   alSourceQueueBuffers(m_source, 1, &buffer)
Error description:
   AL_INVALID_OPERATION
   The specified operation is not allowed in the current state.

An internal OpenAL call failed in SoundStream.cpp(435).
Expression:
   alBufferData(buffer, m_format, data.samples, size, m_sampleRate)
Error description:
   AL_INVALID_OPERATION
   The specified operation is not allowed in the current state.

An internal OpenAL call failed in SoundStream.cpp(438).
Expression:
   alSourceQueueBuffers(m_source, 1, &buffer)
Error description:
   AL_INVALID_OPERATION
   The specified operation is not allowed in the current state.

An internal OpenAL call failed in SoundStream.cpp(288).
Expression:
   alSourcePlay(m_source)
Error description:
   AL_INVALID_OPERATION
   The specified operation is not allowed in the current state.

An internal OpenAL call failed in SoundSource.cpp(177).
Expression:
   alGetSourcei(m_source, AL_SOURCE_STATE, &status)
Error description:
   AL_INVALID_OPERATION
   The specified operation is not allowed in the current state.

An internal OpenAL call failed in SoundStream.cpp(324).
Expression:
   alGetSourcei(m_source, AL_BUFFERS_PROCESSED, &nbProcessed)
Error description:
   AL_INVALID_OPERATION
   The specified operation is not allowed in the current state.

An internal OpenAL call failed in SoundSource.cpp(177).
Expression:
   alGetSourcei(m_source, AL_SOURCE_STATE, &status)
Error description:
   AL_INVALID_OPERATION
   The specified operation is not allowed in the current state.

An internal OpenAL call failed in SoundStream.cpp(386).
Expression:
   alSourceStop(m_source)
Error description:
   AL_INVALID_OPERATION
   The specified operation is not allowed in the current state.

An internal OpenAL call failed in SoundStream.cpp(465).
Expression:
   alGetSourcei(m_source, AL_BUFFERS_QUEUED, &nbQueued)
Error description:
   AL_INVALID_OPERATION
   The specified operation is not allowed in the current state.

An internal OpenAL call failed in SoundStream.cpp(392).
Expression:
   alSourcei(m_source, AL_BUFFER, 0)
Error description:
   AL_INVALID_OPERATION
   The specified operation is not allowed in the current state.

An internal OpenAL call failed in SoundStream.cpp(393).
Expression:
   alDeleteBuffers(BufferCount, m_buffers)
Error description:
   AL_INVALID_OPERATION
   The specified operation is not allowed in the current state.


 

That comes out if I use the same repro steps as above (disable device for first music declaration, enable for the second, and pressed space bar once)

The first mention of SoundStream.cpp is where space was pressed

108
Feature requests / Re-check if sound device becomes available after failing
« on: November 03, 2015, 12:05:58 pm »
Not sure whether this is considered a bug or not, but I'm having an issue with how SFML handles audio when the device is temporarily unavailable. If the device is unavailable when the first Sound/Music instance is created, but then becomes available later on (or even straight away after that) sounds will still never work.

Here's an example to reproduce:

#include <SFML\Graphics.hpp>
#include <SFML\Audio.hpp>

int main()
{
        sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
        sf::CircleShape shape(100.f);
        shape.setFillColor(sf::Color::Green);

        //first music instance, this is where the device is initialised
        //disable sound device for this line
        sf::Music firstMusic;

        //second music instance,
        //make sure device is enabled from here onwards
        sf::Music secondMusic;

        while (window.isOpen())
        {
                sf::Event event;
                while (window.pollEvent(event))
                {
                        if (event.type == sf::Event::Closed)
                                window.close();
                        if (event.type == sf::Event::KeyPressed)
                        {
                                if (event.key.code == sf::Keyboard::Space)
                                {
                                        //re-open the sound and play
                                        secondMusic.openFromFile("test.wav");
                                        secondMusic.play();
                                }
                        }
                }

                window.clear();
                window.draw(shape);
                window.display();
        }

        return 0;
}
 

If you stick a break point on the first and second music declarations, and make sure your sound playback device is disabled when the first one is executed, then enabled when the second is executed, you'll see the sound will never play. Ideally it would be good if it could check the status of the device at some point (When loading a sound/music? or even when playing them?) and try to open it again if it failed. I've had a look through the changes and I think it might have been something in this commit where the global device was changed:

https://github.com/SFML/SFML/commit/0ad401cc97e5577f594066d3c993daca803572e8


I tested the same thing using SFML 2.1 and as far as I can tell the behavior's the same

But I'm no expert so I'm hoping someone here might know a bit more.

Thanks!

Edit: This is happening on some released games (on a very specific platform) which is why I'm asking (I can see how it would seem a strange request otherwise!) where every few dozen start ups the sound device fails for an unknown reason, but it's usually available again straight after, however the sound will never return until the game has been closed and opened again.

109
Feature requests / Re: A couple suggestions
« on: August 24, 2015, 05:15:49 pm »
I don't think this conversation will ever lead anywhere productive at this point. Can't tell if we're either not understanding each other or we just have different opinions

Differing opinions, definitely. I don't really see how it's anything other than that?

Also, if we're going to start whipping out dictionary definitions in a feeble attempt at proving our opinions are correct, I advocate that these names shall be changed:

sf::Texture is NOT
"the feel, appearance, or consistency of a surface or a substance."

sf::Lock is NOT
"a mechanism for keeping a door, window, lid, or container fastened, typically operated by a key."

Amongst others. Also, ConvexShape isn't always convex. Also Microsoft is neither micro, nor soft. Wait... My chrome I'm using isn't chrome?!?!

A name is a name, just that. I actually agree that sound/music aren't really the best names for these things, but I haven't seen a single suggestion here (or anywhere else) which is any better. In particular your buffered/unbuffered suggestions are just as misleading as Hapax pointed out ( I won't comment on the barrage of pedantry which followed...)

Also, RE the various comments about documentation. If programming was so easy that someone could just pick it up without reading up, We'd all have a lot more industry competition. If you jump into something without knowing what you're doing then you should fully expect to have issues (not saying this is a bad way to do things, in fact, I frequently jump into things without even attempting to learn them, but then I only hold myself responsible when things go wrong)

110
Graphics / Re: Smoothing Shapes on a rendertexture
« on: June 26, 2014, 03:39:26 pm »
Given that I've barely dipped my toes into SFML's source code, I'll do it with a shader for now.

Thanks for the help

111
Graphics / Re: Smoothing Shapes on a rendertexture
« on: June 26, 2014, 02:30:39 pm »
I guess by your wording it is something which is planned on being implemented? In the mean time if anyone has suggestions on how to solve this it would be much appreciated.

112
Graphics / Smoothing Shapes on a rendertexture
« on: June 26, 2014, 01:01:48 pm »
Hello all,

I work with/for the user slotdev and I've only been using SFML and C++ for about a year now, so I'll apologize in advance for any silly mistakes, but here's my problem...

As we make games which need to be run at multiple different resolutions, depending on the hardware, we've previously had plenty of issues with artifacts appearing around sprites due to scaling. I came up for a fix for this by using an sf::RenderTexture as a sort of buffer which would essentially 'flatten' all the sprites at native resolution before scaling the RenderTexture and drawing it to the window. This worked perfectly in terms of removing the artifacts, but has causes some issues with sf::shapes...

We use sf::TriangleStrip to draw lines between winning symbol combinations, which could be at several positions in the window. Initially any section of the line which wasn't horizontal/vertical would look jagged, so we set antialiasing on in the window's contextsettings which solved that problem, however, now the shapes are getting drawn to the RenderTexture (which is set smooth, i might add), they are not smoothed by the window antialiasing so look jagged again.

does anyone know of a possible solution for this?

Here is some sample code which reproduces the problem:

#include <SFML\Graphics.hpp>

int main()
{
        //create the window
        sf::RenderWindow window(sf::VideoMode(500, 500), "Shape",sf::Style::Default,sf::ContextSettings(0,0,4));

        //create the shape
    sf::RectangleShape shape(sf::Vector2f(200,200));
    shape.setFillColor(sf::Color::Green);
        shape.setRotation(0);
        shape.setOrigin(100,100);
        shape.setPosition(250,250);

        //rendertexture stuff
        sf::RenderTexture windowTexture;
        windowTexture.create(500,500);
        windowTexture.setSmooth(true);
        sf::Sprite windowSprite;
        windowSprite.setTexture(windowTexture.getTexture());
        bool useRenderTexture=true;

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
                        if (event.type == sf::Event::KeyPressed)
                        {
                                switch (event.key.code)
                                {
                                        //rotate left
                                case sf::Keyboard::Left:
                                        shape.rotate(-5);
                                        break;
                                        //rotate right
                                case sf::Keyboard::Right:
                                        shape.rotate(5);
                                        break;
                                        //set window antialiasing OFF
                                case sf::Keyboard::Num1:
                                        window.create(sf::VideoMode(500, 500), "Shape",sf::Style::Default,sf::ContextSettings(0,0,0));
                                        break;
                                        //set window antialiasing ON
                                case sf::Keyboard::Num2:
                                        window.create(sf::VideoMode(500, 500), "Shape",sf::Style::Default,sf::ContextSettings(0,0,4));
                                        break;
                                        //toggle the use of the rendertexture
                                case sf::Keyboard::R:
                                        useRenderTexture=!useRenderTexture;
                                        break;
                                }
                        }
        }
                if(useRenderTexture)
                {
                        windowTexture.clear(sf::Color::Black);
                        windowTexture.draw(shape);
                        windowTexture.display();
                }

                window.clear(sf::Color::Black);
                if(useRenderTexture)
                        window.draw(windowSprite);
                else
                        window.draw(shape);
        window.display();
    }

    return 0;
}

to reproduce the problem, just push left/right to rotate the square slightly, then use 'R' to toggle the rendertexture on/off, and '1' or '2' to set the window antialiasing off/on.

Thanks in advance

113
General / Re: drawing x coord below 0
« on: February 05, 2014, 11:43:42 am »
What do you mean by 'not working'? it doesn't draw anything? or just draws in the wrong position?

have you debugged? without knowing what s, p, window, etc. are its difficult to help...

114
Graphics / Re: Complicated movement question
« on: February 03, 2014, 05:11:29 pm »
Might be worth looking up linear interpolation as well...

Pages: 1 ... 6 7 [8]
anything