|
@@ -70,6 +70,7 @@ int main(int, char**)
|
|
|
bool done = false;
|
|
|
while (!done)
|
|
|
{
|
|
|
+ // Poll and handle events (inputs, window resize, etc.)
|
|
|
// You can read the io.WantCaptureMouse, io.WantCaptureKeyboard flags to tell if dear imgui wants to use your inputs.
|
|
|
// - When io.WantCaptureMouse is true, do not dispatch mouse input data to your main application.
|
|
|
// - When io.WantCaptureKeyboard is true, do not dispatch keyboard input data to your main application.
|
|
@@ -81,8 +82,11 @@ int main(int, char**)
|
|
|
if (event.type == SDL_QUIT)
|
|
|
done = true;
|
|
|
}
|
|
|
+
|
|
|
+ // Start the ImGui frame
|
|
|
ImGui_ImplOpenGL2_NewFrame();
|
|
|
ImGui_ImplSDL2_NewFrame(window);
|
|
|
+ ImGui::NewFrame();
|
|
|
|
|
|
// 1. Show a simple window.
|
|
|
// Tip: if we don't call ImGui::Begin()/ImGui::End() the widgets automatically appears in a window called "Debug".
|
|
@@ -122,11 +126,11 @@ int main(int, char**)
|
|
|
}
|
|
|
|
|
|
// Rendering
|
|
|
+ ImGui::Render();
|
|
|
glViewport(0, 0, (int)io.DisplaySize.x, (int)io.DisplaySize.y);
|
|
|
glClearColor(clear_color.x, clear_color.y, clear_color.z, clear_color.w);
|
|
|
glClear(GL_COLOR_BUFFER_BIT);
|
|
|
//glUseProgram(0); // You may want this if using this code in an OpenGL 3+ context where shaders may be bound
|
|
|
- ImGui::Render();
|
|
|
ImGui_ImplOpenGL2_RenderDrawData(ImGui::GetDrawData());
|
|
|
SDL_GL_SwapWindow(window);
|
|
|
}
|