PDA

View Full Version : Multi-threaded on win98 !



Mahdy
05-29-2002, 10:28 PM
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

Ozzy
05-30-2002, 02:17 AM
try glfw.

lobstah
05-31-2002, 07:49 AM
Hi,
Maybe I missing something here, but why aren't you using the wgl functions? I think the reason is your using glut.

lobstah...

Mahdy
06-01-2002, 01:23 AM
i don't use glut

Tolga Dalman
06-01-2002, 10:29 AM
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.

Jan
06-02-2002, 01:23 AM
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.

Mahdy
06-02-2002, 03:13 AM
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 ....

V-man
06-02-2002, 04:57 AM
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

Mahdy
06-03-2002, 03:49 AM
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