PDA

View Full Version : how to display a 3 digit counter in a OpenGL window??



prashantgp
10-28-2002, 02:15 AM
hi all,
i want a 3 digit counter(000-999) to be displayed on left up corner of the window.
i am using glutBitmapCharacter function for putting the digits character by character.

my problem is that, when i run the program , i am not getting the display of counter which is changing contineously.
since counter has to be at the same position,
it is getting overwritten and i am ending up with some sort of Mesh without the actual no.s.
but the counting happens correctly.
so pls help me out to ge the exact display.

nexusone
10-28-2002, 06:17 AM
I think that you are not using glClear at the start of your display routine.

But post your code, and can advise more.



Originally posted by prashantgp:
hi all,
i want a 3 digit counter(000-999) to be displayed on left up corner of the window.
i am using glutBitmapCharacter function for putting the digits character by character.

my problem is that, when i run the program , i am not getting the display of counter which is changing contineously.
since counter has to be at the same position,
it is getting overwritten and i am ending up with some sort of Mesh without the actual no.s.
but the counting happens correctly.
so pls help me out to ge the exact display.

prashantgp
10-28-2002, 11:40 PM
hello all,
i got the answer. i used idle function and was able to get the results.
thanks to all & in particular to nexusone.

nexus, if we use glClear it clears whole window. but i wanted only certain position of window to be cleared.