Results 1 to 8 of 8

Thread: problem refreshing resize

  1. #1
    Junior Member
    Join Date
    Mar 2008
    Posts
    9

    problem refreshing resize

    Hello everyone, I'm having a problem when I resize a window.
    After I make a resize I do this:
    Code :
    glViewport(0, 0, width, height);
    glReadBuffer(GL_FRONT);
    glDrawBuffer(GL_BACK);
    Now I want to do the same with OpenglES but I don't have glReadBuffer and glDrawBuffer, so I tried remove them but it didn't work because the opengl scene didn't refresh the resize.
    Someone know how to replace the glReadBuffer and glDrawBuffer functions? Because I didn't found a solution.
    Thanks a lot
    Santiago

  2. #2

    Re: problem refreshing resize

    Assuming you have an egl implementation on your platform, I'd suggest the eglMakeCurrent, eglSwapBuffers functions depending on what exactly your application is doing. If you don't have egl, then you'll need to use whatever native graphics framework to manage your color buffers.

    Also keep in mind, GLES does not include any window resizing callbacks like those available in GLUT for desktop GL. So if your mingling GLUT functions calls with GLES function calls be mindful of the fact things may not work as expected, if at all.

  3. #3
    Junior Member
    Join Date
    Mar 2008
    Posts
    9

    Re: problem refreshing resize

    I'm using Vincent implementation (http://www.vincent3d.com/).
    My desktop code is something like this:
    Code :
    wglMakeCurrent(deviceContextHandle,renderingContextHandle);
     
    glViewport(0, 0, width, height);
    glReadBuffer(GL_FRONT);
    glDrawBuffer(GL_BACK);

    and on OpenGLES I tried something like this:
    Code :
    glesDisplay := eglGetDisplay(deviceContextHandle);
    glesSurfaceRead = eglGetCurrentSurface(EGL_READ);
    glesSurfaceDraw = eglGetCurrentSurface(EGL_DRAW);
    eglMakeCurrent(glesDisplay, glesSurfaceDraw, glesSurfaceRead, eglGetCurrentContext);
     
    glViewport(0, 0, width, height);
    eglSwapBuffers(glesDisplay, glesSurfaceRead);

    But it didn't work, I don't know if someone could help me.
    Thanks in advance
    Santiago

  4. #4
    Senior Member
    Join Date
    Sep 2003
    Location
    Seattle, WA
    Posts
    246

    Re: problem refreshing resize

    Maybe you could explain what you'd expect to happen when you execute the last line in your example? And how this relates to resizing?

    - HM

  5. #5
    Junior Member
    Join Date
    Mar 2008
    Posts
    9

    Re: problem refreshing resize

    I upload a screenchot to make it clear.

    When I resize the window I expect to happen what you can see on the right, but I obtain the result that you can see on the left.
    The lines are bigger than the original size but the scene has the same size than the original.
    If you asked me about the swapBuffers... I don't know why I do a swapBuffer, I'm a newbie and I tried different things to see if I can correct my problem.
    Thanks

  6. #6

    Re: problem refreshing resize

    It looks like your viewport is not updated with the correct window dimensions after your window is resized. How are you detecting when a resize of your window occurs? The win32 api generates a WM_SIZE event when a window resize occurs which can use to update the viewport with the correct dimensions.

  7. #7
    Senior Member
    Join Date
    Sep 2003
    Location
    Seattle, WA
    Posts
    246

    Re: problem refreshing resize

    You will need to create new rendering surface matching the new window size and re-associate them with the context. As the previous reply indicated, this needs to happen as response to WM_SIZE.

    You can see this in http://ogl-es.svn.sourceforge.net/vi...37&view=markup as response to WM_SIZE.

    Hope that helps.

    - HM

  8. #8
    Junior Member
    Join Date
    Mar 2008
    Posts
    9

    Re: problem refreshing resize

    Thanks a lot for the information! I'm going to try what you told me.
    Santiago

Similar Threads

  1. how to resize FBO???
    By red112 in forum OpenGL ES general technical discussions
    Replies: 1
    Last Post: 02-01-2013, 08:59 AM
  2. Resize canvas in chrome crashes script
    By JasonSage in forum Developers Coding:Beginner
    Replies: 0
    Last Post: 06-28-2011, 08:42 PM

Posting Permissions

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