[DEV] update of external of elog and ethread
This commit is contained in:
parent
3aafd851dc
commit
dd58d4e668
@ -38,29 +38,29 @@ gale::Thread::~Thread() {
|
||||
|
||||
void gale::Thread::start() {
|
||||
if (m_state == state_stop) {
|
||||
GALE_DEBUG("Allocate std11::thread [START]");
|
||||
GALE_DEBUG("Allocate std::thread [START]");
|
||||
m_state = state_starting;
|
||||
m_context = &gale::getContext();
|
||||
#if defined(__TARGET_OS__Android)
|
||||
pthread_create(&m_thread, nullptr, &gale::Thread::threadCallback, this);
|
||||
#else
|
||||
m_thread = std11::make_shared<std11::thread>(&gale::Thread::threadCall, this);
|
||||
m_thread = std::make_shared<std::thread>(&gale::Thread::threadCall, this);
|
||||
if (m_thread == nullptr) {
|
||||
GALE_ERROR("Can not create thread ...");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
//m_thread->detach();
|
||||
GALE_DEBUG("Allocate std11::thread [Set priority]");
|
||||
GALE_DEBUG("Allocate std::thread [Set priority]");
|
||||
// set priority
|
||||
|
||||
GALE_DEBUG("Allocate std11::thread [Register context]");
|
||||
GALE_DEBUG("Allocate std::thread [Register context]");
|
||||
// set association with the gale context ...
|
||||
//gale::contextRegisterThread(m_thread);
|
||||
|
||||
GALE_DEBUG("Allocate std11::thread [set State]");
|
||||
GALE_DEBUG("Allocate std::thread [set State]");
|
||||
m_state = state_running;
|
||||
GALE_DEBUG("Allocate std11::thread [STOP]");
|
||||
GALE_DEBUG("Allocate std::thread [STOP]");
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,7 +74,7 @@ void gale::Thread::stop() {
|
||||
GALE_INFO("wait Thread stopping");
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
}
|
||||
GALE_DEBUG("stop std11::thread [START]");
|
||||
GALE_DEBUG("stop std::thread [START]");
|
||||
#if defined(__TARGET_OS__Android)
|
||||
void* ret = nullptr;
|
||||
int val = pthread_join(m_thread, &ret);
|
||||
@ -82,15 +82,15 @@ void gale::Thread::stop() {
|
||||
m_thread->join();
|
||||
#endif
|
||||
//gale::contextUnRegisterThread(m_thread);
|
||||
GALE_DEBUG("stop std11::thread [delete]");
|
||||
GALE_DEBUG("stop std::thread [delete]");
|
||||
#if defined(__TARGET_OS__Android)
|
||||
|
||||
#else
|
||||
m_thread.reset();
|
||||
#endif
|
||||
GALE_DEBUG("stop std11::thread [set state]");
|
||||
GALE_DEBUG("stop std::thread [set state]");
|
||||
m_state = state_stop;
|
||||
GALE_DEBUG("stop std11::thread [STOP]");
|
||||
GALE_DEBUG("stop std::thread [STOP]");
|
||||
}
|
||||
|
||||
void gale::Thread::threadCall() {
|
||||
@ -98,12 +98,12 @@ void gale::Thread::threadCall() {
|
||||
gale::setContext(m_context);
|
||||
while (m_state != state_stopping) {
|
||||
if (m_state == state_starting) {
|
||||
GALE_DEBUG("run std11::thread [NOTHING to do]");
|
||||
GALE_DEBUG("run std::thread [NOTHING to do]");
|
||||
usleep(1000);
|
||||
continue;
|
||||
}
|
||||
if (onThreadCall() == true) {
|
||||
GALE_DEBUG("run std11::thread [AUTO STOP]");
|
||||
GALE_DEBUG("run std::thread [AUTO STOP]");
|
||||
m_state = state_stopping;
|
||||
return;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <etk/types.h>
|
||||
#include <etk/thread/tools.h>
|
||||
#include <ethread/tools.h>
|
||||
#include <gale/context/Context.h>
|
||||
|
||||
#if defined(__TARGET_OS__Android)
|
||||
@ -34,7 +34,7 @@ namespace gale {
|
||||
#if defined(__TARGET_OS__Android)
|
||||
pthread_t m_thread;
|
||||
#else
|
||||
std11::shared_ptr<std11::thread> m_thread;
|
||||
std::shared_ptr<std::thread> m_thread;
|
||||
#endif
|
||||
gale::Context* m_context;
|
||||
public:
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
#include <etk/tool.h>
|
||||
#include <etk/os/FSNode.h>
|
||||
#include <etk/thread/tools.h>
|
||||
#include <ethread/tools.h>
|
||||
#include <mutex>
|
||||
|
||||
#include <gale/gale.h>
|
||||
@ -39,16 +39,16 @@ static std::mutex& mutexInterface() {
|
||||
}
|
||||
|
||||
|
||||
static std11::mutex g_lockContextMap;
|
||||
static std::map<std11::thread::id, gale::Context*>& getContextList() {
|
||||
static std::map<std11::thread::id, gale::Context*> g_val;
|
||||
static std::mutex g_lockContextMap;
|
||||
static std::map<std::thread::id, gale::Context*>& getContextList() {
|
||||
static std::map<std::thread::id, gale::Context*> g_val;
|
||||
return g_val;
|
||||
}
|
||||
|
||||
gale::Context& gale::getContext() {
|
||||
std::map<std11::thread::id, gale::Context*>& list = getContextList();
|
||||
std::map<std::thread::id, gale::Context*>& list = getContextList();
|
||||
g_lockContextMap.lock();
|
||||
std::map<std11::thread::id, gale::Context*>::iterator it = list.find(std11::this_thread::get_id());
|
||||
std::map<std::thread::id, gale::Context*>::iterator it = list.find(std::this_thread::get_id());
|
||||
gale::Context* out = nullptr;
|
||||
if (it != list.end()) {
|
||||
out = it->second;
|
||||
@ -64,42 +64,42 @@ gale::Context& gale::getContext() {
|
||||
}
|
||||
|
||||
void gale::setContext(gale::Context* _context) {
|
||||
std::map<std11::thread::id, gale::Context*>& list = getContextList();
|
||||
//GALE_ERROR("Set context : " << std11::this_thread::get_id() << " context pointer : " << uint64_t(_context));
|
||||
std::map<std::thread::id, gale::Context*>& list = getContextList();
|
||||
//GALE_ERROR("Set context : " << std::this_thread::get_id() << " context pointer : " << uint64_t(_context));
|
||||
g_lockContextMap.lock();
|
||||
std::map<std11::thread::id, gale::Context*>::iterator it = list.find(std11::this_thread::get_id());
|
||||
std::map<std::thread::id, gale::Context*>::iterator it = list.find(std::this_thread::get_id());
|
||||
if (it == list.end()) {
|
||||
list.insert(std::pair<std11::thread::id, gale::Context*>(std11::this_thread::get_id(), _context));
|
||||
list.insert(std::pair<std::thread::id, gale::Context*>(std::this_thread::get_id(), _context));
|
||||
} else {
|
||||
it->second = _context;
|
||||
}
|
||||
g_lockContextMap.unlock();
|
||||
}
|
||||
|
||||
void gale::contextRegisterThread(std11::thread* _thread) {
|
||||
void gale::contextRegisterThread(std::thread* _thread) {
|
||||
if (_thread == nullptr) {
|
||||
return;
|
||||
}
|
||||
gale::Context* context = &gale::getContext();
|
||||
std::map<std11::thread::id, gale::Context*>& list = getContextList();
|
||||
std::map<std::thread::id, gale::Context*>& list = getContextList();
|
||||
//GALE_ERROR("REGISTER Thread : " << _thread->get_id() << " context pointer : " << uint64_t(context));
|
||||
g_lockContextMap.lock();
|
||||
std::map<std11::thread::id, gale::Context*>::iterator it = list.find(_thread->get_id());
|
||||
std::map<std::thread::id, gale::Context*>::iterator it = list.find(_thread->get_id());
|
||||
if (it == list.end()) {
|
||||
list.insert(std::pair<std11::thread::id, gale::Context*>(_thread->get_id(), context));
|
||||
list.insert(std::pair<std::thread::id, gale::Context*>(_thread->get_id(), context));
|
||||
} else {
|
||||
it->second = context;
|
||||
}
|
||||
g_lockContextMap.unlock();
|
||||
}
|
||||
|
||||
void gale::contextUnRegisterThread(std11::thread* _thread) {
|
||||
void gale::contextUnRegisterThread(std::thread* _thread) {
|
||||
if (_thread == nullptr) {
|
||||
return;
|
||||
}
|
||||
std::map<std11::thread::id, gale::Context*>& list = getContextList();
|
||||
std::map<std::thread::id, gale::Context*>& list = getContextList();
|
||||
g_lockContextMap.lock();
|
||||
std::map<std11::thread::id, gale::Context*>::iterator it = list.find(_thread->get_id());
|
||||
std::map<std::thread::id, gale::Context*>::iterator it = list.find(_thread->get_id());
|
||||
if (it != list.end()) {
|
||||
list.erase(it);
|
||||
}
|
||||
@ -204,7 +204,7 @@ gale::Context::Context(gale::Application* _application, int32_t _argc, const cha
|
||||
m_FpsFlush( "Flush ", false),
|
||||
m_windowsSize(320,480) {
|
||||
// set a basic
|
||||
etk::thread::setName("galeThread");
|
||||
ethread::setName("galeThread");
|
||||
if (m_application == nullptr) {
|
||||
GALE_CRITICAL("Can not start context with no Application ==> rtfm ...");
|
||||
}
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include <memory>
|
||||
#include <gale/orientation.h>
|
||||
#include <gale/context/clipBoard.h>
|
||||
#include <etk/thread/tools.h>
|
||||
#include <ethread/tools.h>
|
||||
|
||||
#define MAX_MANAGE_INPUT (15)
|
||||
|
||||
@ -308,11 +308,11 @@ namespace gale {
|
||||
* @brief When a new thread is created, it is needed to register it in the gale context interface to permit to get the context associated on it ...
|
||||
* @param[in] _thread generic C++11 thread handle
|
||||
*/
|
||||
void contextRegisterThread(std11::thread* _thread);
|
||||
void contextRegisterThread(std::thread* _thread);
|
||||
/**
|
||||
* @brief Remove an associated thread
|
||||
* @param[in] _thread generic C++11 thread handle
|
||||
*/
|
||||
void contextUnRegisterThread(std11::thread* _thread);
|
||||
void contextUnRegisterThread(std::thread* _thread);
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,6 @@
|
||||
#include <gale/debug.h>
|
||||
|
||||
int32_t gale::getLogId() {
|
||||
static int32_t g_val = etk::log::registerInstance("gale");
|
||||
static int32_t g_val = elog::registerInstance("gale");
|
||||
return g_val;
|
||||
}
|
||||
|
@ -7,12 +7,12 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <etk/log.h>
|
||||
#include <elog/log.h>
|
||||
|
||||
namespace gale {
|
||||
int32_t getLogId();
|
||||
};
|
||||
#define GALE_BASE(info,data) TK_LOG_BASE(gale::getLogId(),info,data)
|
||||
#define GALE_BASE(info,data) ELOG_BASE(gale::getLogId(),info,data)
|
||||
|
||||
#define GALE_PRINT(data) GALE_BASE(-1, data)
|
||||
#define GALE_CRITICAL(data) GALE_BASE(1, data)
|
||||
|
@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include <gale/key/Special.h>
|
||||
#include <etk/stdTools.h>
|
||||
|
||||
#define GALE_FLAG_KEY_CAPS_LOCK 0x00000001
|
||||
#define GALE_FLAG_KEY_SHIFT 0x00000002
|
||||
|
@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include <gale/key/keyboard.h>
|
||||
#include <etk/stdTools.h>
|
||||
|
||||
static const char* keyboardDescriptionString[] = {
|
||||
"keyboard_unknow",
|
||||
|
@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include <gale/key/status.h>
|
||||
#include <etk/stdTools.h>
|
||||
|
||||
static const char* statusDescriptionString[] = {
|
||||
"status_unknow",
|
||||
|
@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include <gale/key/type.h>
|
||||
#include <etk/stdTools.h>
|
||||
|
||||
|
||||
static const char* typeDescriptionString[] = {
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include <mutex>
|
||||
//#define DIRECT_MODE
|
||||
#include <gale/renderer/openGL/openGL-include.h>
|
||||
#include <etk/thread/tools.h>
|
||||
#include <ethread/tools.h>
|
||||
|
||||
#define CHECK_ERROR_OPENGL
|
||||
|
||||
@ -84,15 +84,15 @@ void gale::openGL::unLock() {
|
||||
mutexOpenGl().unlock();
|
||||
}
|
||||
|
||||
static std::vector<std11::thread::id>& getContextList() {
|
||||
static std::vector<std11::thread::id> g_val;
|
||||
static std::vector<std::thread::id>& getContextList() {
|
||||
static std::vector<std::thread::id> g_val;
|
||||
return g_val;
|
||||
}
|
||||
|
||||
bool gale::openGL::hasContext() {
|
||||
bool ret = false;
|
||||
mutexOpenGl().lock();
|
||||
auto it = std::find(getContextList().begin(), getContextList().end(), std11::this_thread::get_id());
|
||||
auto it = std::find(getContextList().begin(), getContextList().end(), std::this_thread::get_id());
|
||||
if (it != getContextList().end()) {
|
||||
ret = true;
|
||||
}
|
||||
@ -102,18 +102,18 @@ bool gale::openGL::hasContext() {
|
||||
|
||||
void gale::openGL::threadHasContext() {
|
||||
mutexOpenGl().lock();
|
||||
auto it = std::find(getContextList().begin(), getContextList().end(), std11::this_thread::get_id());
|
||||
auto it = std::find(getContextList().begin(), getContextList().end(), std::this_thread::get_id());
|
||||
if (it != getContextList().end()) {
|
||||
GALE_ERROR("set openGL context associate with threadID a second time ... ");
|
||||
} else {
|
||||
getContextList().push_back(std11::this_thread::get_id());
|
||||
getContextList().push_back(std::this_thread::get_id());
|
||||
}
|
||||
mutexOpenGl().unlock();
|
||||
}
|
||||
|
||||
void gale::openGL::threadHasNoMoreContext() {
|
||||
mutexOpenGl().lock();
|
||||
auto it = std::find(getContextList().begin(), getContextList().end(), std11::this_thread::get_id());
|
||||
auto it = std::find(getContextList().begin(), getContextList().end(), std::this_thread::get_id());
|
||||
if (it != getContextList().end()) {
|
||||
getContextList().erase(it);
|
||||
} else {
|
||||
|
@ -21,7 +21,7 @@ gale::resource::Manager::Manager() :
|
||||
}
|
||||
|
||||
gale::resource::Manager::~Manager() {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
bool hasError = false;
|
||||
if (m_resourceListToUpdate.size()!=0) {
|
||||
GALE_ERROR("Must not have anymore resources to update !!!");
|
||||
@ -38,7 +38,7 @@ gale::resource::Manager::~Manager() {
|
||||
}
|
||||
|
||||
void gale::resource::Manager::unInit() {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
display();
|
||||
m_resourceListToUpdate.clear();
|
||||
// remove all resources ...
|
||||
@ -59,7 +59,7 @@ void gale::resource::Manager::unInit() {
|
||||
void gale::resource::Manager::display() {
|
||||
GALE_INFO("Resources loaded : ");
|
||||
// remove all resources ...
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
for (auto &it : m_resourceList) {
|
||||
std::shared_ptr<gale::Resource> tmpRessource = it.lock();
|
||||
if (tmpRessource != nullptr) {
|
||||
@ -75,7 +75,7 @@ void gale::resource::Manager::display() {
|
||||
void gale::resource::Manager::reLoadResources() {
|
||||
GALE_INFO("------------- Resources re-loaded -------------");
|
||||
// remove all resources ...
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (m_resourceList.size() != 0) {
|
||||
for (size_t jjj=0; jjj<MAX_RESOURCE_LEVEL; jjj++) {
|
||||
GALE_INFO(" Reload level : " << jjj << "/" << (MAX_RESOURCE_LEVEL-1));
|
||||
@ -97,7 +97,7 @@ void gale::resource::Manager::reLoadResources() {
|
||||
|
||||
void gale::resource::Manager::update(const std::shared_ptr<gale::Resource>& _object) {
|
||||
// chek if not added before
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
for (auto &it : m_resourceListToUpdate) {
|
||||
if ( it != nullptr
|
||||
&& it == _object) {
|
||||
@ -117,7 +117,7 @@ void gale::resource::Manager::updateContext() {
|
||||
m_contextHasBeenRemoved = false;
|
||||
std::list<std::weak_ptr<gale::Resource>> resourceList;
|
||||
{
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
// Clean the update list
|
||||
m_resourceListToUpdate.clear();
|
||||
resourceList = m_resourceList;
|
||||
@ -132,7 +132,7 @@ void gale::resource::Manager::updateContext() {
|
||||
//GALE_DEBUG("Update context named : " << l_resourceList[iii]->getName());
|
||||
if (tmpRessource->updateContext() == false) {
|
||||
// Lock error ==> postponned
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
m_resourceListToUpdate.push_back(tmpRessource);
|
||||
}
|
||||
}
|
||||
@ -142,7 +142,7 @@ void gale::resource::Manager::updateContext() {
|
||||
} else {
|
||||
std::vector<std::shared_ptr<gale::Resource>> resourceListToUpdate;
|
||||
{
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
resourceListToUpdate = m_resourceListToUpdate;
|
||||
// Clean the update list
|
||||
m_resourceListToUpdate.clear();
|
||||
@ -154,7 +154,7 @@ void gale::resource::Manager::updateContext() {
|
||||
if ( it != nullptr
|
||||
&& jjj == it->getResourceLevel()) {
|
||||
if (it->updateContext() == false) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
// Lock error ==> postponned
|
||||
m_resourceListToUpdate.push_back(it);
|
||||
}
|
||||
@ -167,7 +167,7 @@ void gale::resource::Manager::updateContext() {
|
||||
|
||||
// in this case, it is really too late ...
|
||||
void gale::resource::Manager::contextHasBeenDestroyed() {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
for (auto &it : m_resourceList) {
|
||||
std::shared_ptr<gale::Resource> tmpRessource = it.lock();
|
||||
if (tmpRessource != nullptr) {
|
||||
@ -180,7 +180,7 @@ void gale::resource::Manager::contextHasBeenDestroyed() {
|
||||
|
||||
// internal generic keeper ...
|
||||
std::shared_ptr<gale::Resource> gale::resource::Manager::localKeep(const std::string& _filename) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
GALE_VERBOSE("KEEP (DEFAULT) : file : '" << _filename << "' in " << m_resourceList.size() << " resources");
|
||||
for (auto &it : m_resourceList) {
|
||||
std::shared_ptr<gale::Resource> tmpRessource = it.lock();
|
||||
@ -195,7 +195,7 @@ std::shared_ptr<gale::Resource> gale::resource::Manager::localKeep(const std::st
|
||||
|
||||
// internal generic keeper ...
|
||||
void gale::resource::Manager::localAdd(const std::shared_ptr<gale::Resource>& _object) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
//Add ... find empty slot
|
||||
for (auto &it : m_resourceList) {
|
||||
std::shared_ptr<gale::Resource> tmpRessource = it.lock();
|
||||
@ -210,7 +210,7 @@ void gale::resource::Manager::localAdd(const std::shared_ptr<gale::Resource>& _o
|
||||
|
||||
// in case of error ...
|
||||
void gale::resource::Manager::cleanInternalRemoved() {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
//GALE_INFO("remove object in Manager");
|
||||
updateContext();
|
||||
for (auto it(m_resourceList.begin()); it!=m_resourceList.end(); ++it) {
|
||||
|
@ -20,7 +20,7 @@ namespace gale {
|
||||
std::list<std::weak_ptr<gale::Resource>> m_resourceList;
|
||||
std::vector<std::shared_ptr<gale::Resource>> m_resourceListToUpdate;
|
||||
bool m_contextHasBeenRemoved;
|
||||
std11::recursive_mutex m_mutex;
|
||||
std::recursive_mutex m_mutex;
|
||||
public:
|
||||
/**
|
||||
* @brief initialize the internal variable
|
||||
|
@ -32,7 +32,7 @@ gale::resource::Program::Program() :
|
||||
|
||||
void gale::resource::Program::init(const std::string& _filename) {
|
||||
gale::Resource::init(_filename);
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
GALE_DEBUG("OGL : load PROGRAM '" << m_name << "'");
|
||||
// load data from file "all the time ..."
|
||||
|
||||
@ -167,7 +167,7 @@ static char l_bufferDisplayError[LOG_OGL_INTERNAL_BUFFER_LEN] = "";
|
||||
|
||||
|
||||
bool gale::resource::Program::checkIdValidity(int32_t _idElem) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if ( _idElem < 0
|
||||
|| (size_t)_idElem > m_elementList.size()) {
|
||||
return false;
|
||||
@ -176,7 +176,7 @@ bool gale::resource::Program::checkIdValidity(int32_t _idElem) {
|
||||
}
|
||||
|
||||
int32_t gale::resource::Program::getAttribute(std::string _elementName) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
// check if it exist previously :
|
||||
for(size_t iii=0; iii<m_elementList.size(); iii++) {
|
||||
if (m_elementList[iii].m_name == _elementName) {
|
||||
@ -209,7 +209,7 @@ int32_t gale::resource::Program::getAttribute(std::string _elementName) {
|
||||
}
|
||||
|
||||
int32_t gale::resource::Program::getUniform(std::string _elementName) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
// check if it exist previously :
|
||||
for(size_t iii=0; iii<m_elementList.size(); iii++) {
|
||||
if (m_elementList[iii].m_name == _elementName) {
|
||||
@ -242,7 +242,7 @@ int32_t gale::resource::Program::getUniform(std::string _elementName) {
|
||||
}
|
||||
|
||||
bool gale::resource::Program::updateContext() {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex, std11::defer_lock);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex, std::defer_lock);
|
||||
if (lock.try_lock() == false) {
|
||||
//Lock error ==> try later ...
|
||||
return false;
|
||||
@ -307,7 +307,7 @@ bool gale::resource::Program::updateContext() {
|
||||
}
|
||||
|
||||
void gale::resource::Program::removeContext() {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (m_exist == true) {
|
||||
gale::openGL::program::remove(m_program);
|
||||
m_program = 0;
|
||||
@ -320,7 +320,7 @@ void gale::resource::Program::removeContext() {
|
||||
}
|
||||
|
||||
void gale::resource::Program::removeContextToLate() {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
m_exist = false;
|
||||
m_program = 0;
|
||||
}
|
||||
@ -370,7 +370,7 @@ void gale::resource::Program::sendAttribute(int32_t _idElem,
|
||||
int32_t _nbElement,
|
||||
const void* _pointer,
|
||||
int32_t _jumpBetweenSample) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (m_exist == false) {
|
||||
return;
|
||||
}
|
||||
@ -399,7 +399,7 @@ void gale::resource::Program::sendAttributePointer(int32_t _idElem,
|
||||
int32_t _index,
|
||||
int32_t _jumpBetweenSample,
|
||||
int32_t _offset) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (m_exist == false) {
|
||||
return;
|
||||
}
|
||||
@ -437,7 +437,7 @@ void gale::resource::Program::sendAttributePointer(int32_t _idElem,
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void gale::resource::Program::uniformMatrix(int32_t _idElem, const mat4& _matrix, bool _transpose) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (m_exist == false) {
|
||||
return;
|
||||
}
|
||||
@ -463,7 +463,7 @@ void gale::resource::Program::uniformMatrix(int32_t _idElem, const mat4& _matrix
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void gale::resource::Program::uniform1f(int32_t _idElem, float _value1) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (m_exist == false) {
|
||||
return;
|
||||
}
|
||||
@ -478,7 +478,7 @@ void gale::resource::Program::uniform1f(int32_t _idElem, float _value1) {
|
||||
checkGlError("glUniform1f", __LINE__, _idElem);
|
||||
}
|
||||
void gale::resource::Program::uniform2f(int32_t _idElem, float _value1, float _value2) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (m_exist == false) {
|
||||
return;
|
||||
}
|
||||
@ -493,7 +493,7 @@ void gale::resource::Program::uniform2f(int32_t _idElem, float _value1, float _
|
||||
checkGlError("glUniform2f", __LINE__, _idElem);
|
||||
}
|
||||
void gale::resource::Program::uniform3f(int32_t _idElem, float _value1, float _value2, float _value3) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (m_exist == false) {
|
||||
return;
|
||||
}
|
||||
@ -508,7 +508,7 @@ void gale::resource::Program::uniform3f(int32_t _idElem, float _value1, float _v
|
||||
checkGlError("glUniform3f", __LINE__, _idElem);
|
||||
}
|
||||
void gale::resource::Program::uniform4f(int32_t _idElem, float _value1, float _value2, float _value3, float _value4) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (m_exist == false) {
|
||||
return;
|
||||
}
|
||||
@ -526,7 +526,7 @@ void gale::resource::Program::uniform4f(int32_t _idElem, float _value1, float _v
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void gale::resource::Program::uniform1i(int32_t _idElem, int32_t _value1) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (m_exist == false) {
|
||||
return;
|
||||
}
|
||||
@ -541,7 +541,7 @@ void gale::resource::Program::uniform1i(int32_t _idElem, int32_t _value1) {
|
||||
checkGlError("glUniform1i", __LINE__, _idElem);
|
||||
}
|
||||
void gale::resource::Program::uniform2i(int32_t _idElem, int32_t _value1, int32_t _value2) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (m_exist == false) {
|
||||
return;
|
||||
}
|
||||
@ -556,7 +556,7 @@ void gale::resource::Program::uniform2i(int32_t _idElem, int32_t _value1, int32_
|
||||
checkGlError("glUniform2i", __LINE__, _idElem);
|
||||
}
|
||||
void gale::resource::Program::uniform3i(int32_t _idElem, int32_t _value1, int32_t _value2, int32_t _value3) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (m_exist == false) {
|
||||
return;
|
||||
}
|
||||
@ -571,7 +571,7 @@ void gale::resource::Program::uniform3i(int32_t _idElem, int32_t _value1, int32_
|
||||
checkGlError("glUniform3i", __LINE__, _idElem);
|
||||
}
|
||||
void gale::resource::Program::uniform4i(int32_t _idElem, int32_t _value1, int32_t _value2, int32_t _value3, int32_t _value4) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (m_exist == false) {
|
||||
return;
|
||||
}
|
||||
@ -590,7 +590,7 @@ void gale::resource::Program::uniform4i(int32_t _idElem, int32_t _value1, int32_
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void gale::resource::Program::uniform1fv(int32_t _idElem, int32_t _nbElement, const float *_value) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (m_exist == false) {
|
||||
return;
|
||||
}
|
||||
@ -613,7 +613,7 @@ void gale::resource::Program::uniform1fv(int32_t _idElem, int32_t _nbElement, co
|
||||
checkGlError("glUniform1fv", __LINE__, _idElem);
|
||||
}
|
||||
void gale::resource::Program::uniform2fv(int32_t _idElem, int32_t _nbElement, const float *_value) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (m_exist == false) {
|
||||
return;
|
||||
}
|
||||
@ -636,7 +636,7 @@ void gale::resource::Program::uniform2fv(int32_t _idElem, int32_t _nbElement, co
|
||||
checkGlError("glUniform2fv", __LINE__, _idElem);
|
||||
}
|
||||
void gale::resource::Program::uniform3fv(int32_t _idElem, int32_t _nbElement, const float *_value) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (m_exist == false) {
|
||||
return;
|
||||
}
|
||||
@ -660,7 +660,7 @@ void gale::resource::Program::uniform3fv(int32_t _idElem, int32_t _nbElement, co
|
||||
checkGlError("glUniform3fv", __LINE__, _idElem);
|
||||
}
|
||||
void gale::resource::Program::uniform4fv(int32_t _idElem, int32_t _nbElement, const float *_value) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (m_exist == false) {
|
||||
return;
|
||||
}
|
||||
@ -687,7 +687,7 @@ void gale::resource::Program::uniform4fv(int32_t _idElem, int32_t _nbElement, co
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void gale::resource::Program::uniform1iv(int32_t _idElem, int32_t _nbElement, const int32_t *_value) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (m_exist == false) {
|
||||
return;
|
||||
}
|
||||
@ -710,7 +710,7 @@ void gale::resource::Program::uniform1iv(int32_t _idElem, int32_t _nbElement, co
|
||||
checkGlError("glUniform1iv", __LINE__, _idElem);
|
||||
}
|
||||
void gale::resource::Program::uniform2iv(int32_t _idElem, int32_t _nbElement, const int32_t *_value) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (m_exist == false) {
|
||||
return;
|
||||
}
|
||||
@ -733,7 +733,7 @@ void gale::resource::Program::uniform2iv(int32_t _idElem, int32_t _nbElement, co
|
||||
checkGlError("glUniform2iv", __LINE__, _idElem);
|
||||
}
|
||||
void gale::resource::Program::uniform3iv(int32_t _idElem, int32_t _nbElement, const int32_t *_value) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (m_exist == false) {
|
||||
return;
|
||||
}
|
||||
@ -756,7 +756,7 @@ void gale::resource::Program::uniform3iv(int32_t _idElem, int32_t _nbElement, co
|
||||
checkGlError("glUniform3iv", __LINE__, _idElem);
|
||||
}
|
||||
void gale::resource::Program::uniform4iv(int32_t _idElem, int32_t _nbElement, const int32_t *_value) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (m_exist == false) {
|
||||
return;
|
||||
}
|
||||
@ -798,7 +798,7 @@ void gale::resource::Program::use() {
|
||||
|
||||
|
||||
void gale::resource::Program::setTexture0(int32_t _idElem, int64_t _textureOpenGlID) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (m_exist == false) {
|
||||
return;
|
||||
}
|
||||
@ -824,7 +824,7 @@ void gale::resource::Program::setTexture0(int32_t _idElem, int64_t _textureOpenG
|
||||
}
|
||||
|
||||
void gale::resource::Program::setTexture1(int32_t _idElem, int64_t _textureOpenGlID) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (m_exist == false) {
|
||||
return;
|
||||
}
|
||||
@ -852,7 +852,7 @@ void gale::resource::Program::setTexture1(int32_t _idElem, int64_t _textureOpenG
|
||||
|
||||
void gale::resource::Program::unUse() {
|
||||
//GALE_WARNING("Will use program : " << m_program);
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (m_exist == false) {
|
||||
return;
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ namespace gale {
|
||||
*/
|
||||
class Resource : public std::enable_shared_from_this<gale::Resource> {
|
||||
protected:
|
||||
std11::recursive_mutex m_mutex;
|
||||
std::recursive_mutex m_mutex;
|
||||
protected:
|
||||
/**
|
||||
* @brief generic protected contructor (use factory to create this class)
|
||||
|
@ -28,7 +28,7 @@ gale::resource::Shader::Shader() :
|
||||
}
|
||||
|
||||
void gale::resource::Shader::init(const std::string& _filename) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
gale::Resource::init(_filename);
|
||||
GALE_DEBUG("OGL : load SHADER \"" << _filename << "\"");
|
||||
// load data from file "all the time ..."
|
||||
@ -45,14 +45,14 @@ void gale::resource::Shader::init(const std::string& _filename) {
|
||||
}
|
||||
|
||||
gale::resource::Shader::~Shader() {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
m_fileData.clear();
|
||||
gale::openGL::shader::remove(m_shader);
|
||||
m_exist = false;
|
||||
}
|
||||
|
||||
bool gale::resource::Shader::updateContext() {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex, std11::defer_lock);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex, std::defer_lock);
|
||||
if (lock.try_lock() == false) {
|
||||
//Lock error ==> try later ...
|
||||
return false;
|
||||
@ -88,7 +88,7 @@ bool gale::resource::Shader::updateContext() {
|
||||
}
|
||||
|
||||
void gale::resource::Shader::removeContext() {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (true == m_exist) {
|
||||
gale::openGL::shader::remove(m_shader);
|
||||
m_exist = false;
|
||||
@ -96,13 +96,13 @@ void gale::resource::Shader::removeContext() {
|
||||
}
|
||||
|
||||
void gale::resource::Shader::removeContextToLate() {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
m_exist = false;
|
||||
m_shader = 0;
|
||||
}
|
||||
|
||||
void gale::resource::Shader::reload() {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
etk::FSNode file(m_name);
|
||||
if (false == file.exist()) {
|
||||
GALE_CRITICAL("File does not Exist : '" << file << "' : '" << file.getFileSystemName() << "'");
|
||||
|
@ -57,7 +57,7 @@ gale::resource::Texture::~Texture() {
|
||||
}
|
||||
|
||||
bool gale::resource::Texture::updateContext() {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex, std11::defer_lock);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex, std::defer_lock);
|
||||
if (lock.try_lock() == false) {
|
||||
//Lock error ==> try later ...
|
||||
return false;
|
||||
@ -94,7 +94,7 @@ bool gale::resource::Texture::updateContext() {
|
||||
}
|
||||
|
||||
void gale::resource::Texture::removeContext() {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (true == m_loaded) {
|
||||
// Request remove texture ...
|
||||
GALE_INFO("TEXTURE: Rm [" << getId() << "] texId=" << m_texId);
|
||||
@ -104,13 +104,13 @@ void gale::resource::Texture::removeContext() {
|
||||
}
|
||||
|
||||
void gale::resource::Texture::removeContextToLate() {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
m_loaded = false;
|
||||
m_texId=0;
|
||||
}
|
||||
|
||||
void gale::resource::Texture::flush() {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
// request to the manager to be call at the next update ...
|
||||
getManager().update(std::dynamic_pointer_cast<gale::Resource>(shared_from_this()));
|
||||
}
|
||||
@ -119,7 +119,7 @@ void gale::resource::Texture::setTexture(const std::shared_ptr<std::vector<char>
|
||||
const ivec2& _size,
|
||||
enum gale::resource::Texture::dataType _dataType,
|
||||
enum gale::resource::Texture::color _dataColorSpace) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
m_data = _data;
|
||||
m_size = _size;
|
||||
m_endPointSize = _size;
|
||||
|
@ -39,7 +39,7 @@ void gale::resource::VirtualBufferObject::retreiveData() {
|
||||
}
|
||||
|
||||
bool gale::resource::VirtualBufferObject::updateContext() {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex, std11::defer_lock);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex, std::defer_lock);
|
||||
if (lock.try_lock() == false) {
|
||||
//Lock error ==> try later ...
|
||||
return false;
|
||||
@ -65,7 +65,7 @@ bool gale::resource::VirtualBufferObject::updateContext() {
|
||||
}
|
||||
|
||||
void gale::resource::VirtualBufferObject::removeContext() {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (true == m_exist) {
|
||||
gale::openGL::deleteBuffers(m_vbo);
|
||||
m_exist = false;
|
||||
@ -73,7 +73,7 @@ void gale::resource::VirtualBufferObject::removeContext() {
|
||||
}
|
||||
|
||||
void gale::resource::VirtualBufferObject::removeContextToLate() {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
m_exist = false;
|
||||
for (size_t iii=0; iii<m_vbo.size(); iii++) {
|
||||
m_vbo[iii] = 0;
|
||||
@ -81,19 +81,19 @@ void gale::resource::VirtualBufferObject::removeContextToLate() {
|
||||
}
|
||||
|
||||
void gale::resource::VirtualBufferObject::reload() {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
removeContext();
|
||||
updateContext();
|
||||
}
|
||||
|
||||
void gale::resource::VirtualBufferObject::flush() {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
// request to the manager to be call at the next update ...
|
||||
getManager().update(std::dynamic_pointer_cast<gale::Resource>(shared_from_this()));
|
||||
}
|
||||
|
||||
void gale::resource::VirtualBufferObject::pushOnBuffer(int32_t _id, const vec3& _data) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (m_vboSizeDataOffset[_id] == -1) {
|
||||
m_vboSizeDataOffset[_id] = 3;
|
||||
} else if (m_vboSizeDataOffset[_id] != 3) {
|
||||
@ -107,7 +107,7 @@ void gale::resource::VirtualBufferObject::pushOnBuffer(int32_t _id, const vec3&
|
||||
}
|
||||
|
||||
vec3 gale::resource::VirtualBufferObject::getOnBufferVec3(int32_t _id, int32_t _elementID) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if ((size_t)_elementID*3 > m_buffer[_id].size()) {
|
||||
return vec3(0,0,0);
|
||||
}
|
||||
@ -117,16 +117,16 @@ vec3 gale::resource::VirtualBufferObject::getOnBufferVec3(int32_t _id, int32_t _
|
||||
}
|
||||
|
||||
int32_t gale::resource::VirtualBufferObject::bufferSize(int32_t _id) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
return m_buffer[_id].size()/m_vboSizeDataOffset[_id];
|
||||
}
|
||||
int32_t gale::resource::VirtualBufferObject::getElementSize(int32_t _id) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
return m_vboSizeDataOffset[_id];
|
||||
}
|
||||
|
||||
void gale::resource::VirtualBufferObject::pushOnBuffer(int32_t _id, const vec2& _data) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (m_vboSizeDataOffset[_id] == -1) {
|
||||
m_vboSizeDataOffset[_id] = 2;
|
||||
} else if (m_vboSizeDataOffset[_id] != 2) {
|
||||
@ -139,7 +139,7 @@ void gale::resource::VirtualBufferObject::pushOnBuffer(int32_t _id, const vec2&
|
||||
}
|
||||
|
||||
vec2 gale::resource::VirtualBufferObject::getOnBufferVec2(int32_t _id, int32_t _elementID) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if ((size_t)_elementID*2 > m_buffer[_id].size()) {
|
||||
return vec2(0,0);
|
||||
}
|
||||
@ -149,7 +149,7 @@ vec2 gale::resource::VirtualBufferObject::getOnBufferVec2(int32_t _id, int32_t _
|
||||
|
||||
|
||||
void gale::resource::VirtualBufferObject::pushOnBuffer(int32_t _id, const etk::Color<float,4>& _data) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (m_vboSizeDataOffset[_id] == -1) {
|
||||
m_vboSizeDataOffset[_id] = 4;
|
||||
} else if (m_vboSizeDataOffset[_id] != 4) {
|
||||
@ -164,7 +164,7 @@ void gale::resource::VirtualBufferObject::pushOnBuffer(int32_t _id, const etk::C
|
||||
}
|
||||
|
||||
void gale::resource::VirtualBufferObject::pushOnBuffer(int32_t _id, const etk::Color<float,3>& _data) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (m_vboSizeDataOffset[_id] == -1) {
|
||||
m_vboSizeDataOffset[_id] = 3;
|
||||
} else if (m_vboSizeDataOffset[_id] != 3) {
|
||||
@ -178,7 +178,7 @@ void gale::resource::VirtualBufferObject::pushOnBuffer(int32_t _id, const etk::C
|
||||
}
|
||||
|
||||
void gale::resource::VirtualBufferObject::pushOnBuffer(int32_t _id, const etk::Color<float,2>& _data) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (m_vboSizeDataOffset[_id] == -1) {
|
||||
m_vboSizeDataOffset[_id] = 2;
|
||||
} else if (m_vboSizeDataOffset[_id] != 2) {
|
||||
@ -191,7 +191,7 @@ void gale::resource::VirtualBufferObject::pushOnBuffer(int32_t _id, const etk::C
|
||||
}
|
||||
|
||||
void gale::resource::VirtualBufferObject::pushOnBuffer(int32_t _id, const etk::Color<float,1>& _data) {
|
||||
std11::unique_lock<std11::recursive_mutex> lock(m_mutex);
|
||||
std::unique_lock<std::recursive_mutex> lock(m_mutex);
|
||||
if (m_vboSizeDataOffset[_id] == -1) {
|
||||
m_vboSizeDataOffset[_id] = 1;
|
||||
} else if (m_vboSizeDataOffset[_id] != 1) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user