Compiling AGK Wrapper for .NET
In order to compile the actual wrapper, you must open the
AppGameKitWrapper solution. Certain directories for includes and libraries must be modified to point to your AGK installation directory (the paths used in the solution are the default 64-bit installation paths (Program Files (x86)) ).
Updating AGK Wrapper for .NET
The main work of the wrapper is performed by
AGKWrapperAid, a C# console application that takes a list of static method prototypes from the AGK headers and outputs wrapped method calls for the managed
Agk class. Please note that this program is a quick-and-dirty project designed solely for this purpose, and it is not well documented or organized.
Step 1 - Build AGKWrapperAid
AGKWrapperAid has only standard .NET dependencies, and should compile without incident.
Step 2 - Generate method header
AGKWrapperAid will open a file named "header.txt" in its working directory, which should contain a list of static function prototypes (and nothing else - the program is not designed to handle multi-line comments, preprocessor statements, or other C++ constructs). For example, to convert
agk::GetDeviceWidth and
agk::GetDeviceHeight, create a header.txt with the following content:
static int GetDeviceWidth();
static int GetDeviceHeight();
After running the program, you should get an "autowrapped.h" file with the following:
// This file was autogenerated by AGKWrapperAid
static int GetDeviceWidth() { return agk::GetDeviceWidth(); }
static int GetDeviceHeight() { return agk::GetDeviceHeight(); }
Copy this file into the main project directory and overwrite the existing "autowrapped.h", or add it to the file if you did not translate all the function prototypes. You can get the function prototypes from the "Wrapper.h" file in your AGK header include directory.
Step 3 - Compile AppGameKitWrapper
Compile the C++/CLI project. The file "autowrapped.h" is automatically included in the body of the
Agk class.