Ah crap.. Msvc never told me that(thanks btw) even tho warnings are level 3 (because /wall generates over 200 warnings in stl)
About includes... There is a good reason. For example opcodes.hpp is a shared file, both server and client need the same file, but worldsession header (included by opcodes.hpp) is different on both sides, so I simply include Worldsession.hpp
Others are just me being lazy and letting ide do magic.
I managed to make it not crash by giving WorldSession a copy of Game pointer, but it still doesn't work, I get completly black screen (which ofc doesnt happen on master branch, where there is no threading).
Sure enough, with some debugging I figured that Window->display(); returns instantly with following comment on that line:
// This context is not the active one on this thread, don't do anything
Any ideas how to make main thread load all textures (which is ofcourse triggered from other thread) as cleanly as possible? :/ Perhaps boost::asio::io_service? Can I even enqueue a job to boost::asio::io_service without some condition when should function be called (for example, a timer)?
Even better, is there a way I can "give" OpenGL context to other thread?