Skip to content
Extraits de code Groupes Projets
Vérifiée Valider bb3b4356 rédigé par Kubat's avatar Kubat
Parcourir les fichiers

Small update

parent 7eb22890
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -138,28 +138,25 @@ MainWindow::HandleRender(void)
// Rendering
ImGui::Render();
/* Always redraw */
int w, h;
int __one__one = 1;
SDL_GetWindowSize(window, &w, &h);
mpv_opengl_fbo fbo = {
.fbo = 0,
.w = w,
.h = h,
};
mpv_render_param params[] = {
{MPV_RENDER_PARAM_OPENGL_FBO, &fbo},
{MPV_RENDER_PARAM_FLIP_Y, &__one__one},
{(mpv_render_param_type)0}
};
// mpv_render_context_render(mpv_gl, params);
SDL_Window* backup_current_window = SDL_GL_GetCurrentWindow();
SDL_GLContext backup_current_context = SDL_GL_GetCurrentContext();
ImGui::UpdatePlatformWindows();
ImGui::RenderPlatformWindowsDefault();
SDL_GL_MakeCurrent(backup_current_window, backup_current_context);
mpv_render_context_render(mpv_gl, params);
{
int w, h;
SDL_GetWindowSize(window, &w, &h);
fbo = {
.fbo = 0,
.w = w,
.h = h,
};
params[0] = {MPV_RENDER_PARAM_OPENGL_FBO, &fbo};
params[1] = {MPV_RENDER_PARAM_FLIP_Y, &__fbo_one};
params[2] = {(mpv_render_param_type)0};
mpv_render_context_render(mpv_gl, params);
}
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
......@@ -236,6 +233,9 @@ MainWindow::HandleLayers(void)
ImGui_ImplSDL2_NewFrame(window);
ImGui::NewFrame();
// ImGuiID dockspace_id = ImGui::GetID("MyDockSpace");
// ImGui::DockSpace(dockspace_id, ImVec2(0.0f, 0.0f));
// 1. Show the big demo window (Most of the sample code is in ImGui::ShowDemoWindow()! You can browse its code to learn more about Dear ImGui!).
if (show_demo_window)
ImGui::ShowDemoWindow(&show_demo_window);
......
......@@ -26,6 +26,10 @@ private:
bool done;
int __fbo_one = 1;
mpv_opengl_fbo fbo;
mpv_render_param params[3];
static Uint32 wakeup_on_mpv_render_update, wakeup_on_mpv_events; /* Need to be static */
static std::shared_ptr<MainWindow> self;
......
[Window][Debug##Default]
Pos=60,60
Size=400,400
Pos=629,35
Size=1219,824
Collapsed=0
[Window][Hello, world!]
ViewportPos=165,1
ViewportId=0xEBE6C6E6
Size=630,377
Pos=1450,62
Size=390,789
Collapsed=0
[Window][Dear ImGui Demo]
ViewportPos=1160,4
ViewportId=0xE927CF2F
Size=738,485
Pos=213,94
Size=418,784
Collapsed=0
[Window][Another Window]
......@@ -80,5 +78,11 @@ Pos=503,51
Size=771,465
Collapsed=0
[Window][Render]
Pos=25,17
Size=349,1016
Collapsed=0
[Docking][Data]
DockSpace ID=0xF852211D Pos=637,80 Size=1203,789 CentralNode=1
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter