@@ -56,6 +56,9 @@ void sdl_loop(DataFrame df, std::string hnof)
56
56
glEnable (GL_LINE_SMOOTH);
57
57
glHint (GL_LINE_SMOOTH_HINT, GL_NICEST);
58
58
59
+ glPixelStorei (GL_PACK_ALIGNMENT, 1 );
60
+ glPixelStorei (GL_UNPACK_ALIGNMENT, 1 );
61
+
59
62
Drawer *drawer = new Drawer (window, df, hnof);
60
63
drawer->camera .setRotateSensivity (0.1 );
61
64
drawer->camera .setZoomSensivity (10 );
@@ -135,7 +138,9 @@ void sdl_loop(DataFrame df, std::string hnof)
135
138
glViewport (0 , 0 , width, height);
136
139
glMatrixMode (GL_PROJECTION);
137
140
glLoadIdentity ();
138
- gluPerspective (70 , (double )width / height, zNear, zFar);
141
+ gluPerspective (70 , (float )width / (float )height, zNear, zFar);
142
+ glMatrixMode (GL_MODELVIEW);
143
+ glLoadIdentity ();
139
144
drawer->camera .changed = true ;
140
145
}
141
146
break ;
@@ -180,8 +185,9 @@ void sdl_loop(DataFrame df, std::string hnof)
180
185
void viewer (DataFrame df, std::string hnof)
181
186
{
182
187
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
185
191
186
192
running = true ;
187
193
}
0 commit comments