Skip to content

Commit

Permalink
Fix #23 edl alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Romain committed Aug 28, 2024
1 parent 50fddf5 commit 6b41376
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/lidRviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ void sdl_loop(DataFrame df, std::string hnof)
glEnable(GL_LINE_SMOOTH);
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);

glPixelStorei(GL_PACK_ALIGNMENT, 1);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);

Drawer *drawer = new Drawer(window, df, hnof);
drawer->camera.setRotateSensivity(0.1);
drawer->camera.setZoomSensivity(10);
Expand Down Expand Up @@ -135,7 +138,9 @@ void sdl_loop(DataFrame df, std::string hnof)
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(70, (double)width / height, zNear, zFar);
gluPerspective(70, (float)width / (float)height, zNear, zFar);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
drawer->camera.changed = true;
}
break;
Expand Down Expand Up @@ -180,8 +185,9 @@ void sdl_loop(DataFrame df, std::string hnof)
void viewer(DataFrame df, std::string hnof)
{
if (running) Rcpp::stop("lidRviewer is limited to one rendering point cloud");
sdl_thread = std::thread(sdl_loop, df, hnof);
sdl_thread.detach(); // Detach the thread to allow it to run independently
sdl_loop(df, hnof);
//sdl_thread = std::thread(sdl_loop, df, hnof);
//sdl_thread.detach(); // Detach the thread to allow it to run independently

running = true;
}
Expand Down

0 comments on commit 6b41376

Please sign in to comment.