I’m trying to get an application running which does output into
multiple windows. The output is done with SDL_RenderCopy() on X11.
The problem is that the output into one window works perfectly,
but if I use two windows, the second window remains black. I’m
doing something like this:
/* create window, texture, surface */
window[i] = SDL_CreateWindow(NULL, x, y, w, h, SDL_WINDOW_SHOWN);
rc = SDL_CreateRenderer(window[i], -1,
Assert(rc == 0);
texture[i] = SDL_CreateTexture(desktop_mode.format,
SDL_TEXTUREACCESS_STREAMING, w, h);
rc = SDL_QueryTexturePixels(texture[i], &pixels, &pitch);
Assert(rc == 0);
surface[i] = SDL_CreateRGBSurfaceFrom(pixels, w, h, bpp, pitch,
Rmask, Gmask, Bmask, Amask);
working[i] = SDL_CreateRGBSurfaceFrom(…);
/* render the working surface to the window */
SDL_BlitSurface(working[i], &srcRect, surface[i], &dstRect);
SDL_DirtyTexture(texture[i], 1, &dstRect);
Assert(renderInfo[i].flags & SDL_RENDERER_PRESENTCOPY);
SDL_RenderCopy(texture[i], &dstRect, &dstRect);
‘working’ is updated by the application and copied to ‘surface’ with
SDL_BlitSurface() which is then rendered to the window.
If I try to use two windows (i is 0 or 1), then only the first window
is updated and the second window remains black. The other window can
be changed with other means, for instance with SDL_RenderFill(), but
doing SDL_RenderCopy on two windows does not work.
Is there a principle problem with my code?
Dr.-Ing. Frank Mehnert Sun Microsystems, Inc. www.sun.com
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Size: 197 bytes
Desc: This is a digitally signed message part.