Im trying to create a polygon using LineTo() and MoveTo()using the users mouse inputs in a Windows SDI based program in the left half of the screen. This part is already finished.
And the same polygon using OpenGL slightly shifted from the main polygon on the right hand side…as soon as I try to initialize opengl…my whole screen becomes black…and I cant see anything…inclyding the previous users drawing…(which used to be black on white…) …I dont know if its being drawn at all…or just overwritten with the black background when i initialize opengl.
I am completely stuck…I dont seem to be able to understand the RC and DC interconversions…how do I do this ?
You cannot mix GDI and OpenGL if you have doublebuffering enabled, with single buffering it works but you must also set a flag when you create the rendering context to enable it.
You also need to be aware that glClear() will erase the contents of your window including and GDI stuff, but you can what part of the window should be used by OpenGL, but an easier solution is to draw the OpenGL stuff first and then draw all GDI stuff at the end if that is possible.