PDA

View Full Version : clearing part of a display



apnamani
04-17-2004, 06:56 AM
hi people!

i need help trying to clear small section of an opengl window screen
using opengl and win32

i am doing an audio spectrum program where it displays 8 bands of an audio
signal. what i wanted to do was a small demo that displays a set of boxes (using glvertex2f)
green, yellow and red and clear the boxes starting from the top box and go
down and start again in a kind of loop. The Y co ordinate of all the boxes
are stored in an array of float variables. The x co ordinate is common to
all the boxes so that does not change. the y cordinate is calculated by including
the height of the box and the spacing between each box. this is stored in the
array of floats. To clear the boxes i chose a glcolorMask of black and drew boxes
over the other color boxes using the array of floats, starting from the top and work my way down but it does
not work. my aim is to display the 8 band spectrum and only clear one band and redisplay it and it not affecting the other displayed bands

your help would really be appreciated.

mani

brcain
04-22-2004, 06:03 AM
I'm not certain what you are trying to do. Are you redrawing the entire scene every frame ... or are you trying to do some sort of retained mode rendering? If so, why?

If you are trying to remove certain bands (i.e. colors) from an image you can perform an image processing slicing technique.

zeckensack
04-22-2004, 08:23 PM
glScissor allows you to define a window space "clip" rectangle. Once enabled, glClear will not modify anything outside that rectangle, nor will anything outside of it be rendered. That's what you could use if your goal is really what the thread title suggests.