I am working on an application in which, there are multiple graphics window instances. The main application (interface) runs in the main thread. When user selects new window, here the graphics window is loaded. I would like to mention it here that I am using wxGLCanvas as a graphics window. Now there is a preview window which is also derived from wxGLCanvas. In this preview window I am doing image processing, before loading that image into the main graphics window.

Now the situation is that this preview window is run from the main thread (not the one which runs graphics window). I have UnProject function in both the classes. i.e. in preview window and in graphics window. In the main GUI I display mouse pointer location in the bottom lower corner status bar. To do this I am calling unproject function of graphcis window. But when I run the application, everytime, the UnProject function from preview window is being invoked. Even without creating any instance of preview window, The unproject function of preview window class which is the protected member function of that class, is invoked. Initially, both functions had same name in both classes. I tried changing the name of the UnProject function in preview window class, but failed to solve the problem.

Though the applications runs well without any error, the x,y coordinates shown is wrong in the statusbar. Expert kindly suggest me if there is any problem with my approach of using OpenGL with multiple threads.