Qt datatypes with GLM and OpenGL

Hello,

I am wondering if anyone has used Qt datatypes (QMatrix4x4, QMatrix3x3, QVector3D, QVector4D, etc.) with OpenGL.

I know that Qt has it’s own way of dealing with OpenGL but I have an existing working program that I built using GLM that I need to port over.

Ideally, I would like to use GLM datatypes but the problem is that Qt’s shader management classes (QOpenGLShaderProgram and QOpenGLShader) doesn’t seem to accept pointers in their setters (for example, I didn’t find the setUniform() function that accepts a pointer to a float array).

Hopefully someone has experience with this and can shed some light; I’d rather use GLM’s datatypes since I have a working system using that already.

However, since Qt is where I need to go (I need the toolbar/menu/UI functionality Qt provides) I am willing to convert if necessary.

Thank you.

Just because you’re using Qt doesn’t mean you have to use Qt for everything. If you want to use Qt to simply create and manage the OpenGL context, while doing all of your OpenGL stuff yourself, you can do that.

You don’t have to use Qt’s shader classes just because you used Qt to set up OpenGL.

I agree! The issue comes into play using Qt’s shader management classes, etc.

What I don’t want to happen is needing to convert between GLM and Qt all of the time; especially in the frame loop.

[QUOTE=Alfonse Reinheart;1264332]Just because you’re using Qt doesn’t mean you have to use Qt for everything. If you want to use Qt to simply create and manage the OpenGL context, while doing all of your OpenGL stuff yourself, you can do that.

You don’t have to use Qt’s shader classes just because you used Qt to set up OpenGL.[/QUOTE]

[QUOTE=tmason;1264336]I agree! The issue comes into play using Qt’s shader management classes, etc.

What I don’t want to happen is needing to convert between GLM and Qt all of the time; especially in the frame loop.[/QUOTE]

I went to the doctor and told him that it hurts when I raise my arm like this. He said, “so don’t raise your arm like that.”

If you don’t want to convert between GLM and Qt all the time… stop using Qt’s shader management classes that make you convert between GLM and Qt all the time.