SDL with Windows

Hello,
I have downloaded the latest development libraries of SDL for Visual Studio
(Windows). I was able to successfully compile and run.
However, I do have a question. Can I open multiple instances of SDL from the
same application? My application requires different surfaces to display
different video feeds. There is no sharing of data between these surfaces.
If it is possible, can someone please show me how or point me in the right
direction?

Thanks.

You can fork child processes that are SDL applications. How you do that
depends on the OS. I’ve had it working in both Linux and Windoze.

JeffOn Wed October 4 2006 15:16, Madhuri Rambhatla wrote:

Hello,
I have downloaded the latest development libraries of SDL for Visual Studio
(Windows). I was able to successfully compile and run.
However, I do have a question. Can I open multiple instances of SDL from
the same application? My application requires different surfaces to display
different video feeds. There is no sharing of data between these surfaces.
If it is possible, can someone please show me how or point me in the right
direction?

In article <loom.20061005T001444-834 at post.gmane.org>,
mrambhatla at phoenixworldwide.com says…

Can I open multiple instances of SDL from the same application?

You can have multiple off-screen SDL surfaces in one instance of an app, but
you can only really have one display SDL surface per process (which includes
all threads within the main process).

[sidenote: trying to use SDL from different threads within the same process
sometimes works (depending on what SDL features you use in the threads), but
it’s uber risky]

I got around this (in Windows only) by creating a SharedMemory class, which
handles scheduling, interlocking, and synchronization. Then I spawn these
little mini-SDL rendering apps, which most of the time just
WaitForSingleObject() on an appropriate rendering event. When the event for
a rendering mini-app is signaled, the little mini-app just gets the “data” it
needs from the shared memory.

The main app does all “tough” work, but relies on the little mini-rendering
apps to do the drawing. In my case, I’ve got the main app managing 4 USB
digital cameras. When all the cameras are in viewfinder mode, they spit
frames at me fast-and-furious. I just route the frame data to the
appropriate shared memory and then set the event for that rendering mini-app.

So far all four mini-apps are doing just fine, each rendering 320x240 30fps
video, and none of the mini-apps nor the main app consume 100% CPU. Also,
the SDL gfx library works well as I use it to decompress the JPEG frames.

Doug.

Thank you. I think I will implement the SharedMemory myself.
Madhuri.