I was unaware that the linux version of AppGameKit had a console template. With that it was simple to change "template_windows_vs2015" into a console only for use as a server.
This is Tier 2, not sure if this can be done with Tier 1.
If your interested here is how to do that:
Open the project with Visual Studio and go into the Project Setting.
Go into "Configuration Properties/Linker/System" and change the "SubSystem" from "Windows" to "Console".
Click Okay to save the changes.
1> Open Core.cpp
2> Change:
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
to:
int main()
3> find this line and comment it out:
HWND hWnd = CreateWin32Window( hInstance, DEVICE_WIDTH, DEVICE_HEIGHT, uString("AGK"), dwCenterWindowX, dwCenterWindowY, FULLSCREEN );
4> replace this line:
agk::InitGL( (void*) hWnd );
with this:
agk::InitConsole();
5> open template.cpp:
6> under:
#include "template.h"
add:
#include <iostream>
7> comment out these lines:
agk::SetVirtualResolution (1024, 768);
agk::SetClearColor( 151,170,204 ); // light blue
agk::SetSyncRate(60,0);
agk::SetScissor(0,0,0,0);
8> replace these lines:
agk:
rint( agk::ScreenFPS() );
agk::Sync();
with these:
agk::UpdateInput();
AGKMusicOGG::UpdateAll();
agk::Sleep(33);
10> an example for screen output:
void app::Begin(void)
{
std::cout << "Control-X to exit.\n";
}
11> An example for keyboard input: (this only works in windows)
int app::Loop (void)
{
if (GetAsyncKeyState(VK_CONTROL) & 0x8000)
{
if (GetAsyncKeyState(0x58) & 0x8000) return 1;
}
agk::UpdateInput();
AGKMusicOGG::UpdateAll();
agk::Sleep(33);
return 0; // return 1 to close app
}
12> now you can add appgamekit commands to build a server. The examples I give in 10 and 11 can be used for text out and keyboard input.