mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-01-09 14:27:06 +00:00
[client] egl: dont re-setup the fps texture on each update
This commit is contained in:
parent
28c93ef5ac
commit
e8c949c1e7
@ -44,6 +44,7 @@ struct EGL_FPS
|
|||||||
EGL_Model * model;
|
EGL_Model * model;
|
||||||
|
|
||||||
bool ready;
|
bool ready;
|
||||||
|
int iwidth, iheight;
|
||||||
float width, height;
|
float width, height;
|
||||||
|
|
||||||
// uniforms
|
// uniforms
|
||||||
@ -144,6 +145,13 @@ void egl_fps_update(EGL_FPS * fps, const float avgFPS, const float renderFPS)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fps->iwidth != bmp->width || fps->iheight != bmp->height)
|
||||||
|
{
|
||||||
|
fps->iwidth = bmp->width;
|
||||||
|
fps->iheight = bmp->height;
|
||||||
|
fps->width = (float)bmp->width;
|
||||||
|
fps->height = (float)bmp->height;
|
||||||
|
|
||||||
egl_texture_setup(
|
egl_texture_setup(
|
||||||
fps->texture,
|
fps->texture,
|
||||||
EGL_PF_BGRA,
|
EGL_PF_BGRA,
|
||||||
@ -152,6 +160,7 @@ void egl_fps_update(EGL_FPS * fps, const float avgFPS, const float renderFPS)
|
|||||||
bmp->width * bmp->bpp,
|
bmp->width * bmp->bpp,
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
egl_texture_update
|
egl_texture_update
|
||||||
(
|
(
|
||||||
@ -159,10 +168,7 @@ void egl_fps_update(EGL_FPS * fps, const float avgFPS, const float renderFPS)
|
|||||||
bmp->pixels
|
bmp->pixels
|
||||||
);
|
);
|
||||||
|
|
||||||
fps->width = bmp->width;
|
|
||||||
fps->height = bmp->height;
|
|
||||||
fps->ready = true;
|
fps->ready = true;
|
||||||
|
|
||||||
fps->font->release(fps->fontObj, bmp);
|
fps->font->release(fps->fontObj, bmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user