Results 1 to 2 of 2

Thread: rendering multiple OpenGL views within a single UIView (iOS)

  1. #1
    Junior Member
    Join Date
    May 2011
    Posts
    2

    rendering multiple OpenGL views within a single UIView (iOS)

    Our company has developed code to render a single (full-screen) 3D scene.
    We wish to adapt that code to render two 3D scenes within the same iOS window (two UIViews using OpenGL ES).
    I attempted to leverage the approach described by this example code:
    http://gamesfromwithin.com/opengl-and-uikit-demo
    That approach shared one context among two or more frame buffers.
    During initialization, my current code generates the the frame buffers and checks that they were properly constructed.
    Later - right before rendering - we attempt to rebind the frame buffer and color render buffer that corresponds to the target view.
    The first attempt for the first view worked fine - but the second attempt for the second view failed.

    glBindFramebufferOES(GL_FRAMEBUFFER_OES, buffer->m_frameBufferHandle);
    CHECK_GL_ERRORS();

    The CHECK_GL_ERRORS macro above generated the following log message:

    2011-05-03 19:13:31.283 TestMorph[79963:40b] OpenGL: +[FrameBufferUtils Set:] [error 1281]

    This means that glBindFramebufferOES returned
    GL_INVALID_VALUE.

    The manual page for glBindFramebuffer doesn't list that as a possible error.

    Can anyone suggest steps to resolve this error (or another way to do what I am ultimately trying to accomplish)?

    Thanks,
    Chuck

  2. #2
    Junior Member
    Join Date
    May 2011
    Posts
    2

    Re: rendering multiple OpenGL views within a single UIView (

    I have resolved my own problem.
    The problem appeared to be related to calling: glBindFramebufferOES.
    Instead - it was related to other calls where I hadn't detected the error
    (specifically either glFrustumf or glRotatef).
    My code now creates two distinct scenes in sub-views of the main view.

    Thanks for reading.

    Chuck

Similar Threads

  1. Blending multiple textures on a quad [OpenGL ES 2 iOS 5.1]
    By leftblank in forum OpenGL ES general technical discussions
    Replies: 2
    Last Post: 06-17-2012, 11:19 PM
  2. Replies: 4
    Last Post: 04-04-2010, 04:04 AM
  3. multiple kernel for single device(1 gpu)
    By deNorma in forum OpenCL
    Replies: 1
    Last Post: 03-01-2010, 01:59 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
  •