Move fps counter out of video buffer

In order to make video buffer more generic, move out its specific
responsibility to count the fps between the decoder and the renderer.
This commit is contained in:
Romain Vimont
2021-02-19 20:56:09 +01:00
parent 218636dc10
commit cb197ee3a2
9 changed files with 27 additions and 23 deletions

View File

@@ -14,6 +14,8 @@ struct video_buffer;
struct screen {
struct video_buffer *vb;
struct fps_counter *fps_counter;
SDL_Window *window;
SDL_Renderer *renderer;
SDL_Texture *texture;
@@ -38,6 +40,7 @@ struct screen {
#define SCREEN_INITIALIZER { \
.vb = NULL, \
.fps_counter = NULL, \
.window = NULL, \
.renderer = NULL, \
.texture = NULL, \
@@ -70,7 +73,8 @@ struct screen {
// initialize default values
void
screen_init(struct screen *screen, struct video_buffer *vb);
screen_init(struct screen *screen, struct video_buffer *vb,
struct fps_counter *fps_counter);
// initialize screen, create window, renderer and texture (window is hidden)
// window_x and window_y accept SC_WINDOW_POSITION_UNDEFINED