drawing into 2D texture

i would like to draw into a 2D texture, that is used for texture mapping.
are there any tools to draw simple 2D shapes into a texture?
can i set additional opengl to render into my texture instead of the output buffer?
thanks, oren.

Use the framebuffer object extension.

And a nice tutorial to start with rendering to texture with the help of fbo:

thanks a lot. this is exactly what i need.