Summary: | compilation error on armhf: GLdouble is not the same as qreal | ||
---|---|---|---|
Product: | [Frameworks and Libraries] analitza | Reporter: | Maximiliano Curia <maxy> |
Component: | analitzaplot | Assignee: | Aleix Pol <aleixpol> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | percy.camilo.ta |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Debian unstable | ||
OS: | Linux | ||
URL: | https://buildd.debian.org/status/fetch.php?pkg=analitza&arch=armhf&ver=4%3A4.10.4-1&stamp=1371374541 | ||
Latest Commit: | http://commits.kde.org/analitza/07dc31770db7a7d2e5273db0c2b32578a7e13c4e | Version Fixed In: | |
Sentry Crash Report: | |||
Attachments: | plotter3d patch |
Description
Maximiliano Curia
2013-06-16 21:13:46 UTC
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 |