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

Pages: [1]
1
Window / Re: Cannot get window from its handle
« on: June 07, 2018, 05:00:19 pm »
Maybe physics and networking between client and server, i'm not sure yet. I'm very new to C, i was programming on Lua and JavaScript before.

2
Window / Re: Cannot get window from its handle
« on: June 07, 2018, 04:43:11 pm »
I want to render a game from a separate thread because rendering from main will block everything else

3
Window / Re: Cannot get window from its handle
« on: June 07, 2018, 04:34:29 pm »
Thanks!

May i ask how do i get the window from it's handle to manipulate it from another separate thread?

4
Window / Cannot get window from its handle
« on: June 07, 2018, 04:18:18 pm »
When i try to get existing window by handle, application crashes returning code -1073740771 (0xC000041D)

#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
#include <math.h>
#include <gui.h>

void shutdown(){
    exit(0);
}

void render(sf::WindowHandle windowhandle){

    printf("Starting render thread for window %u...",(unsigned int)windowhandle);

    sf::RenderWindow window(windowhandle); //crash

    /*
    while(window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event)){
            if (event.type == sf::Event::Closed)
                shutdown();
        }

        ...

        window.display();

    }
    */


}

int main(){

    sf::RenderWindow window(sf::VideoMode(800,600),"cool thinge",sf::Style::Close);
    window.setVerticalSyncEnabled(true);

    sf::Thread thrender(&render,window.getSystemHandle());
    thrender.launch();

    return 0;
}
 

Pages: [1]