Hi,
You (AGK) sended my source code for function
void agk:
latformInitGL(void* ptr)
This function on some phones (samsung 8500, 8530) performed long time. (~20 - 30 sec.)
void agk::PlatformInitGL(void* ptr)
{
g_pFrame = (Controls::Frame*)ptr;
//AppLog("InitEGL start");
EGLint numConfigs = 1;
EGLint eglConfigList[] = {
EGL_RED_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_ALPHA_SIZE, 0,
EGL_DEPTH_SIZE, 16,
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES_BIT,
EGL_NONE
};
EGLint eglContextList[] = {
EGL_CONTEXT_CLIENT_VERSION, 1,
EGL_NONE
};
//AppLog("eglBindAPI");
eglBindAPI(EGL_OPENGL_ES_API);
//AppLog("eglGetDisplay");
eDisplay = eglGetDisplay((EGLNativeDisplayType)EGL_DEFAULT_DISPLAY);
if (EGL_NO_DISPLAY == eDisplay)
{
AppLog("[GlesCube11] eglGetDisplay() is failed. [0x%x]\n", eglGetError());
}
//AppLog("eglInitialize");
if (EGL_FALSE == eglInitialize(eDisplay, null, null) ||
EGL_SUCCESS != eglGetError())
{
AppLog("[GlesCube11] eglInitialize() is failed. [0x%x]\n", eglGetError());
}
if (EGL_FALSE == eglChooseConfig(eDisplay, eglConfigList, &eConfig, 1, &numConfigs) ||
EGL_SUCCESS != eglGetError())
{
AppLog("[GlesCube11] eglChooseConfig() is failed. [0x%x]\n", eglGetError());
}
if (!numConfigs)
{
AppLog("[GlesCube11] eglChooseConfig() has been failed. because of matching config doesn't exist \n");
}
eSurface = eglCreateWindowSurface(eDisplay, eConfig, (EGLNativeWindowType)ptr, null);
if (EGL_NO_SURFACE == eSurface ||
EGL_SUCCESS != eglGetError())
{
AppLog("[GlesCube11] eglCreateWindowSurface() has been failed. EGL_NO_SURFACE [0x%x]\n", eglGetError());
}
eContext = eglCreateContext(eDisplay, eConfig, EGL_NO_CONTEXT, eglContextList);
if (EGL_NO_CONTEXT == eContext ||
EGL_SUCCESS != eglGetError())
{
AppLog("[GlesCube11] eglCreateContext() has been failed. [0x%x]\n", eglGetError());
}
if (false == eglMakeCurrent(eDisplay, eSurface, eSurface, eContext) ||
EGL_SUCCESS != eglGetError())
{
AppLog("[GlesCube11] eglMakeCurrent() has been failed. [0x%x]\n", eglGetError());
}
//AppLog("InitEGL end");
// get the device width and height for other parts of the app to use
int x = 0, y = 0, deviceWidth = 0, deviceHeight = 0;
g_pFrame->GetBounds(x, y, deviceWidth, deviceHeight);
m_iRenderWidth = deviceWidth;
m_iRenderHeight = deviceHeight;
m_iRealDeviceWidth = m_iRenderWidth;
m_iRealDeviceHeight = m_iRenderHeight;
SystemTime::GetTicks( m_lMillisecondsLast );
Math::Srand( m_lMillisecondsLast );
extern Broadcaster* g_pBroadcaster;
AGKPacket packet;
packet.AddInt( 5 );
g_pBroadcaster = new Broadcaster();
g_pBroadcaster->SetData( 45630, &packet, 1000 );
// text input
g_keypad.Construct( KEYPAD_STYLE_NORMAL, KEYPAD_MODE_ALPHA );
g_keypad.AddTextEventListener(g_textListener);
}
If I am using to initialize OpenGL without (see code below), initialization OpenGL is performed less than 1 second.
extern Broadcaster* g_pBroadcaster;
AGKPacket packet;
packet.AddInt( 5 );
g_pBroadcaster = new Broadcaster();
g_pBroadcaster->SetData( 45630, &packet, 1000 );
// text input
g_keypad.Construct( KEYPAD_STYLE_NORMAL, KEYPAD_MODE_ALPHA );
g_keypad.AddTextEventListener(g_textListener);
What does this code?