Question

for the past few weeks I've been developing custom renderer with freeglut and glew using VS 2010 Express, this renderer will be a part 3d editing tool.

Now the time came to pick a right GUI toolkit, I went for QT having heard all the good stuff about it.

The problem is that I have just discovered that QT uses it own OpenGl calls and handles mouse/keyboard events in it own way.

Does that mean I would have to rewrite large portion of my rendering calls as well as all my mouse/keyboard callbacks using QT library just to be able to use it as my tool's main GUI Framework?

Perhaps there is a smarter way to make them two work together that I am not aware of ??

Was it helpful?

Solution

With Qt instead of registering callbacks you're deriving from QGLWidget and override the mouse and keyboard event handler functions (inherited from QWidget). The changes to your input event handling are minimal.

QGLWidget::resizeGL is much like the reshape callback and QGLWidget::paintGL much like the display callback.

The problem is that I have just discovered that QT uses it own OpenGl calls

They're provided as a convenience. You can use GLEW and your regular OpenGL calls just fine with Qt. Most importantly you must make sure to include glew.h before any Qt header in all relevant compilation units and the headers those use.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top