Game Development Reference
In-Depth Information
There are some restrictions when working with this system, because the component
must fit a lowest common denominator feature set for the available languages. In
this case many object-oriented features such as generics or runtime templates are
not available in JavaScript at all, and so those must be excluded from a WinRT type.
Classes exposed through WinRT must also be marked as sealed, as inheriting from
a WinRT type is not possible.
If you can work with the restrictions (which the compiler will happily outline), you can
gain great benefits from writing code in one language and using it in another. As an
example, we will write the live tile code in the next section in C# as a WinRT com-
ponent, and consume that code in our C++ game. To simplify the interface between
C# and C++ we'll handle the XML manipulation in C#; however, if you want to stick
with C++ for all of this you can utilize the same methods and functionality within C++
(using C++/CX) and make use of your favorite XML parser.
You may be wondering how this fits into the traditional include filesystem used in
C++, for components written in languages that do not require them.
Search WWH ::




Custom Search