Hey,
I’ve tried to get the uniform locations from my fragment shader uniform trhough glGetUniformLocation
in my fragment shader
uniform float u_fl;
.cpp
auto glp = new GLProgram();
glp->autorelease();
if (!glp->initWithFilenames("vertex.vsh", "fragment.fsh")) { DEBUG_BREAK; }
..... glp->bind attribs etc.....
glp->link();
glp->updateUniforms();
GLProgramState* glprogramstate = GLProgramState::getOrCreateWithGLProgram(glp);
setGLProgramState(glprogramstate);
auto u_loc = glGetUniformLocation(glp->getProgram(), "u_fl");
//or
auto a = glp->getUniformLocation("u_fl");
ls->setGLProgram(glp);
but it always returns -1 and the errorcode GL_INVALID_VALUE.
It does work on Windows though, does anyone know if I miss anything special from the OpenGL ES version?