I am currently using the main thread and it is producing these incorrect
images.  I have not even multithreaded it yet.  When I do I will only be
threading the writting of the image.

Seamus

On Wed, 25 Feb 2004, Frederic Bouvier wrote:

> Seamus Thomas Carroll wrote:
>
> > Hi,
> >
> > I am trying to save images from flightgear to a file or database without
> > explicitly using the gui.  For a test of current capability I am
> > calling fgDumpSnapShot every second but I am finding it produces saved
> > images that are completely white or contain corruption, yet other images
> are
> > saved as expected.  The only change I mode to fgDumpSnapShot is I
> commented
> > out "mkDialog (message.c_str());".
> >
> > I am trying to implement a threaded image saver so that it does not
> > cause pauses in the simulator that continiously saves images over a
> > specified interval.
>
> If you are doing snapshot in another thread, you must be sure that the
> buffer you are dumping is not being cleared, swapped or written at the
> same time by the main thread.
>
> Generally, people think it is not possible to call OpenGL API from
> multiple thread at the same time because of the state oriented nature
> of OpenGL. The arguments seem reasonable and I take them for true, so I
> never experiment myself.
>
> In theory, it should be possible to dump the front buffer while the back
> buffer is updated, but fgDumpSnapShot should be rewriten to avoid calling
> fgInitVisual, fgReshape or fgRenderFrame in two different threads.
> This imply also some sort of synchronization to avoid doing a SwapBuffer
> during the ReadPixels call.
>
> > I think I understand how fgDumpSnapShot works and was going to use it as
> > an example but it only seems to produce correct results when called
> > through the gui.
>
> Yes, in the main thread.
>
> > Should I be using another funtion as an example?
>
> I would look at sg_glDumpWindow and take the code portion that
> write to the file from fgDumpSnapShot.
>
> -Fred
>
>
>
> _______________________________________________
> Flightgear-devel mailing list
> [EMAIL PROTECTED]
> http://mail.flightgear.org/mailman/listinfo/flightgear-devel
>

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to