Imagination PowerVR SDK Blog

Can't render multiple windows?

Mistral OMAP35x EVM


Windows CE 6.0


Shouldn't it be possible to render multiple windows from one context?  I can open multiple processes (each with a window), but I can't open multiple windows in a single process.  The first window renders but the second remains black:


    // Create a single display, config, context, shader program and texture

    // Create two native windows: g_HostWindowA and g_HostWindowB

    // Create an EGL surface for each window
    g_surfaceA = eglCreateWindowSurface( g_eglDisplay, g_eglActiveConfig, (NativeWindowType)(g_HostWindowA) , NULL);
    g_surfaceB = eglCreateWindowSurface( g_eglDisplay, g_eglActiveConfig, (NativeWindowType)(g_HostWindowB) , NULL);

    // Render windows sequentially
    eglMakeCurrent( g_eglDisplay, g_surfaceA, g_surfaceA, g_eglContext );
    eglSwapBuffers( g_eglDisplay, g_surfaceA );

    eglMakeCurrent( g_eglDisplay, g_surfaceB, g_surfaceB, g_eglContext );
    eglSwapBuffers( g_eglDisplay, g_surfaceB );

void Render(void)
    static const VERTEX verts[] = { ... }

    glClearColor (0.0, 0.0, 0.0, 1.0);
    glClear      (GL_COLOR_BUFFER_BIT);

    glVertexAttribPointer(VERTEX_POSITION,    3, GL_FLOAT,            GL_FALSE,   sizeof(VERTEX), &verts[0].x);
    glVertexAttribPointer(VERTEX_DIFFUSE,     4, GL_UNSIGNED_BYTE,    GL_TRUE,    sizeof(VERTEX), &verts[0].color);
    glVertexAttribPointer(TEXTURE_COORD,      2, GL_FLOAT,            GL_FALSE,   sizeof(VERTEX), &verts[0].u);

    glActiveTexture( GL_TEXTURE0 );
    glBindTexture  ( GL_TEXTURE_2D, g_TextureIDs[0] );
    GLint sampler1 = glGetUniformLocation ( g_uiProgramObject, "inTexture1" );
    glUniform1i ( sampler1, 0 );

    glDrawArrays(GL_TRIANGLES, 0, 6);





Update: I've verified this code works as expected on two other OpenGL ES 2.0 implementations.  So I think this is a bug in the PowerVR SGX drivers for Windows CE.



Sorry for the very late reply to this - we’ve not made much progress on this issue. We haven’t been able to reproduce the problem on any system we have and we don’t have the actual board you’re running on here.

I’m afraid the best I can suggest is talking to TI about this issue.