我在这一行收到错误:
这是我的代码:
IMGUI_CHECKVERSION();
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); (void)io;
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;
io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
ImGui::StyleColorsDark();
ImGui_ImplGlfw_InitForOpenGL((GLFWwindow*)window.get(), true);
ImGui_ImplOpenGL3_Init("#version 410");
window->Vsync(true);
float lastTime = glfwGetTime();
while (window->ShouldClose()) {
Andromeda::Renderer::ClearCol(1, 0, 0, 1);
ImGui_ImplOpenGL3_NewFrame();
ImGui_ImplGlfw_NewFrame();
ImGui::NewFrame();
float delta = glfwGetTime() - lastTime;
lastTime = glfwGetTime();
{
ImGui::Begin("Hello World!");
ImGui::Text("beans");
ImGui::End();
}
ImGui::Render();
int display_w, display_h;
glfwGetFramebufferSize((GLFWwindow*)window.get(), &display_w, &display_h);
glViewport(0, 0, display_w, display_h);
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
if (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable) {
GLFWwindow* backupWindow = glfwGetCurrentContext();
ImGui::UpdatePlatformWindows();
ImGui::RenderPlatformWindowsDefault();
glfwMakeContextCurrent(backupWindow);
}
sandbox->Update(delta);
window->Poll();
}
ImGui_ImplOpenGL3_Shutdown();
ImGui_ImplGlfw_Shutdown();
ImGui::DestroyContext();
我将它构建到一个库中,如果它可以做任何事情来使它崩溃。