Threading restrictions on graphics library

BlitzMax Forums/BlitzMax Programming/Threading restrictions on graphics library

jpavel(Posted 2009) [#1]
Are there any restrictions on which thread can call Max2D routines?
(As in, do all calls need to come from the main program thread, or the thread that initializes the graphics system?)

Some toolkits are designed to be used in a particular way, and I want to make sure I structure my rendering correctly.

Thanks,
Jesse


Ked(Posted 2009) [#2]
Just to be safe (because I'm also unsure of this), I'd call Max2D functions in the main thread, then call updating functions, etc from another thread.


GfK(Posted 2009) [#3]
Apparently, graphics contexts are not thread-safe, so basically you don't want to be doing any rendering within a thread. I think it was BlitzSupport that mentioned it before.

It might be worth mentioning that I did run some tests with rendering in a thread before and everything seemed to work OK. But I guess that doesn't guarantee that it'll work for everybody, or in all circumstances.