Hello people of #teeworlds, I'm here to bless you with technology from the future, libcurl. However it'd be best if we could get the engine jobs revamp along with it. Thus it is time I inquire once more about allowing a little more C++11 in our codebase
11:32
shared_ptr's are perfect for this and they can't be zero overhead without language support, ofc we can refcount on our own, but not reinventing the wheel and all
minus: Sure but why bother when it's already a language feature? I'm sure the people who implement the standard for compilers have a better testing suite and code review standards then us
lambdas etc. c++11 seems to push people to introduce unnecessary levels of abstraction. I agree that it would be fine if we had strict code guidelines, and it is only in the absence thereof that I personally prefer c++03
13:19
it would be silly to have a bot just for my personal likings though ;)
I'm not hardcore against it though, if everyone else is for it, I'll just go with it :) I was only answering because jxsl13 seemed to implied I was for it
13:21
Learath2: I liked your goto, yeah
13:22
I like that Teeworlds uses abstractions very sparingly and I think it has deserved it a lot
I don't but I've been looking at it for 10 years, it's trivial to navigate around for me, a lot of people start out, implement a chat command or two, see the rest of the code with 0 documentation and bail
Or having to implement a linked list whenever you want one, don't get me wrong, my language of choice is C and I'm very well acquainted with implementing linked lists but many new programmers don't learn how to even work without these abstractions that hide away the details
I had some hard time going from src/game to src/engine then back to src/game, then looking for a definition to finally get that it was a generated file…
Then one asks the question what is predicted input what is direct input, which sounds like a simple question but how would the server know what was predicted what was direct input
13:42
Anyways, tw code isn't very unreadable, but it's not self-documenting either
I realized the game looks pretty pixalated so i went to the graphics settings and i wonderd why the resoltion is so low. Then I tried to increase it. But after restart the same option was selected ...
Okay I managed to diagnose the problem and I'm kinda stuck, only the main thread seems to be allowed to call [NSOpenGLContext update] which needs to be called whenever the window moves, [NSOpenGLContext update] is only ever called when an update is scheduled through [SDLOpenGLContext scheduleUpdate] which happens when we are setting the current window or when the window moves/gets resized/etc.
17:33
However when we now swap after the window moves we cause an [SDLOpenGLContext updateIfNeeded] which causes a [NSOpenGLContext update] outside of the main thread
Dune: Apparently we should be rendering on the thread that we create the window and context on, that's what SDL says it supports, but I don't quite see how that helps, given [NSOpenGLContext update] uses pthread_main_np
returns 1 if the calling thread is the initial thread
18:18
huh, who wrote the code to make gfx threaded anyway? everyone and their mothers seem to warn about creating the context and window on different threads being illegal
After extensive digging I have concluded that calling SDL_GL_SwapWindow outside the main thread is not legal on OSX. You can do all the GL you want on a separate thread but SDL doesn't seem to like being split off to other threads
SDL_GL_SwapWindow is the main reason why the rendering was moved to another thread at all. In the main thread it causes input latency, since the call blocks when vsync is enabled.
Well OSX doesn't allow it, however I noticed prebuilt ddnet binaries worked fine for me, after further digging I found a weird symbol called sNSOpenGLContextSuppressThreadAssertionsComputedValue which skips the main thread check on those binaries
21:58
no idea what it's computed off of yet as reading objective c disassembly is a tedious process