Example #1
0
File: Core.cpp Project: nuggs/nDash
INT WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR lpCmdLine, INT nCmdShow) {
#else
int main(int argc, char *argv[]) {
#endif
    Kernel Core;
    bool running = true;

    try {
        cout << "Loading plugins..." << endl;
        Core.loadPlugin("SDL2");
        Core.loadPlugin("ACPlugin");
        cout << endl;

        cout << string(79, '*') << endl;
        cout << endl;

        cout << "Available graphics drivers:" << endl;
        listGraphicsDrivers(Core.getGraphicsServer());
        cout << "Available game plugins:" << endl;
        listGamePlugins(Core.getGameServer());
    } catch(const exception &exception) {
        cout << "Unhandled error: " << exception.what() << endl;
    }

    /* Update the plugins */
    while (running) {
        if (Core.getGameServer().getPlugin(0).updateGame()) {
            Core.getGameServer().getPlugin(0).closeConnection();
        }
    }

    return EXIT_SUCCESS;
}