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

MacOS crash with Error compiling shader: Vertex shader #4

Open
habdankm opened this issue Feb 24, 2022 · 2 comments
Open

MacOS crash with Error compiling shader: Vertex shader #4

habdankm opened this issue Feb 24, 2022 · 2 comments

Comments

@habdankm
Copy link
Contributor

Hi Christian,

In current version of a game on macOS Catalina 10.15.7 (19H1715), NVIDIA GeForce GT 650M 1 GB, I'm not able to run game. It crash with this exception:
`Exception in thread "main" java.lang.IllegalArgumentException: Error compiling shader: Vertex shader
ERROR: 0:1: '' : #version required and missing.
ERROR: 0:1: 'attribute' : syntax error: syntax error
Fragment shader:
ERROR: 0:1: '' : #version required and missing.
ERROR: 0:7: 'varying' : syntax error: syntax error

    at com.badlogic.gdx.graphics.g2d.SpriteBatch.createDefaultShader(SpriteBatch.java:163)
    at com.badlogic.gdx.graphics.g2d.SpriteBatch.<init>(SpriteBatch.java:126)
    at com.badlogic.gdx.graphics.g2d.SpriteBatch.<init>(SpriteBatch.java:80)
    at mysko.pilzhere.fox3d.Foxenstein3D.create(Foxenstein3D.java:51)
    at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.initializeListener(Lwjgl3Window.java:433)
    at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.update(Lwjgl3Window.java:381)
    at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.loop(Lwjgl3Application.java:141)
    at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:117)
    at mysko.pilzhere.fox3d.desktop.DesktopLauncher.main(DesktopLauncher.java:40)`
@habdankm
Copy link
Contributor Author

Changing:
desktop/src/mysko/pilzhere/fox3d/desktop/DesktopLauncher.java
36 config.useOpenGL3(true, 3, 3); // 3.3 Works on MacOSX
to
36 config.useOpenGL3(false, 3, 2); // Note however that Mac OS X does only support 3.2
solve issue, but it's not best solution.
trying:
36 config.useOpenGL3(true, 3, 2);
give same error

@habdankm
Copy link
Contributor Author

maybe you are willing to accept solution like this:
if (System.getProperty("os.name").contains("Mac")) { config.useOpenGL3(false, 3, 2); } else { config.useOpenGL3(true, 3, 3); }
than I can make small PR.

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

No branches or pull requests

1 participant