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

Pages: [1]
1
Window / Re: exit behavies different by close console/window
« on: April 18, 2016, 01:52:22 pm »
 :D Got it, thanks~!

2
Window / exit behavies different by close console/window
« on: April 18, 2016, 01:40:54 pm »
Hi all, I just found my sfml demo has a different exit behaviour.
If i close the demo directlly by closing the console, my log shows that after the exit, it launches some destructor from another thread, but i'm not using multi-thread currentlly.
And the exec will crash if i don't comment the lock in my log class's write function.
std::lock_guard<std::mutex> lock(m_StreamMutex);

if (m_ConsoleOutput)
{
        m_Formatter(m_ConsoleStream, record);
        m_ConsoleStream << record.stream.str() << "\n";
}

if (m_FileOutput)
{
        m_Formatter(m_FileStream, record);
        m_FileStream << record.stream.str() << "\n";
        m_FileStream.flush();
}

Btw, it seems with this approach, my code won't reach those codes afert the main loop.

// Game Loop
sf::Clock clock;
sf::Event event;
sf::Int32 next_game_tick = clock.getElapsedTime().asMilliseconds();

while (window.isOpen() && example->running)
{
        // Update game logic TICKS_PER_SECOND times per second.
        int numLoops = 0;
        while (clock.getElapsedTime().asMilliseconds() > next_game_tick && numLoops < MAX_FRAMESKIP && example->running)
        {
                example->PreFixedUpdate();

                while (window.pollEvent(event))
                {
                        example->HandleEvent(event);
                }

                example->FixedUpdate();
                example->PostFixedUpdate();

                next_game_tick += SKIP_TICKS;
                numLoops++;
        }
        // display game object in maximum framerate.
        float dt = float(clock.getElapsedTime().asMilliseconds() + SKIP_TICKS - next_game_tick) / float(SKIP_TICKS);

        example->Update(dt);

        window.setActive();

        example->Draw(window);

        window.display();
        window.setActive(false);
}


If i close the window by the window's exit button, everything works fine.
And i can reach the codes after the main loop.

This is how i log the thread_id, if that matters.
void Simple(std::ostream& stream, const Record &record)
{
        stream << "[" << record.level << "]";

        if (!ThreadManager::IsMainThread())
                stream << "[" << std::this_thread::get_id() << "]";

        stream << "[" << record.func << "][" << record.line << "]: ";
};

What's wrong, why they behaves different. Am i missing sth?
I'm on windows with MSVC2010, sfml 2.3.2, c++11.


3
SFML projects / Re: A simple 3d engine fury3d
« on: January 30, 2016, 04:35:06 am »
Really cool! You should add the screenshot to the Github repo as well.
Thanks, ill add some screenshots later  ;D

4
SFML projects / A simple 3d engine fury3d
« on: January 29, 2016, 09:52:15 am »
Hi all, i'v just published my latest graphic rendering engine  ;D
It's called fury3d, as you see, i got the name from Brad Pitt's movie Fury  8)

It uses modern opengl(3.3) and c++11 features.
But dont be over excited, its just a simple an small project for study purpose.

Features includes:

c++11 support
opengl3.3+ support
osx, windows support (linux should work, i just don't have a test machin yet )
highly configurable rendering pipeline (using json file)
fbx model && light loading (just static models currentlly, will support skinned model later)
octree scene managing (mostly copied form ogre  :P)

https://github.com/sindney/fury3d

There's a screenshot in attachments.

Pages: [1]
anything