Results 1 to 2 of 2

Thread: eglSwapBuffers - back buffer gets reset/turned black?

  1. #1
    Junior Member
    Join Date
    Apr 2009

    eglSwapBuffers - back buffer gets reset/turned black?

    I'm developing an OpenVG app for a Windows CE 6.0 platform. My config is:

    Chosen Config (0x00000007):
    EGL_ALPHA_MASK_SIZE = 0x00000008
    EGL_ALPHA_SIZE = 0x00000000
    EGL_BIND_TO_TEXTURE_RGB = 0x00000000
    EGL_BIND_TO_TEXTURE_RGBA = 0x00000000
    EGL_BLUE_SIZE = 0x00000005
    EGL_BUFFER_SIZE = 0x00000010
    EGL_COLOR_BUFFER_TYPE = 0x0000308E
    EGL_CONFIG_CAVEAT = 0x00003038
    EGL_CONFIG_ID = 0x00000007
    EGL_CONFORMANT = 0x00000007
    EGL_DEPTH_SIZE = 0x00000000
    EGL_GREEN_SIZE = 0x00000006
    EGL_LEVEL = 0x00000000
    EGL_LUMINANCE_SIZE = 0x00000000
    ERROR 0x3004 calling eglGetConfigAttrib(EGL_MATCH_NATIVE_PIXMAP)
    EGL_MAX_PBUFFER_HEIGHT = 0x00000800
    EGL_MAX_PBUFFER_PIXELS = 0x00400000
    EGL_MAX_PBUFFER_WIDTH = 0x00000800
    EGL_MAX_SWAP_INTERVAL = 0x00000001
    EGL_MIN_SWAP_INTERVAL = 0x00000001
    EGL_NATIVE_RENDERABLE = 0x00000000
    EGL_NATIVE_VISUAL_ID = 0x00000000
    EGL_NATIVE_VISUAL_TYPE = 0x00000000
    ERROR 0x3004 calling eglGetConfigAttrib(EGL_PRESERVED_RESOURCES)
    EGL_RED_SIZE = 0x00000005
    EGL_RENDERABLE_TYPE = 0x00000007
    EGL_SAMPLE_BUFFERS = 0x00000000
    EGL_SAMPLES = 0x00000000
    EGL_STENCIL_SIZE = 0x00000000
    EGL_SURFACE_TYPE = 0x00000027
    EGL_TRANSPARENT_TYPE = 0x00003038
    ERROR 0x3004 calling eglSurfaceAttrib(ELG_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED)
    EGL_SWAP_BEHAVIOR = 0x3095

    I have code that executes two eglSwapBuffers() calls in a row:

    Code :
    if (EGL_FALSE == eglSwapBuffers(eglDisplay, eglSurface)) HandleEglError();
    if (EGL_FALSE == eglSwapBuffers(eglDisplay, eglSurface)) HandleEglError();

    When the first one executes, the entire window area turns blue (that's the expected behavior).
    When the second one executes, the entire window area turns black (quite unexpected).
    At other times through the code, the second one will leave the window blue.

    Now, I'm not new to programming but I am *quite* new to OpenVG/OpenGL, so it's entirely possible that I've got something configured incorrectly.

    I'm curious: if I *wanted* this behavior, what would I do? Basically, I'm trying to figure out what configuration setting/OpenVG/OpenGL call I might have done to cause this.

    Is there anything I can do to determine what attributes on the display or surface might be affecting this?

    Any ideas? Anyone?

    -- Steve G.

  2. #2
    Senior Member
    Join Date
    May 2006

    Re: eglSwapBuffers - back buffer gets reset/turned black?

    Since the config does not support the swap behaviour EGL_BUFFER_PRESERVED, it means that the contents of the backbuffer after a call to eglSwapBuffers are undefined. Since you don't draw anything in between the two eglSwapBuffers calls, the undefined contents become visible. In this particular case it just happens to be black.

    It is likely that your target platform uses buffer flipping, which means the previous frontbuffer becomes the backbuffer and vice versa, and black is just the initial buffer state.
    Georg Kolling, Imagination Technologies
    Please ask questions specific to PowerVR hardware or SDKs on the PowerVR Insider Forum |

Similar Threads

  1. EmptyBufferDone call-back not coming Back after sometime !
    By ckarthickit in forum OpenMAX IL - Discussion and questions about OpenMAX IL interface
    Replies: 0
    Last Post: 02-27-2013, 12:26 AM
  2. Reset or release invalidated command queue
    By elwinlee in forum OpenCL - parallel programming of heterogeneous systems
    Replies: 1
    Last Post: 02-18-2012, 11:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts