Skip to content

Episode #14 sampler arrays indexed with non-constant expressions are forbidden in GLSL 1.30 and later #12

@icxd

Description

@icxd
int index = source.indexOf("#type") + 6;
int eol = source.indexOf("\r\n", index);
String firstPattern = source.substring(index, eol).trim()

index = source.indexOf("#type", eol) + 6;
eol = source.indexOf("\r\n", index);
String secondPattern = source.substring(index, eol).trim();

(in Shader.java)

trying to follow this tutorial on linux (ubuntu 22 or something) and that bit of code completely breaks because of the \r\n.
i tried changing it to be just \n but then it just break. if anybody got a version that would work on linux, thanks.

EDIT:
i forgot to mention that i tried compiling it on my other windows machine using \r\n and it worked completely fine without any issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions