Skip to content

Commit 6b41376

Browse files
committed
Fix #23 edl alignment
1 parent 50fddf5 commit 6b41376

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/lidRviewer.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ void sdl_loop(DataFrame df, std::string hnof)
5656
glEnable(GL_LINE_SMOOTH);
5757
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
5858

59+
glPixelStorei(GL_PACK_ALIGNMENT, 1);
60+
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
61+
5962
Drawer *drawer = new Drawer(window, df, hnof);
6063
drawer->camera.setRotateSensivity(0.1);
6164
drawer->camera.setZoomSensivity(10);
@@ -135,7 +138,9 @@ void sdl_loop(DataFrame df, std::string hnof)
135138
glViewport(0, 0, width, height);
136139
glMatrixMode(GL_PROJECTION);
137140
glLoadIdentity();
138-
gluPerspective(70, (double)width / height, zNear, zFar);
141+
gluPerspective(70, (float)width / (float)height, zNear, zFar);
142+
glMatrixMode(GL_MODELVIEW);
143+
glLoadIdentity();
139144
drawer->camera.changed = true;
140145
}
141146
break;
@@ -180,8 +185,9 @@ void sdl_loop(DataFrame df, std::string hnof)
180185
void viewer(DataFrame df, std::string hnof)
181186
{
182187
if (running) Rcpp::stop("lidRviewer is limited to one rendering point cloud");
183-
sdl_thread = std::thread(sdl_loop, df, hnof);
184-
sdl_thread.detach(); // Detach the thread to allow it to run independently
188+
sdl_loop(df, hnof);
189+
//sdl_thread = std::thread(sdl_loop, df, hnof);
190+
//sdl_thread.detach(); // Detach the thread to allow it to run independently
185191

186192
running = true;
187193
}

0 commit comments

Comments
 (0)