Отображение Dear ImGui в разных окнахC++

Программы на C++. Форум разработчиков
Ответить
Anonymous
 Отображение Dear ImGui в разных окнах

Сообщение Anonymous »

Я хотел бы визуализировать элементы Dear ImGui в двух разных окнах glfw.

У меня есть этот пример кода:

Код: Выделить всё

#include 

int main(void)
{
GLFWwindow* window1;
GLFWwindow* window2;

/* Initialize the library */
if (!glfwInit())
return -1;

/* Create a windowed mode window and its OpenGL context */
window1 = glfwCreateWindow(640, 480, "Hello World", NULL, NULL);
if (!window1)
{
glfwTerminate();
return -1;
}

/* Create a second windowed mode window and its OpenGL context */
window2 = glfwCreateWindow(640, 480, "World Hello", NULL, NULL);
if (!window2)
{
glfwTerminate();
return -1;
}

/* Loop until the user closes the window */
while (!glfwWindowShouldClose(window1) && !glfwWindowShouldClose(window2))
{
/* Make the window's context current */
glfwMakeContextCurrent(window1);
/* Render here */
glClear(GL_COLOR_BUFFER_BIT);
/* Swap front and back buffers */
glfwSwapBuffers(window1);

/* Make the second window's context current */
glfwMakeContextCurrent(window2);
/* Render here */
glClear(GL_COLOR_BUFFER_BIT);
/* Swap front and back buffers */
glfwSwapBuffers(window2);

/* Poll for and process events */
glfwPollEvents();
}

glfwTerminate();
return 0;
}
Как я могу преобразовать этот код, чтобы я мог отображать (разные) ImGui для обоих окон, если ImGui настроен.

Подробнее здесь: https://stackoverflow.com/questions/676 ... nt-windows
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «C++»