Results 1 to 2 of 2

Thread: How can i use eglCopyBuffers?

Hybrid View

  1. #1
    Newbie
    Join Date
    Mar 2014
    Posts
    2

    Question How can i use eglCopyBuffers?

    i
    Code :
    EGLint config_list[] = {
            EGL_RED_SIZE,       8,
            EGL_GREEN_SIZE,     8,
            EGL_BLUE_SIZE,      8,
            EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
            EGL_NONE
        };
     
     
     
    EGLint num_config;
     
     
        g_dpy = GetDC(gHWND);
     
        display = eglGetDisplay(g_dpy);if (eglInitialize(display, NULL, NULL) == EGL_FALSE || eglGetError() != EGL_SUCCESS)
        {
            OutputError();
            printf("eglInitialize Error!\r\n");return;
        }
     
        eglChooseConfig(display, config_list, &config, 1, &num_config);
     
        eglBindAPI(EGL_OPENGL_ES_API);
     
        surface = eglCreateWindowSurface( display, config, (NativeWindowType)(gHWND) , NULL);if ( surface == EGL_NO_SURFACE )
        {
          OutputError();
            printf("eglCreateWindowSurface Error!\r\n");return ;
        }
    .....
     
        bitmap = CreateCompatibleBitmap((HDC)g_dpy, width, height);
     
        glClearColor( 1.0f, 0.0f, 0.0f, 1.0f );        // RedglClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
        glFlush();
        eglCopyBuffers( display, surface , bitmap );  // Error  Unhandled exception at 0x770115de in objloader.exe: 0xC0000005: Access violation writing location 0x00000003.
    Can I get some example code about eglCopyBuffers()??
    help me.

  2. #2
    Senior Member
    Join Date
    May 2008
    Posts
    100
    Have you considered using glReadPixels? Note, reading back a render target is always really expensive from a performance point of view. Alternatively, you could do something that performs a little better with EGL images or EGL fences that don't stall the GPU.

Posting Permissions

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