Hi,
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,
SDL_RENDERER_SINGLEBUFFER |
SDL_RENDERER_PRESENTDISCARD);
Assert(rc == 0);
SDL_GetRendererInfo(&renderInfo[i])
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_SelectRenderer(window[i]);
SDL_DirtyTexture(texture[i], 1, &dstRect);
Assert(renderInfo[i].flags & SDL_RENDERER_PRESENTCOPY);
SDL_RenderCopy(texture[i], &dstRect, &dstRect);
SDL_RenderPresent();
‘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?
Thanks,
Frank–
Dr.-Ing. Frank Mehnert Sun Microsystems, Inc. www.sun.com
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20090528/c032f98e/attachment.pgp