hu xiaohua
|
Re: the problem about create windows by thread
|
hu xiaohua
08/12/2009 10:26 PM
post35869
|
Re: the problem about create windows by thread
> I wroten a App On Qnx.I want to create three windows.
> Process 1:
> (1)In KdMain:
> ①init the windows info(three windows).win_size/win_name and so on
> ②init EGL (three times)
> a.Get the display by eglGetDisplay()
> b.init EGL by eglInitialize()
> c.eglBindAPI()
> d.kdCreateWindow()
> e.kdRealizeWindow()
> f.eglCreateWindowSurface()
> g.kdSetWindowPropertyiv()
> h.eglCreateContext()
> ③create three threads by kdThreadCreate()
> (2)In each thread:
> ①Draw the picture on each window by vgImageDraw()
> the result is:
> Three windows work OK.But,if any other thread sents event to the three
> windows,they all receive the event by KdMain().
>
> Process 2:
> (1)In KdMain
> ①create three threads
> (2)In each thread:
> ①init the windows info
> ②init EGL( the steps the same as above )
> ③create three threads by kdThreadCreate()
> ④draw the picture on window by vgImageDraw()
> the result is:
> Three thread work OK,each thread can receive event.But the picture is not
> displayed on the windows.
>
> So ,my question is :
> ①Must I init EGL in KdMain?
> ②Is there any problem with my process?
>
> I excepting your responses,Thanks a lot.
PS:in vgImageDraw():
eglMakeCurrent()→vgSeti()→vgCreateImage()→vgImageSubData()
→vgDrawImage()→eglSwapBuffers()
|
|
|