SDL icon indicating copy to clipboard operation
SDL copied to clipboard

Need help getting GLES2 displaying on iOS w/ SDL2

Open ronaaron opened this issue 1 year ago • 1 comments

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.

ronaaron avatar Dec 06 '24 11:12 ronaaron

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.

ronaaron avatar Dec 09 '24 05:12 ronaaron

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.

ronaaron avatar Dec 23 '24 15:12 ronaaron

Great, thanks for the update!

slouken avatar Dec 23 '24 16:12 slouken