Rendering to an image/texture using OpenGL


Is there a way to render directly to an image using OpenGL? It seems like I can’t create an SDL context without SDL window object construction, which means rendering to screen. In Windows application I can attach an OpenGL context to HBITMAP object. I don’t see anything like that here in SDL. Please help!