OpenGL Multithreading in Android

Hi all, I am new to OpenGLES, recently read OpenGL and multithreading - OpenGL Wiki, and want to do sth similarly in Android platform, but I am not sure if it is doable in the Android platform? More specifically, I was wondering if I can do it directly using Java in Android, or I need using NDK to write in C++?

It’s really appreciate someone who have experiences with Android and OpenGLES could help me, thanks a lot!

Windows specific pseudo-code:

Thread_1:
glrc1=wglCreateContext(dc);
glrc2=wglCreateContext(dc);
BOOL error=wglShareLists(glrc1, glrc2);
if(error == FALSE)
{
DWORD errorCode=GetLastError();
LPVOID lpMsgBuf;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, errorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),(LPTSTR) &lpMsgBuf, 0, NULL);
MessageBox( NULL, (LPCTSTR)lpMsgBuf, “Error”, MB_OK | MB_ICONINFORMATION );
LocalFree(lpMsgBuf);
//Destroy the GL context and just use 1 GL context
wglDeleteContext(glrc2);
}
wglMakeCurrent(dc, glrc1);
RunMyGame();
Thread_2:
wglMakeCurrent(dc, glrc2);
LoadTexturesOnTheFly();

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.