Multi-threaded on win98 !

i have a problem…
i use 2 threads, each with its own RC an DC.
the program works very fine on win2000 but it crashes on win98?..
it crashes exactly in gluMakeCurrent…
anyone have an idea please notify me

try glfw.

Hi,
Maybe I missing something here, but why aren’t you using the wgl functions? I think the reason is your using glut.

lobstah…

i don’t use glut

hi…

hm, maybe i am missing something now, but what do you mean with “RC” and “DC”?

anyway, you have to call all gl functions in one thread, and under win9x this thread has to be the main thread.
under Win NT (2000 and XP), X and MacOS X you might be able to do all graphics in an other thread than main…

hope that helps…
good luck!

Tolga.

Hi,

what do you mean with “in 98 you have to do all the graphics in the main-thread”? Do you mean the WinMain-Thread? That´s not right. I wrote a program, that creates an extra-thread only for the graphics. However it is true, that you have to do all the gl-initializing in the one thread that also uses the gl-commands.

Your program won´t run if you initialize gl in the winmain-thread but want to draw things inside another thread.

I tested this program under 98 and ME, so i am sure it works.

Jan.

i mean by RC and DC that each thread initializes its private HDC and HGLRC , the 2 threads draws to 2 different window… the program runs very well in win2000 but in win98 it crashes …

Originally posted by Mahdy:
i mean by RC and DC that each thread initializes its private HDC and HGLRC , the 2 threads draws to 2 different window… the program runs very well in win2000 but in win98 it crashes …

It may be that something before had failed like SetPixelFormat() or wglCreateContext. Be sure to specify CS_OWNDC before creating the window, and call SetPixelFormat after creation of the window (WM_CREATE)

Otherwise, it should be fine.

V-man

It Seems that in Win98 all GL calls must be in only one thread… i don’t know why but that’s it…
in win2000 i can handle multi threaded opengl programs without any problems