SFML community forums
Help => Window => Topic started by: mercurio7891 on April 12, 2011, 12:51:22 pm
-
hi, is it possible for resources to be shared?? suppose I have one render context created on thread 1, and in thread 2 I attempt to do a glBindBuffer command etc. would it work??
regards
-
I think you can, though I'd wait for Laurent to answer.
-
All OpenGL contexts in SFML are shared.
-
does that mean i need a dummy context in my worker thread for the sharing to work?? e.g
Thread1 (main thread):
create sfml window and main context
set main context as active
lock
draw vbo_one
unlock
Thread2 (worker thread):
create a dummy context and set it as active //is this step neccessary for sharing?
lock
update vbo_two and stuff
unlock
would it work if i don't have a dummy context? i.e just start calling gl calls on the worker thread, without creating a dummy context or setting any active context.
regards
-
would it work if i don't have a dummy context? i.e just start calling gl calls on the worker thread, without creating a dummy context or setting any active context.
No, you always need an active context to call OpenGL functions.
-
ahh thanks, i was hoping i could get away without the dummy context, as I was lazy and don't want to maintain a similar states across all context. :)
regards