raster render almost done

This commit is contained in:
benkyd
2022-11-02 12:09:55 +00:00
parent b20caafa0e
commit 01d20b2812
17 changed files with 244 additions and 83 deletions

View File

@@ -73,6 +73,11 @@ KeyCallback Window::getKeyCallback()
bool Window::newFrame()
{
glfwPollEvents();
if (mWinMode == WIN_MODE_FPS)
{
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_HIDDEN);
glfwSetCursorPos(window, (double)width / 2, (double)height / 2);
}
if (glfwWindowShouldClose(window)) { return false; }
glfwGetWindowSize(window, &width, &height);
@@ -84,22 +89,16 @@ bool Window::newFrame()
ImGui_ImplGlfw_NewFrame();
ImGui::NewFrame();
ImGui::Begin("main", nullptr, WINDOW_FLAGS);
ImGui::SetWindowPos(ImVec2(0, 0));
ImGui::SetWindowSize(ImVec2(width, height));
// ImGui::Begin("main", nullptr, WINDOW_FLAGS);
// ImGui::SetWindowPos(ImVec2(0, 0));
// ImGui::SetWindowSize(ImVec2(width, height));
return true;
}
void Window::render()
{
if (mWinMode == WIN_MODE_FPS)
{
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_HIDDEN);
glfwSetCursorPos(window, (double)width / 2, (double)height / 2);
}
ImGui::End();
// ImGui::End();
ImGui::Render();
auto io = ImGui::GetIO();
glViewport(0, 0, (int)io.DisplaySize.x, (int)io.DisplaySize.y);