Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenGL failing to init properly on iOS #1687

Closed
grimaldini opened this issue Jul 23, 2020 · 7 comments
Closed

OpenGL failing to init properly on iOS #1687

grimaldini opened this issue Jul 23, 2020 · 7 comments

Comments

@grimaldini
Copy link

grimaldini commented Jul 23, 2020

Could not load necessary function to initialize OpenGL context

Seems like OpenGL is not initializing properly on iOS, crashing on line 298 of EaglContext.mm
glGenFramebuffersOESFunc(1, &m_framebuffer); with null glGenFramebuffersOESFunc and null m_framebuffer.

Your environment

  • os: iOS (simulator: iOS 13.6 (17G64), Model: iPhone SE (2nd generation))
  • version: master
  • Xcode Version 11.6 (11E708)
  • No special compiler flags used

Steps to reproduce

Just running the code below, will crash on line 1 of the main function
Output:

Could not load necessary function to initialize OpenGL context
2020-07-23 03:57:18.405916-0700 MyApp[20222:452887] [Assert] -[UIApplication setStatusBarOrientation:] and -[UIApplication setStatusBarOrientation:animated:] API have been deprecated on iOS 8.0 and are no-ops on iOS 13.0
#ifdef __APPLE__
    #include "TargetConditionals.h"
    #if TARGET_OS_IPHONE
        #include <SFML/Main.hpp>
    #endif
#endif

#include <SFML/Graphics.hpp>

int main() {
	sf::RenderWindow window(sf::VideoMode(), "Hello world!");
	while(window.isOpen()) {
		sf::Event event;
		while (window.pollEvent(event))
		{
			if (event.key.code == sf::Keyboard::Escape) {
				window.close();
			}
			
			if (event.type == sf::Event::Closed)
				window.close();
		}
		
		window.clear();
		window.display();
	}
	
	return EXIT_SUCCESS;
}

Expected behavior

Should show an empty black screen

Actual behavior

Crash

@eXpl0it3r
Copy link
Member

Not sure if the crash happened because of the OpenGL issue or the deprecated function.
Can you try and target something earlier than iOS 13 to see if it's because of the no-oped function in iOS 13?

@grimaldini
Copy link
Author

grimaldini commented Jul 24, 2020

I doubt it, I think it might be a regression in master. I downloaded v2.5.1 and it worked correctly there, well semi-correctly, I needed to add window->setActive(); after initializing the window for some reason, but that seems to be a different issue.

@JonnyPtn
Copy link
Contributor

Have you got a device to test on? I know the simulator was updated not so long ago (with xcode 11 I think) to make Metal available, which may have had some sort of impact on other stuff. If not (or if the same thing happens on the device) then I should be able to take a look

@grimaldini
Copy link
Author

Unfortunately I don't have a test device...

@MoVoDesign
Copy link

Same issue today (2020-12-30) with

OSX 10.14.6
XCode 11.2.1
Simulator - iOS 13.2 SDK
SFML 2.5.1 (built arm64 + x86_64, made fat libs, code-signed)

@JonnyPtn
Copy link
Contributor

JonnyPtn commented Apr 4, 2021

So this is failing because it's not able to load libGLESv1_CM.dylib anymore. Why that is, I don't know. I can't really find any explanation for it online.

@eXpl0it3r
Copy link
Member

@MoVoDesign / @grimaldini can you give #1804 a try? 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants