rmordechay / glsl-plugin-idea

GLSL support for JetBrains IDE's
Apache License 2.0
33 stars 11 forks source link

Multi function definitions not working #37

Open TcePrepK opened 3 months ago

TcePrepK commented 3 months ago

image Well as you can see from this image alone, 2 same named functions but different parameters. It is not recognized in the second call. As an addition to this, if you were to "#include" this from some other file, it doesn't even work... (it is very easy to reproduce) image

rmordechay commented 3 months ago

Hi @TcePrepK can you pls send me that as text?

TcePrepK commented 3 months ago
float smoothFunc(float s) {
    return 3.0 * s * s - 2.0 * s * s * s;
}

float smoothFunc(float a, float b, float x) {
    float lambda = min(1.0, max(0.0, (x - a) / (b - a)));
    return smoothFunc(lambda);
}

here is the code, sorry for late response I wasn't so available! And for the secondary part, calling it with anything reproduces it.

smoothFunc(0.0, 1.0, 0.0);
rmordechay commented 3 months ago

Yeah as you mentioned above it's the overloading. I didn't even know it's possible. I will fix it.