summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorMikhail Burakov <mburakov@mailbox.org>2023-03-24 07:47:29 +0100
committerMikhail Burakov <mburakov@mailbox.org>2023-03-24 07:47:29 +0100
commitc26b6ef574fe2fdab1d1cd8cd4bce8fb1645e2f7 (patch)
tree6896754bcf3ed8da5eff65097a4eb3cdf38149ad /main.c
parent844143e0c6cc1efa90bd27c9aa0cade7f7dd7930 (diff)
Precreate window buffers on surfaces allocation
Diffstat (limited to 'main.c')
-rw-r--r--main.c17
1 files changed, 6 insertions, 11 deletions
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;