- December 28, 2009 at 3:40 pm #30018
In my application i have the current setup under windows :
– Main Thread with a standard WndProc and a classic while loop in the main()
– Game Thread : handle logic and display
In the main thread im creating the window and setup the device but when i trigger the game thread i setup a new GL Context to be able to createtexture and rendering stuff. by this piece of code :Code:localContext = eglCreateContext(CIgGLRenderer::GetInstance()->eglDisplay, CIgGLRenderer::GetInstance()->eglConfig, CIgGLRenderer::GetInstance()->eglContext, NULL);
localSurface = eglCreateWindowSurface(CIgGLRenderer::GetInstance()->eglDisplay, CIgGLRenderer::GetInstance()->eglConfig, CIgGLRenderer::GetInstance()->eglWindow, NULL);
eglMakeCurrent(CIgGLRenderer::GetInstance()->eglDisplay, localSurface, localSurface, localContext);
By doing this it seems that everything went fine but soon as i make a
i just get a blank screen with the correct clear color but no quads at all.
I searched for a solution but so far no luck.
Anyone can help ?
Thanks !December 28, 2009 at 4:45 pm #33639
I made some additionnal test :
1/ Remove the game thread
2/ Just show a texture in the main thread -> this is working without problem
3/ set NULL for the render context and makecurrent the main thread just like the first firt makecurrent call and draw a texture -> not working, just getting the clear color..
here’s the piece of codeCode:assert(eglMakeCurrent(pRenderer->eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT)==EGL_TRUE);
then before the renderingCode:EGLBoolean ret = eglMakeCurrent(eglGetDisplay((NativeDisplayType) hDC), eglSurface, eglSurface, eglContext);
I assume that if i can get this working then i will get the thread context working too..