Gl drawing to a texture created with SDL_CreateTexture

what is the best way to get a gl shape drawn into a texture for 2D stuff?

create texture

draw into texture

should i not use SDL_surface at all using sdl 1.3 ? ( aside from loading
bitmaps into texture )

and C is the best language to use