Results 1 to 4 of 4

Thread: Qt datatypes with GLM and OpenGL

  1. #1
    Senior 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
    Mar 2015
    Posts
    6,675
    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
    Senior 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
    Mar 2015
    Posts
    6,675
    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.

Similar Threads

  1. Loading UDEC3 and DEC3N datatypes using VertexAttribPointer
    By Ioncannon in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 03-15-2015, 07:47 AM
  2. vector datatypes
    By jombi01821 in forum OpenCL
    Replies: 5
    Last Post: 08-07-2011, 11:08 AM
  3. math with Gl datatypes
    By Entheogen in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 12-27-2005, 04:30 PM
  4. generic vertex attributes and datatypes
    By Chuck0 in forum OpenGL: Advanced Coding
    Replies: 6
    Last Post: 01-18-2004, 11:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean