Game Development Reference
In-Depth Information
In Figure 11-1 , you can see the entire editor ecosystem.
Figure 11-1. The editor ecosystem
The editor GUI can be developed using any UI SDK/API, and it can have its own plug-ins. For example,
sub-editors like the model editor, cinematic editor, scene editor, material editor, etc., can be hosted by the main
editor, and you can even run them as separate tools. Each tool will implement its own UI functionality and will call
commands by their name and parameter values (arguments). The editor core will search its registered commands list
and dispatch the call to the appropriate plug-in command.
You can also have an editor network layer, which waits for tools to connect to it and simply dispatches command
calls and sends back their results. There are various other methods of communication between the GUI and the editor
core; these methods use IPC (inter-process communication 2 ) such as pipes, DDE, and shared memory or files, but
sockets are supported on all platforms, so they are the obvious first choice.
Editor Core C++ API
Now let's get to the nuts and bolts of the actual code. First you will declare your editor C++ interface to be used by
the plug-ins. You are going to expose plug-in and command methods and interfaces, a simple history (undo/redo)
system, and an event system (used for triggering events in the editor, plug-ins can register themselves as event sinks
to receive or trigger events).
Let's start with the building block interfaces related to commands, undo, events, and other primitive constructs.
You will use a self-contained, independent header file, with only pure interfaces, not relying on external headers so
it can be easily wrapped or converted to other languages. (It's especially important to keep the interfaces simple. If
you were using something like SWIG (Simplified Wrapper and Interface Generator 3 ), for example, having too many
dependencies in the C++ code would complicate things for the SWIG converter, sometimes failing to properly create a
wrapper for other languages.)
2 “Inter-process communication.” http://en.wikipedia.org/wiki/Inter-process_communication .
3 “SWIG.” http://en.wikipedia.org/wiki/SWIG .
 
Search WWH ::




Custom Search