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.


Topics - mitrious

Pages: [1]
1
General / Threads and Drawing
« on: September 23, 2012, 12:21:44 am »
Well, I'm creating a 2D game and using SFML, I've been wondering if it's worth dividing the logic and window handling of the game. Like this: putting the drawing and updating the window logic into one thread and the game logic in the main thread, making they work kinda together. I made a test to see if I could get it done and it seems like I can, at least I was drawing in one screen and updating logic on the other, but I didn't care so much about the FPS of both, I have an idea of how to do this, so I think it would work.

Anyways, is this a good idea?

2
Graphics / Shapes problem
« on: September 20, 2012, 01:20:10 pm »
Consider this simple class and main:

class Foo
{
public:
        Foo() { shape = new sf::CircleShape(100); }
        ~Foo() { delete shape; }
private:
        sf::CircleShape *shape;
};


int main(int argc, char **argv)
{

        Foo f;
        return 0;
}

If I run it it'll crash when trying to free memory allocated for shape when it's being deleted, on the destructor's call. If anyone could try to compile this simple code and see if it crashes it'd be much appreciated.

Pages: [1]
anything