Posted: 14th Oct 2011 16:05
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.)

+ Code Snippet
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.

+ Code Snippet
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?
Posted: 14th Oct 2011 16:31
+ Code Snippet
extern Broadcaster* g_pBroadcaster;
AGKPacket packet;
packet.AddInt( 5 );
g_pBroadcaster = new Broadcaster();
g_pBroadcaster->SetData( 45630, &packet, 1000 );


Sets up a broadcaster to work around a Samsung bug that won't allow you to receive broadcasts otherwise (it doesn't start the broadcaster until later on)

+ Code Snippet
g_keypad.Construct( KEYPAD_STYLE_NORMAL, KEYPAD_MODE_ALPHA );
g_keypad.AddTextEventListener(g_textListener);


Constructs the text input screen so you can input text using StartTextInput().
Posted: 14th Oct 2011 17:10
What to do with the delay?. Maybe make an initialization (Broadcaster) in a separate method? Samsung does not take the game.
Posted: 14th Oct 2011 17:46
The broadcaster doesn't do anything special but set a few values internally, so I'm more inclined to think that the keypad is causing the slow down. But since I can't replicate the problem here I have nothing to go on. Can you test creating a keypad in your code to see if your can find out what it doesn't like, or if there is method of creating it that works faster?
Posted: 15th Oct 2011 6:37
We have narrowed this issue to a possible fix, which will be in the 105 build. Watch this space (and the issues board for more info).