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

Pages: [1]
1
General / sf::RenderTexture in a thread
« on: December 18, 2013, 02:22:03 am »
Hi,

I've created a thread wich handles the graphic part of my program.
But I want to create a sf::RenderTexture in the main thread. I read in SFML tutorial that if we want to load texture in another thread we can do it by instanciating a sf::Context in the scope. When I want to call the "create" function of my renderTexture I have an openGL error.

What could be the error ?

2
General / Re: Help with Collision
« on: November 06, 2013, 11:27:00 am »
Maybe you could use getGlobalBounds() to get a FloatRect which allows you to use the intersects method of the Rect class ?

3
General / Issues with loadFromFiles() Methods.
« on: October 16, 2013, 11:28:31 pm »
Hi,

I'm having issues in a project using sfml 2.1.

I've made a clone of pacman. The game is working fine and all, but I always played it using Visual Studio 2012.

Some hours ago I tried to launch it using the binary, what was my surprise when I saw an error.

"Pacman has stopped working"...

I've fixed some bugs on some STL containers but now the game crashes randomly during the construction of my main class.
Sometimes it also generates everything and the game launches.

I really don't understand where the bug is from, maybe an heap corruption ?

        msvcr110.dll!malloc(unsigned int size) Ligne 91 C
        msvcr110.dll!operator new(unsigned int size) Ligne 59   C++

here is a part of the call stack, it shows a call to new then to malloc. I actually don't do any new in the constructor except for an sf::Texture, so I assume it's the calls into loadFromFile()... ? And even so, I made a project yesterday using the same functions in the SFML and I didn't get errors.

What could raise those errors ?

I'm also using windows 8.1 RTM, I don't think the SFML has issues with it :o

        this->_tileset.loadFromFile("./pacman_sprites.png");



        this->_font.loadFromFile("./font.ttf");

        this->_highScoreText.setFont(this->_font);
        this->_highScoreText.setString("HIGHSCORE");
        this->_highScoreText.setCharacterSize(16);
        this->_highScoreText.setColor(sf::Color::White);
        this->_highScoreText.setPosition(72, -8);

        this->_score.setFont(this->_font);
        this->_score.setString("0");
        this->_score.setCharacterSize(16);
        this->_score.setColor(sf::Color::White);
        this->_score.setPosition(56, 0);

        this->_start.setFont(this->_font);
        this->_start.setString("GET READY");
        this->_start.setCharacterSize(32);
        this->_start.setColor(sf::Color::White);
        int tmpStart = this->_win.getSize().x - this->_start.getGlobalBounds().width;
        this->_start.setPosition(tmpStart / 2, this->_win.getSize().y / 2 - this->_start.getGlobalBounds().height);

        sf::Texture *tmp = new sf::Texture();
        tmp->loadFromFile("./pacman_animations.png");
        this->_pacman.setPos(std::pair<float, float>(102, 180));
        this->_pacman.init(tmp);

That's the code written in the constructor, I don't see any weird settings. I've also made sure all the dependencies are in the good folders.

Do someone ever had this king of issues ?

Thanks !

4
General / Re: Triangulation and pathfinding implementation
« on: October 07, 2013, 11:01:16 pm »
The map is an agglomeration of polygons, they are generated using the Fortune's Algorithm. I store them in a container.

After this I place them in a 2d array, it represents the chunks and then I display only the chunks that have to be displayed.

Only the generation of the map takes time.

We will try the ray casting solution :)

5
General / Re: Triangulation and pathfinding implementation
« on: October 07, 2013, 10:25:22 pm »
Actually one of the solution is to generate the whole navigation mesh at the beggining, but it uses a lot of memory :p (My map is already taking a "bit" of memory).

6
General / Re: Triangulation and pathfinding implementation
« on: October 07, 2013, 08:10:37 pm »
Actually the map is Procedurally Generated, so we can't possibly have different maps :x

We've managed to implement a path finding, but it takes so much resources that it slows the game down. I still think it's possible to generate that navigation mesh.

The map is generated at the beggining of the game, the navigation mesh will also be generated during this step. We don't have different levels, just a map which can be huge :/ The main issue is that it takes a lot of resources...

7
Graphics / Re: Size max of an sf::Image
« on: October 02, 2013, 12:46:24 pm »
Ha my bad, yes I was using a RenderTexture, I named the variable _img so I got confused.

I'll look at thor::BigTexture, looks promising :)

I'll test the BigTexture and dividing the map into different chunks, I'll write a feedback here after :)

8
Graphics / Re: Size max of an sf::Image
« on: October 02, 2013, 11:50:16 am »
I see, thanks :)

I think I'll cut the map into chunks of 515*515.

9
Graphics / Size max of an sf::Image
« on: October 02, 2013, 11:29:46 am »
Hi,

I'm using the sf::Image to create an image of a map I've generated, the problem is that the map can be very huge (like 2000000px * 2000000px). But the size max of an sf::Image on my pc is 8192 * 8192.

I've decided to cut the map into different chunks so I can create Image of a smaller size.

But my pc has a "recent" graphic card, so I can do Images of 8192*8192, my question is, can I base the size of the chunk with the resolution of the user ?

For example, my resolution is 1920*1080, so I'll cut my chunks with this size, if a user has a resolution of 800*600, can I conclude I can do sf::Image of size 800*600 without having issues ?

Thanks !

Pages: [1]