This is main.h
, I shared with you just in case there would be something wrong here. But I don't think so.
Then, there is main.cpp
which is the entry point of my program.
If I generate it with Visual Studio 2017, it will compile and run without errors but it will not print anything on the console.
I can't figure out why.
main.h:
#pragma once
#include <thread>
#include "GabEngine/MainEngine.h"
#include "GraphicInterface/Console.h"
#include "GabEngine/Globals.h"
int m_ScreenWidth = 500, m_ScreenHeight = 500;
GabEngine::Wind m_RootWindow;
GabEngine::MainEngine m_MainEngine(&m_RootWindow);
Globals::NetworkStatus NetStatus;
Networking::MainNetwork m_MainNetwork(&NetStatus);
void TaskConsole();
void TaskNetwork();
main.cpp:
#include "GraphicInterface/main.h"
#include <iostream>
#undef main
void TaskConsole()
{
if (SDL_Init(SDL_INIT_EVERYTHING) != 0)
{
GabEngine::FatalError("Failed to initialize SDL");
}
m_RootWindow.Create("Utryon", m_ScreenWidth, m_ScreenHeight, 2);
m_MainEngine.InitShaders();
m_MainEngine.InitCEGUI("C:/Users/Bob/Documents/Visual Studio 2017/Projects/Utryon/GabEngine/GUI");
m_MainEngine.LoadScheme("UtryonLook.scheme");
m_MainEngine.SetFont("DejaVuSans-10");
GraphicInterface::Console MainConsole(&m_MainEngine, &m_MainNetwork);
MainConsole.InitConsole();
MainConsole.Run();
}
void TaskNetwork()
{
m_MainNetwork.Run();
}
int main(int argc, char** argv)
{
std::cout << "Here 1" << std::endl; //It is supposed to print Here 1
thread ConsoleThread(TaskConsole);
thread NetworkThread(TaskNetwork);
ConsoleThread.join();
NetworkThread.join();
// End of program
return 0;
}