[SDL] accessing on video surface from two processes.
Alex Volkov
avcp-sdlmail at usa.net
Wed Jun 14 10:31:33 PDT 2006
Thomas Mueller wrote:
> I would like to access a video surface from a second process.
The short answer is you cannot, but see below.
> I would like to open a window in a program and leave it open for a while.
> *SDL_SetVideoMode to opens a window and returns a pointer to access that
window.
> How can I "draw things" from a second process on that window opened by
> the first process ?
On many SDL-supported platforms a pointer is only valid within the process
that created the pointer (or rather the memory area the pointer points to).
This is due to Virtual Address space used by most modern OSes.
On these platforms you would normally resort to some way of inter-process
communication (like pipes) to deliver the rendering commands to the first
process (the owner of the SDL surface). The first process essentially
becomes a rendering driver for the second process.
All of this is beyond the scope of SDL, however, and I would recommend
finding a different solution to your problem (you did not say what the
problem was, btw).
-Alex.
More information about the SDL
mailing list