Added AABBs Added code examples Added experimental support for texture arrays (1D/2D) Added initialisers (new way of initialising modules) Added global headers (Plus a global header generator script) Added pattern support for directory Added support for spinlocks critical section on Windows Added NzRenderWindow::SetFramerateLimit Core project now includes Mathematics files Fixed color implementation using double Fixed declaration needing renderer include Fixed MLT not clearing nextFree(File/Line) after Free Fixed move operators not being noexcept Fixed thread-safety (Now working correctly - If I'm lucky) Moved Resource to core New interface for modules New interface for the renderer Put some global functions to anonymous namespace Removed empty modules Renamed ThreadCondition to ConditionVariable Replaced redirect to cerr log option by duplicate to cout Setting mouse position relative to a window will make this window ignore the event Shaders sending methods no longer takes the uniform variable name (it's using ID instead) Using new OpenGL 4.3 header
66 lines
1.3 KiB
C++
66 lines
1.3 KiB
C++
// Copyright (C) 2012 Jérôme Leclercq
|
|
// This file is part of the "Nazara Engine".
|
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
|
|
|
// Inspiré du code de la SFML par Laurent Gomila
|
|
|
|
#pragma once
|
|
|
|
#ifndef NAZARA_THREAD_HPP
|
|
#define NAZARA_THREAD_HPP
|
|
|
|
#include <Nazara/Prerequesites.hpp>
|
|
#include <Nazara/Core/Functor.hpp>
|
|
#include <Nazara/Core/NonCopyable.hpp>
|
|
|
|
class NzThreadImpl;
|
|
|
|
class NAZARA_API NzThread : NzNonCopyable
|
|
{
|
|
friend class NzThreadImpl;
|
|
|
|
public:
|
|
class NAZARA_API Id
|
|
{
|
|
friend class NzThread;
|
|
friend class NzThreadImpl;
|
|
|
|
public:
|
|
Id() = default;
|
|
Id(Id&& rhs) = default;
|
|
~Id();
|
|
|
|
Id& operator=(Id&& rhs) = default;
|
|
bool operator==(const Id& rhs) const;
|
|
bool operator!=(const Id& rhs) const;
|
|
|
|
private:
|
|
Id(void* handle) : m_handle(handle) {}
|
|
Id(const NzThreadImpl* thread);
|
|
|
|
void* m_handle = nullptr;
|
|
};
|
|
|
|
template<typename F> NzThread(F function);
|
|
template<typename F, typename... Args> NzThread(F function, Args... args);
|
|
~NzThread();
|
|
|
|
Id GetId() const;
|
|
bool IsCurrent() const;
|
|
void Launch(bool independent = false);
|
|
void Join();
|
|
void Terminate();
|
|
|
|
static Id GetCurrentId();
|
|
static void Sleep(nzUInt32 time);
|
|
|
|
private:
|
|
NzFunctor* m_func;
|
|
NzThreadImpl* m_impl;
|
|
bool m_independent;
|
|
};
|
|
|
|
#include <Nazara/Core/Thread.inl>
|
|
|
|
#endif // NAZARA_THREAD_HPP
|