Need help getting GLES2 displaying on iOS w/ SDL2
I'm using the "Nuklear" GUI library with SDL2 using the GLES2 backend. It works perfectly for Android and Raspberry Pi, but I'm having difficulty getting display on iOS (iPhone 5s in this case).
I can set the window background color, so I know that some GL is working. Also, my app is responding to SDL events.
However, I don't get anything rendered. I saw the note in README-ios.md about the Renderbuffer etc, but I couldn't find any sample code to assist with that, nor did I really understand what or where I need to do that.
Any help would be most appreciated.
Has anyone any ideas why I don't see any rendering?
I put code like
glBindFramebuffer(GL_FRAMEBUFFER, fb);
glBindRenderbufferOES(GL_RENDERBUFFER, cb);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, _cb);
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER) ;
if(status != GL_FRAMEBUFFER_COMPLETE) {
log_print("failed to make complete framebuffer object %x", status);
}
before rendering, and un-bound them after the SDL_GL_SwapWindow(). I got the values of 'fb' and 'cb' at window creation time using SDL_GetWindowWMInfo() as directed; the video driver is 'uikit' but I'm not doing anything specific to UIKit.
It turns out you do not need the other nonsense. All you need is to tell SDL you want GLES3 and not GLES2, then it magically works.
Great, thanks for the update!