I am trying implement support for iOS in existing game and because it looks like iPhoneSimulator looks to not works well with OpenGLES framework I want to try ANGLE go around using obsolete OpenGLES framework.
But I do not find a way how to configure it to use ANGLE (libGLESv2 and libEGL) when targeting iOS.
you do not need to do anything explicit to enable ANGLE. it just works out-of-the-box, magically. so, write OpenGL code normally and try to build once and see for yourself! if it fails, I’m sorry but then come back here with more info and let’s debug it
When I only switched OpenGLES.framework to libGLESv2, SDL failed to initialize the context with the error message: “Failed to create OpenGL ES drawable.”
The same code can create windows and show something with OpenGLES.framework. There is still a problem with textures, but it can count against some iPhoneSimulator problems: OpenGL ES support on Apple Silicon… | Apple Developer Forums (it works on Android, Linux, macOS, Windows).
hey, I’m down to guesswork, because I never touched an Apple device in my life, but because ANGLE translates OpenGL to native GPU API, I believe you should use Metal framework. I’ve seen online that in GCC the option would be -framework Metal, dunno how’s that for XCode. so you don’t link or use anything related to OpenGL, Metal is your backend now.
I also tried to create SDL_WINDOW_METAL window instead of SDL_WINDOW_OPENGL. In that case, SDL_GL_CreateContext say, that it is no OpenGL window. So I started looking for EGL, Because EGL from ANGLE is used in ANGLE GLES tests including iOS.
What I see now, it looks like SDL is force coded to use only UIKIT and deprecated OpenGLES.framework if configured for iOS. Looks like thare is no way to compile EGL also or to switch to different GLES library without changing build files.
Without -framework Metal, I am not able to link app.
I don’t have anything useful to say at this point, sorry.
from my understanding, to use ANGLE, you should just write normal OpenGL ES 2.0 or 3.0 code. its README.md on GitHub says to support EGL 1.5 as well. so you’d use SDL_WINDOW_OPENGL, while using Metal framework and no OpenGL framework at all. does your code work on native macOS?
it says that ANGLE works only on macOS 10.14+ and iOS 12+
those particularities about UIKIT is beyond my understanding. I wonder if this changed in SDL3. there is this thing SDL2-compat that provides a SDL2 API while the implementation is SDL3.
you mentioned test cases, it would also be interesting to learn about any project that uses OpenGL and has a port to iOS, to see what they do. otherwise, you could try to find on Git who maintained the portions of code related to iOS and tag them here or e-mail them.
additionally, I don’t know well glad/glew interact with iOS.