From 07830224a80e564eccc9122ea068111838c19dd8 Mon Sep 17 00:00:00 2001
From: Kubat <mael.martin31@gmail.com>
Date: Tue, 16 Jun 2020 19:55:47 +0200
Subject: [PATCH] Clean stuff

---
 main.cpp | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/main.cpp b/main.cpp
index 7266549..fa6c0b3 100644
--- a/main.cpp
+++ b/main.cpp
@@ -137,11 +137,6 @@ int main(int argc, char **argv)
         return 1;
     }
 
-    // Bind mpv and sdl
-    SDL_GLContext glcontext = SDL_GL_CreateContext(window);
-    if (!glcontext)
-        die("failed to create SDL GL context");
-
     // TODO Name correctly those things
     int __one[] = {1};
     auto __something = (mpv_opengl_init_params){
@@ -170,7 +165,7 @@ int main(int argc, char **argv)
     if (mpv_render_context_create(&mpv_gl, mpv, params) < 0)
         die("failed to initialize mpv GL context");
 
-      // We use events for thread-safe notification of the SDL main loop.
+    // We use events for thread-safe notification of the SDL main loop.
     // Generally, the wakeup callbacks (set further below) should do as least
     // work as possible, and merely wake up another thread to do actual work.
     // On SDL, waking up the mainloop is the ideal course of action. SDL's
@@ -181,7 +176,7 @@ int main(int argc, char **argv)
         wakeup_on_mpv_events == (Uint32)-1)
         die("could not register events");
 
-     // When normal mpv events are available.
+    // When normal mpv events are available.
     mpv_set_wakeup_callback(mpv, on_mpv_events, NULL);
 
     // When there is a need to call mpv_render_context_update(), which can
@@ -301,13 +296,13 @@ int main(int argc, char **argv)
         if (redraw)
         {
             int w, h;
+            int __one__one = 1;
+            SDL_GetWindowSize(window, &w, &h);
             auto __thing1 = (mpv_opengl_fbo){
                 .fbo = 0,
                 .w = w,
                 .h = h,
             };
-            int __one__one = 1;
-            SDL_GetWindowSize(window, &w, &h);
             mpv_render_param params[] = {
                 // Specify the default framebuffer (0) as target. This will
                 // render onto the entire screen. If you want to show the video
@@ -321,7 +316,6 @@ int main(int argc, char **argv)
             // See render_gl.h on what OpenGL environment mpv expects, and
             // other API details.
             mpv_render_context_render(mpv_gl, params);
-            // SDL_GL_SwapWindow(window);
         }
 
         // Start the Dear ImGui frame
-- 
GitLab