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 - Gikkman

Pages: [1]
1
System / Re: Ending thread causes fullscreen window to flicker
« on: March 06, 2013, 09:22:08 am »
Tried eXpl0it3r's latest nightly build but that did not remove the flicker.

I tried running my own code on my computer at home (on a gFoce GTX 660) and I did not have the flicker problem. So it is most likely hardware / drivers related.

Thanks for the help :-)

2
System / Re: Ending thread causes fullscreen window to flicker
« on: March 05, 2013, 04:29:51 pm »
Leaving out the sf::RenderTexture removes the flicker.

Declaring a sf::Context creates the flicker.

(Declaring a sf::Texture also creates the flicker).

OS: Windows 7 Enterprise.
Graphics card: nVidia Quadro 2000
Drivers are up to date.

Uses SFML 2.0 RC (downloaded at 13-01-30 from SFML's page)
Using Visual Studio 2010 Ultimate.

3
System / Ending thread causes fullscreen window to flicker
« on: March 05, 2013, 04:07:53 pm »
Hi.

First of, thanks for a very well made library. It's easy to use, well documented and fast to get used to.

I have however run into a small problem I can't seem to solve by myself:
If I run my application in fullscreen mode and create a secondary thread, the render window will flicker quickly when the thread ends. This does not occur however if I alt-tab to show the console ontop of the render window, or if I choose to run the application in windowed mode.

I'm guessing it has something to do with accessing OpenGL functions in the secondary thread but how can I load OpenGL resources in a background thread without creating the annoying flicker.

Here is some minimal code to recreate the event:

#include <SFML\System.hpp>
#include <SFML\Window.hpp>
#include <SFML\Graphics.hpp>

void threadFunc(){
        sf::Clock clock;
        sf::Time time = sf::seconds(2);

        sf::RenderTexture t;
        while(clock.getElapsedTime().asSeconds() < time.asSeconds() )
        {
        }
}

int main(){
    sf::RenderWindow window(sf::VideoMode(1920,1080), "Test", sf::Style::Fullscreen );
       
        sf::Thread thread(threadFunc); 
        thread.launch();

    while (window.isOpen())
    {
                if(sf::Keyboard::isKeyPressed(sf::Keyboard::Escape) )
                        window.close();

        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear(sf::Color::Blue);
        window.display();
    }

    return 0;

}

Hope someone can assist me.

Thanks // Simon (aka. Gikkman)

Pages: [1]