Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: Qt datatypes with GLM and OpenGL

  1. #1
    Junior Member Regular Contributor
    Join Date
    Apr 2014
    Posts
    109

    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.

  2. #2
    Senior Member OpenGL Lord
    Join Date
    May 2009
    Posts
    5,907
    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.

  3. #3
    Junior Member Regular Contributor
    Join Date
    Apr 2014
    Posts
    109
    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 Originally Posted by Alfonse Reinheart View Post
    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.

  4. #4
    Senior Member OpenGL Lord
    Join Date
    May 2009
    Posts
    5,907
    Quote Originally Posted by tmason View Post
    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.
    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •