// ------------------------------------------------------------------------ void createWhite(bool private_init = true) { #ifndef SERVER_ONLY glBindTexture(GL_TEXTURE_2D, m_texture_name); static int32_t data[4] = { -1, -1, -1, -1 }; glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 2, 2, 0, #ifdef USE_GLES2 GL_RGBA, #else GL_BGRA, #endif GL_UNSIGNED_BYTE, data); glTexImage2D(GL_TEXTURE_2D, 1, GL_RGBA, 1, 1, 0, #ifdef USE_GLES2 GL_RGBA, #else GL_BGRA, #endif GL_UNSIGNED_BYTE, data); glBindTexture(GL_TEXTURE_2D, 0); if (private_init) { m_width.store(2); m_height.store(2); } else { m_width.store(0); m_height.store(0); } #endif }
// ------------------------------------------------------------------------ void stopThreads() { m_max_threaded_load_obj.store(0); std::unique_lock<std::mutex> ul(m_thread_obj_mutex); m_threaded_functions.push_back([](){ return true; }); m_thread_obj_cv.notify_all(); ul.unlock(); for (std::thread& t : m_threaded_load_obj) { t.join(); } m_threaded_load_obj.clear(); }
// ------------------------------------------------------------------------ void createTransparent() { #ifndef SERVER_ONLY glBindTexture(GL_TEXTURE_2D, m_texture_name); static uint32_t data[4] = { 0, 0, 0, 0 }; glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 2, 2, 0, #ifdef USE_GLES2 GL_RGBA, #else GL_BGRA, #endif GL_UNSIGNED_BYTE, data); glTexImage2D(GL_TEXTURE_2D, 1, GL_RGBA, 1, 1, 0, #ifdef USE_GLES2 GL_RGBA, #else GL_BGRA, #endif GL_UNSIGNED_BYTE, data); glBindTexture(GL_TEXTURE_2D, 0); m_width.store(2); m_height.store(2); #endif }