OpenGl and Surface window parallel

Hoi!
I’m doing some GPU stuff, thus I must have an window opened with:
offscreen = SDL_SetVideoMode((int)XRES, (int)YRES, 16, SDL_OPENGL);
As I feel I can’t write my pixels into that same window, I opened another the
usual way:
screen = SDL_SetVideoMode((int)XRES, (int)YRES, 16, SDL_SWSURFACE);
Nevertheless I can see just one window one the screen!
Whenever I write some pixels into ‘screen’ I get an segmentation fault. My
putPixel method is this:
void putPixel(int argx, int argy, Vector3d *argcolor)
{
Uint16 *bufp = (Uint16 )screen->pixels + argyscreen->pitch/2 + argx;
*bufp = SDL_MapRGB(screen->format,
(Uint8)((*argcolor).x * 255.0),
(Uint8)((*argcolor).y * 255.0),
(Uint8)((*argcolor).z * 255.0));
}
Has anyone similar experiences or a solution? That would be nice!
Thanks for your help,
cweila2s

SDL can only have 1 window / video surface.
the video surface is the only one that is shown on the screen or in a window

i assume your putPixel code is correct ( i use the version found in
the SDL documentation )

if you write to the SDL_Surface that is not the latest one you create
with SDL_SetVideoMode(…)
you will probably get a segfault.
it is undocumented but i assume thats because resetting the video mode
loses the original surface.

with a variable name like offscreen (i love sensible variable names)
it sounds like this surface is not used as the display:

may i suggest using SDL_CreateSurface( args… ).
and writing to / reading from it

or am i wrong in what you are attempting?