20,741
edits
Chriscalef (talk | contribs) |
m (→Implementation) |
||
Line 181: | Line 181: | ||
== Implementation == | == Implementation == | ||
== Development == | |||
=== Networking === | |||
There's cross-platform/multi-platform socket handling code in simgear for all the socket stuff you are doing there e.g. see [http://api-docs.freeflightsim.org/simgear/classSGSocket.html SGSocket] Internally, I/O protocols and network stuff usually live in $FG_SRC/Network | |||
Which is also where you can see, that there's the concept of an "FGIOChannel" for encapsulating all the logic you added to fg_init.cxx | |||
fg_init.cxx will only set up the IO channel, which just inherits from the corresponding interface class: http://api-docs.freeflightsim.org/simgear/classSGIOChannel.html | |||
For examples, look at the httpd or telnet/props stuff | |||
You will find that using these SimGear 2-3 APIs will greatly simplify and reduce your code, while making it much more straightforward to move it into a separate module, that also compiles across all platforms. | |||
Equally, there's a ton of SGGeo* helpers available for doing all lat/lon computations that can dream of | |||
== Demo using Python == | == Demo using Python == |