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

Viewport works

parent e6e67685
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -4,14 +4,14 @@ Size=400,400
Collapsed=0
[Window][Hello, world!]
Pos=247,642
Size=641,293
Pos=745,530
Size=643,193
Collapsed=0
DockId=0x00000003,0
[Window][Dear ImGui Demo]
Pos=247,34
Size=641,606
Pos=745,128
Size=643,400
Collapsed=0
DockId=0x00000002,0
......@@ -81,7 +81,7 @@ Size=771,465
Collapsed=0
[Docking][Data]
DockNode ID=0x00000001 Pos=247,34 Size=641,901 Split=Y
DockNode ID=0x00000001 Pos=745,146 Size=643,595 Split=Y
DockNode ID=0x00000002 Parent=0x00000001 SizeRef=849,526 Selected=0xE927CF2F
DockNode ID=0x00000003 Parent=0x00000001 SizeRef=849,254 Selected=0xEBE6C6E6
......@@ -96,9 +96,7 @@ int main(int argc, char **argv)
ImGuiIO& io = ImGui::GetIO(); (void)io;
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
//io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
//io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
// Setup Dear ImGui style
io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
ImGui::StyleColorsDark();
ImGui_ImplSDL2_InitForOpenGL(window, gl_context);
ImGui_ImplOpenGL3_Init(glsl_version);
......@@ -231,6 +229,16 @@ int main(int argc, char **argv)
// Rendering
ImGui::Render();
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
if (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable)
{
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);
}
SDL_GL_SwapWindow(window);
}
......
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