From c26b6ef574fe2fdab1d1cd8cd4bce8fb1645e2f7 Mon Sep 17 00:00:00 2001 From: Mikhail Burakov Date: Fri, 24 Mar 2023 07:47:29 +0100 Subject: Precreate window buffers on surfaces allocation --- main.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index fcc7511..2a5e7ff 100644 --- a/main.c +++ b/main.c @@ -35,18 +35,18 @@ int main(int argc, char* argv[]) { (void)argc; (void)argv; - struct AUTO(DecodeContext)* decode_context = DecodeContextCreate(); - if (!decode_context) { - LOG("Failed to create decode context"); - return EXIT_FAILURE; - } - struct AUTO(Window)* window = WindowCreate(); if (!window) { LOG("Failed to create window"); return EXIT_FAILURE; } + struct AUTO(DecodeContext)* decode_context = DecodeContextCreate(window); + if (!decode_context) { + LOG("Failed to create decode context"); + return EXIT_FAILURE; + } + int events_fd = WindowGetEventsFd(window); if (events_fd == -1) { LOG("Failed to get events fd"); @@ -84,11 +84,6 @@ int main(int argc, char* argv[]) { LOG("Failed to process window events"); return EXIT_FAILURE; } - const struct Frame* frame = DecodeContextGetFrame(decode_context); - if (frame && !WindowRenderFrame(window, frame)) { - LOG("Failed to render frame"); - return EXIT_FAILURE; - } } return EXIT_SUCCESS; -- cgit v1.2.3