Skip to content

Default SpriteBatch shader fails to compile #3559

@ncthbrt

Description

@ncthbrt

Hi there:

The following code is crashing with the error code posted at the bottom of this issue:

public class Iteration3Main extends Game {
    SpriteBatch batch;
    private static TextureAtlas atlas;
    private static final float colourCycleTime = 30f;
    private static HSVColour currentColour = new HSVColour(0, 0.81f, 0.7f, 1f);

    public static Colour currentColour() {
        return currentColour.toRGB();
    }

    private static TitleScreen titleScreen;
    private static Iteration3Main main;

    public static TextureAtlas textureAtlas() {
        return atlas;
    }

    @Override
    public void create() {
        batch = new SpriteBatch();
        atlas = new TextureAtlas(Gdx.files.internal("global.atlas"));
        titleScreen = new TitleScreen(this, atlas);
        main = this;
        setScreen(titleScreen);
    }


    @Override
    public void render() {
        float nextHue = currentColour.hue() + Gdx.graphics.getDeltaTime() / colourCycleTime;
        nextHue = nextHue > 1 ? 0 : nextHue;
        currentColour.hue(nextHue);
        Gdx.gl.glClearColor(0, 0, 0, 1);
        Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
        super.render();
    }
}

I'm on a fresh install of Windows 10, in IntelliJ 15.0, running Oracle JDK version 1.8.0_65. This project was working the day before yesterday with an existing Windows10 installation, but I believe an older version of Java 1.8.0 Installed. This is possibly the source of my troubles. I'll install the previous release and report back.

Exception in thread "LWJGL Application" java.lang.IllegalArgumentException: Error compiling shader: Vertex shader failed to compile with the following errors:
ERROR: error(#272) Implicit version number 110 not supported by GL3 forward compatible context
ERROR: error(#273) 1 compilation errors.  No code generated

Fragment shader failed to compile with the following errors:
ERROR: error(#272) Implicit version number 110 not supported by GL3 forward compatible context
ERROR: error(#273) 1 compilation errors.  No code generated


    at com.badlogic.gdx.graphics.g2d.SpriteBatch.createDefaultShader(SpriteBatch.java:157)
    at com.badlogic.gdx.graphics.g2d.SpriteBatch.<init>(SpriteBatch.java:120)
    at com.badlogic.gdx.graphics.g2d.SpriteBatch.<init>(SpriteBatch.java:73)
    at com.deepwallgames.quantumhue.Iteration3Main.create(Iteration3Main.java:29)
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:143)
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:120)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions