Hi,
Is it possible to make ImGui windows fit e.g the "glfwCreateWindow", and adjust accordingly when the latter window is resized?
Regards,
p.
Call SetNextWindowPos() and SetNextWindowSize() every frame before creating your imgui window.
On 6 Dec 2016, at 07:35, Petter Wahlman notifications@github.com wrote:
Hi,
Is it possible to make ImGui windows fit e.g the "glfwCreateWindow", and adjust accordingly when the latter window is resized?
Regards,
p.
―
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
Wow, quick response!
Very impressive, thank you!
I am still unsure what values to put in SetNextWindowSize(), as GetWindowWidth et al. does not seem to reflect the GL window width (and does not change when I resize this window).
ImGui::GetWindowWidth() retrieve the width of the current ImGui window that was Begin-ed into.
Retrieving your GL window size is out of the scope of ImGui. See your glfw documentation.
Agreed. This is not directly related to ImGui.
If someone else needs this functionality, here is how I was able to get the C-style glfw callback to trigger my member function (and resize accordingly with ImGui::SetNextWindowSize.)
gui::init() {
....
glfwSetWindowUserPointer(window_, this);
glfwSetWindowSizeCallback(window_, resize_callback);
....
}
void resize_callback(GLFWwindow * window, int width, int height)
{
auto g = static_cast<gui *>(glfwGetWindowUserPointer(window));
g->window_resize(width, height);
}
Most helpful comment
Agreed. This is not directly related to ImGui.
If someone else needs this functionality, here is how I was able to get the C-style glfw callback to trigger my member function (and resize accordingly with ImGui::SetNextWindowSize.)