Customise Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorised as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.

No cookies to display.

[ad_1]

I’ve a most important window whose loop is simply in this system and a Window class through which separate sf::RenderWindow objects are created and the loops for them are in std::thread, so when including a button to such a window, the animation is just ignored, though when you add precisely the identical button to the principle window, then every little thing will work advantageous.

I run this perform within the std::thread:

void Render() {

    sf::Occasion occasion;
    MSG msg = {};

    if (prepare_window_function != nullptr) {
        prepare_window_function(this);
    }

    whereas (Window_ptr->isOpen()) {

        whereas (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {

            if (msg.message == 160) {
                std::ofstream coords("DaTa_hats/_ParamS_/coords");
                coords << Window_ptr->getPosition().x << " " << Window_ptr->getPosition().y << std::endl;
                coords.shut();
            }

            TranslateMessage(&msg);
            DispatchMessage(&msg);
        }

        whereas (Window_ptr->pollEvent(occasion)) {

            if (occasion.kind == sf::Occasion::KeyReleased and occasion.key.code == sf::Keyboard::D) {
                Developer_Mode = 1;
            }
            if (occasion.kind == sf::Occasion::KeyReleased and occasion.key.code == sf::Keyboard::Escape) {
                Developer_Mode = 0;
            }

            Handle_Events(occasion);
        }
        
        Window_ptr->clear(sf::Shade(100, 100, 100, 255));

        if (Is_Rendering) {
            Draw_All();
        }

        Window_ptr->show();

        if (Pause_After_Start) {
            Pause();
            Pause_After_Start = 0;
        }
    }
}

Handel_Events and Draw_All are capabilities from a DLL, their contents are the identical because the capabilities of the principle window

[ad_2]

Leave a Reply

Your email address will not be published. Required fields are marked *