In arm the qreal type is a single precision float which makes the constructors of QMatrix4x4 incompatible with a GLdouble* (which is a double*). This means analitza doesn't compile in armhf. This issue (QMatrix4x4 using qreal) is referenced in different discussions over the net, probably: http://stackoverflow.com/questions/14303126/use-qmatrix4x4-with-opengl-functions is one of the more interesting readings. Reproducible: Always Steps to Reproduce: 1. Try to compile analitza in armhf. 2. See the failure. :)
Do you have anything defined so that I can use ifdef?
¡Hola Aleix! El 2013-06-19 a las 01:15 +0000, Aleix Pol escribió: > --- Comment #1 from Aleix Pol <aleixpol@kde.org> --- > Do you have anything defined so that I can use ifdef? I was thinking something more in the lines of: diff -Naru ../analitzaplot/plotter3d.cpp analitzaplot/plotter3d.cpp --- ../analitzaplot/plotter3d.cpp 2013-06-19 14:02:21.126969033 +0200 +++ analitzaplot/plotter3d.cpp 2013-06-19 14:24:09.042822834 +0200 @@ -142,6 +142,12 @@ renderGL(); } +// add overloaded functions which call the underlying OpenGL function +inline void glMultMatrix(const GLfloat *m) { glMultMatrixf(m); } +inline void glMultMatrix(const GLdouble *m) { glMultMatrixd(m); } + +inline void glMultMatrix(const QMatrix4x4 &m) { glMultMatrix(m.constData()); } + void Plotter3D::drawPlots() { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); @@ -152,7 +158,7 @@ glMatrixMode(GL_MODELVIEW); glLoadIdentity(); - glMultMatrixd(m_rot.data()); + glMultMatrix(m_rot.data()); // Object Drawing : glCallList(m_sceneObjects.value(Axes)); @@ -396,6 +402,14 @@ renderGL(); } +inline QMatrix4x4 get_matrix(GLdouble *m) +{ + return QMatrix4x4(m[0], m[1], m[2], m[3], + m[4], m[5], m[6], m[7], + m[8], m[9], m[10], m[11], + m[12], m[13], m[14], m[15]); +} + void Plotter3D::rotate(int dx, int dy) { GLdouble ax = -dy; @@ -414,7 +428,7 @@ glGetDoublev(GL_MODELVIEW_MATRIX, matrix); - QMatrix4x4 matrix4(matrix); + QMatrix4x4 matrix4(get_matrix(matrix)); bool couldInvert; matrix4 = matrix4.inverted(&couldInvert); And let the compiler to take care of floats and doubles.
Created attachment 80634 [details] plotter3d patch
Interesting, can you put it over http://reviewboard.kde.org? There we can work it out better. I'm unsure we want to create a new constructor for QMatrix4x4 in case of Gldouble since it's already working, so this one should be overloaded as well.
¡Hola Aleix! El 2013-06-19 a las 12:56 +0000, Aleix Pol escribió: > --- Comment #4 from Aleix Pol <aleixpol@kde.org> --- > Interesting, can you put it over http://reviewboard.kde.org? There we can work > it out better. https://git.reviewboard.kde.org/r/111121/ > I'm unsure we want to create a new constructor for QMatrix4x4 in case of > Gldouble since it's already working, so this one should be overloaded as well. What do you mean?
You didn't publish the request
(In reply to comment #6) > You didn't publish the request Great. Done.
Git commit 07dc31770db7a7d2e5273db0c2b32578a7e13c4e by Albert Astals Cid, on behalf of Maximiliano Curia. Committed on 30/10/2013 at 22:53. Pushed by aacid into branch 'master'. Fix compile in armhf Acked by Aleix REVIEW: 111121 M +16 -4 analitzaplot/plotter3d.cpp http://commits.kde.org/analitza/07dc31770db7a7d2e5273db0c2b32578a7e13c4e