I created an application that save the current screen with glCopyTexImage2D method and later retore the screen by output the content from the GL_READ_BUFFER to a texture, this texture will be attached to a polygon and display to the user. This method works fine in a single Monitor and running without any error, but the problem exist when I run the same application in the environment that have Dual Monitor.
The step to reproduce the problem.
- Start the Application, and the application will always pop up in the primary monitor.
- Move the application from the primary monitor to the secondary monitor.
- Call the glCopyTexImage2D method to save the current screen.
What happen: The displayed polygon(with texture attach to it) always shows a black color, seems like nothing is been save. But if you move the application back to the primary monitor and maximize the window, after this if you call the glCopyTexImage2D again, you are able to save and display the polygon without any problem. It seems like something to do with the Dual Monitor, can anyone help me to fix this problem? Thanks in advance.