How to make a buffer to draw on but not render

A selection buffer. I want to put polygons there that have a specific color, being their ID and select polygons finding the color of the polygon under the mouse when clicked. All I need is:


draw my ID polygons

end drawing;

If you are already in double-buffer mode, you can use your back-buffer for selection, clear it afterwards and then use it to render. So you dont have to switch anything. If you want to choose the buffer you want to render, try:


Look also at glRenderMode(), which gives you another method to select things (Selection and Feedback).