Which function aren't thread safe?

in the document I have read that SDL_SetVideoMode and SDL_PumpEvents they must
remain in the same one thread

I must know what function must be implemented in a sure one thread ?

Any OpenGL call must be in the same thread as SDL_Init I believe.

/Popi

Goul_duKat wrote:> in the document I have read that SDL_SetVideoMode and SDL_PumpEvents

they must remain in the same one thread

I must know what function must be implemented in a sure one thread ?


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Pontus Pihlgren wrote:

in the document I have read that SDL_SetVideoMode and SDL_PumpEvents
they must remain in the same one thread

I must know what function must be implemented in a sure one thread ?

Any OpenGL call must be in the same thread as SDL_Init I believe.

/Popi

sure ???

or i use the GLfunction in the thread where init the video mode ???

ex:

main thread :
main:
SDL_Init(0);

thread 1:
SDL_InitSubSystem(SDL_INIT_VIDEO);
SDL_SetVideoMode(x,y,bpp,SDL_OPENGL);
GLFUNC();
SDL_PumpEvents();

this is legacy ???

ex2:

main thread :
main:
SDL_Init(SDL_INIT_VIDEO);

thread 1:
SDL_SetVideoMode(x,y,bpp,SDL_OPENGL);
GLFUNC();
SDL_PumpEvents();

and this ???

tnx

Goul_duKat wrote:

Pontus Pihlgren wrote:

in the document I have read that SDL_SetVideoMode and SDL_PumpEvents
they must remain in the same one thread

I must know what function must be implemented in a sure one thread ?

Any OpenGL call must be in the same thread as SDL_Init I believe.

/Popi

sure ???

or i use the GLfunction in the thread where init the video mode ???

ex:

main thread :
main:
SDL_Init(0);

thread 1:
SDL_InitSubSystem(SDL_INIT_VIDEO);
SDL_SetVideoMode(x,y,bpp,SDL_OPENGL);
GLFUNC();
SDL_PumpEvents();

this is legacy ???

ex2:

main thread :
main:
SDL_Init(SDL_INIT_VIDEO);

thread 1:
SDL_SetVideoMode(x,y,bpp,SDL_OPENGL);
GLFUNC();
SDL_PumpEvents();

and this ???

tnx

Hmm, I’m guessing the first would work. You will just have to try.