wxglcanvas

I am getting wrong values when calling glReadPixels

断了今生、忘了曾经 提交于 2020-06-29 04:45:34
问题 In my program I am trying to select an object on right mouse click event using glReadPixels method. Window for rendering is created using wxWidgets (by extending wxFrame and wxGLCanvas). However, I am getting wrong values. He is tutorial that I used I was suggested to use this approach as it seems faster and easier than ray casting. My code: #include "MyGLCanvas.h" #include <glm/glm.hpp> #include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/type_ptr.hpp> BEGIN_EVENT_TABLE(MyGLCanvas,