user2670468
user2670468

Reputation:

Display glut window on Qt widget / QWindow

I am trying to configure one of the samples bundled in the OptiX 3.0.1 SDK to display in a Qt Widget.

The sample currently renders to a glut window and makes use of glViewport. Is there a way that I can change the glut window to a Qt Widget or make the glut window display on a Qt widget?

The sample makes use of a vertex buffer object:

glBindBuffer(GL_PIXEL_UNPACK_BUFFER, vboId);

I have created a class that inherits from QWindow. Is it possible to use the vertex buffer object to render to the QWindow?

Upvotes: 2

Views: 1440

Answers (1)

datenwolf
datenwolf

Reputation: 162317

GLUT is just another (very spartanic) application framework. You can replace it completely with Qt and QGLWidget.

  • glutCreateWindow → creation of a QGLWidget instance
  • glutDisplayFunc & a display handler → reimplement QGLWidget::paintGL in a derived class
  • glutReshapeFunc & a resize handler → reimplement QGLWidget::resizeGL in a derived class
  • user input functions → reimplement the event methods of QWidget

Upvotes: 0

Related Questions