Read canvas image by HTTP: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 876: Line 876:
== Building ==
== Building ==
{{WIP}}
{{WIP}}
* Download and extract the attached tar archive (https://sourceforge.net/projects/remote-canvas-for-flightgear)
* Download and extract the attached tar archive (https://sourceforge.net/projects/remote-canvas-for-flightgear). It contains the patches listed above,
* Copy the simgear and flightgear
* Copy the simgear and flightgear subfolders over your existing source tree.
* Run the platform specific make for building FG.
* Copy the resulting fgfs executable to your FlightGears installation bin directory '''after''' saving the existing.


== Using ==
== Using ==
Add the line
<syntaxhighlight>
<canvasimage>/canvasimage</canvasimage>
</syntaxhighlight >
to the uri handler defined in file FG_ROOT/httpd-settings.xml and start fgfs with option "--httpd=5701" (the port number is free, but 5701 is used by the showcase HTML script). Enter the URL
<syntaxhighlight>
localhost:5701/canvasimage?type=png&canvasindex=0
</syntaxhighlight>
in your browser. The first request will add the property rendertoimage to the canvas with index 0 but return no image (this is no intended behaviour but the result of insufficient synchronization between the rendering thread and the HTTP thread). The request needs to be send again and the image of canvas 0 is returned.


== Related ==
== Related ==
183

edits

Navigation menu