I have developed a graphics engine in C++ that uses OpenGL. And I built a Qt application. The engine provides creating GLFW window to render graphics on, but I want to render the graphics into a component in the Qt app. After some search I found that Qt has its own opengl interfaces. I do not want to use it because I need to use my engine. So, my question is how to render the graphics produced with my engine in Qt component like we do with glfw:
glfwMakeContextCurrent(window);
if (!gladLoadGL(glfwGetProcAddress)) {
std::cerr << "Failed to initialize GLADn";
glfwDestroyWindow(window);
exit(1);
}
glClearColor(0.0f, 1.0f, 0.0f, 1.0f);
glfwSwapBuffers(window);
I tried to use GLWidget but I didn’t find the connection between my engine and the widget. I mean that I can’t find a context to the widget and how to use it to render the graphics into the widget.