Skip to content

Commit

Permalink
Fix deprecation warnings under Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
ahojnnes committed Dec 21, 2019
1 parent 9012bb0 commit 67e9689
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/base/reconstruction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,9 @@ void Reconstruction::ExtractColorsForAllImages(const std::string& path) {
if (color_sums.count(point3D.first)) {
Eigen::Vector3d color =
color_sums[point3D.first] / color_counts[point3D.first];
color.unaryExpr(std::ptr_fun<double, double>(std::round));
for (Eigen::Index i = 0; i < color.size(); ++i) {
color[i] = std::round(color[i]);
}
point3D.second.SetColor(color.cast<uint8_t>());
} else {
point3D.second.SetColor(kBlackColor);
Expand Down
3 changes: 2 additions & 1 deletion src/ui/line_painter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ void LinePainter::Render(const QMatrix4x4& pmv_matrix, const int width,
QVector2D(1.0f / width, 1.0f / height));
shader_program_.setUniformValue("u_line_width", line_width);

glDrawArrays(GL_LINES, 0, (GLsizei)(2 * num_geoms_));
QOpenGLFunctions* gl_funcs = QOpenGLContext::currentContext()->functions();
gl_funcs->glDrawArrays(GL_LINES, 0, (GLsizei)(2 * num_geoms_));

// Make sure the VAO is not changed from the outside
vao_.release();
Expand Down
3 changes: 2 additions & 1 deletion src/ui/point_painter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ void PointPainter::Render(const QMatrix4x4& pmv_matrix,
shader_program_.setUniformValue("u_pmv_matrix", pmv_matrix);
shader_program_.setUniformValue("u_point_size", point_size);

glDrawArrays(GL_POINTS, 0, (GLsizei)num_geoms_);
QOpenGLFunctions* gl_funcs = QOpenGLContext::currentContext()->functions();
gl_funcs->glDrawArrays(GL_POINTS, 0, (GLsizei)num_geoms_);

// Make sure the VAO is not changed from the outside
vao_.release();
Expand Down
3 changes: 2 additions & 1 deletion src/ui/triangle_painter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ void TrianglePainter::Render(const QMatrix4x4& pmv_matrix) {

shader_program_.setUniformValue("u_pmv_matrix", pmv_matrix);

glDrawArrays(GL_TRIANGLES, 0, (GLsizei)(3 * num_geoms_));
QOpenGLFunctions* gl_funcs = QOpenGLContext::currentContext()->functions();
gl_funcs->glDrawArrays(GL_TRIANGLES, 0, (GLsizei)(3 * num_geoms_));

// Make sure the VAO is not changed from the outside
vao_.release();
Expand Down

0 comments on commit 67e9689

Please sign in to comment.