Threading issues...

Pages: 12
closed account (10oTURfi)
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.
closed account (10oTURfi)
Client should be linked against SFML 2.0 graphics/window/system & boost thread/asio.

About Backspace: https://github.com/LaurentGomila/SFML/commit/dd51b3d8ff466159e750b02dafa6f7ad7cb1d4af

EDIT: Server needs boost asio, SFML 2.0 window/system (gonna remove SFML dependency soon enough), MySQL C connector, MySQL C++ connector
Last edited on
closed account (10oTURfi)
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?
Topic archived. No new replies allowed.
Pages: 12