I am using GLFW along with QT for an opengl application.
i have a while loop inside the main function.
Why the while loop is not blocking the QT GUI ?
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
cont.SetName("RootItem");
TreeModel* model = new TreeModel("RootElement", &cont);
WavefrontRenderer w(model);
w.show();
glfwInit();
glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);
glfwWindowHint(GLFW_SAMPLES, 4);
GLFWwindow* window = glfwCreateWindow(SCR_WIDTH, SCR_HEIGHT, "Renderer", nullptr, nullptr); //
glfwMakeContextCurrent(window);
GLenum GlewInitResult;
glewExperimental = GL_TRUE;
GlewInitResult = glewInit();
w.InitData();
while (!glfwWindowShouldClose(window))
{
glClearColor(0.0, 0.3, 0.3, 0.0);
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
w.render();
glfwPollEvents();
glfwSwapBuffers(window);
}
// glfw: terminate, clearing all previously allocated GLFW resources.
// ------------------------------------------------------------------
glfwTerminate();
//return 0;
return a.exec();
}
w.render()
do? – DarklighterQPushButton pb("Press"); pb.show();
immediately beforewhile (!glfwWindowShouldClose(window))
. Can you interact with the pushbutton? – G.M.