mirror of
https://github.com/edubart/otclient.git
synced 2025-10-17 04:53:27 +02:00
performance improvement, lock free render
This commit is contained in:
@@ -793,12 +793,24 @@ void X11Window::poll()
|
||||
|
||||
void X11Window::swapBuffers()
|
||||
{
|
||||
#if 0
|
||||
auto now = std::chrono::high_resolution_clock::now();
|
||||
auto gpuStart = now;
|
||||
static decltype(now) cpuStart;
|
||||
int cpu = std::chrono::duration_cast<std::chrono::nanoseconds>(now - cpuStart).count();
|
||||
#endif
|
||||
#ifndef OPENGL_ES2
|
||||
glFinish();
|
||||
glXSwapBuffers(m_display, m_window);
|
||||
#else
|
||||
eglSwapBuffers(m_eglDisplay, m_eglSurface);
|
||||
#endif
|
||||
#if 0
|
||||
now = std::chrono::high_resolution_clock::now();
|
||||
int gpu = std::chrono::duration_cast<std::chrono::nanoseconds>(now - gpuStart).count();
|
||||
cpuStart = now;
|
||||
dump << "cpu" << cpu << "gpu" << gpu;
|
||||
#endif
|
||||
}
|
||||
|
||||
void X11Window::showMouse()
|
||||
|
Reference in New Issue
Block a user