my problem is that as long as i dont touch it, it will display perfectly, however as long as i click on any other windows or move this display window, the whole screen will turn blank thereafter. Hope anyone can assist me in this.
Lol, I think you need to refresh your rendering repeatedly, because you invalidate your window contents as you move it. Nice cryptic fortran GL coding!
hi, what do meanyou by refresh my rendering repeatedly?
which parts of the code should i transfer inside my computation loop and which parts should i leave out? i tried putting the whole chunch in the loop but gets the ‘failed to register window class’ error instead.
It turns black because you are clearing your screen. Look at the last 2 calls to glClear.
Also, normally people OR those 2 things : write glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
Clear the screen before rendering, not after Problem solved !
With a single buffered screen, really the driver could present the image at any time. You can’t guarantee it’ll only do it after a flush of the pipeline.
Have any of you folks realized he flushes and finishes before he clears? In effect his clear does not take effect. He ought to be rendering in a loop, that would be triggered by either a timer or when his window contents become invalidated.
dear all, thanks for the responses. i tried shifting the clearing of screen before rendering but that doesnt work too. looked through the tutorials briefly but couldnt find anything i could follow. also, the originally black with white display screen actually turns completely white (i.e. not responding) if i shift it or click anywhere, otherwise it does it job fine. The problem is I have another output screen right behind this opengl display and its blocked all the time. I need to shift it.
Finally yes i render in a loop, here is the more comprehensive version of the code: