Page 1 of 1

OpenGL Shader Uniform Functions Incomplete

Posted: Sun Feb 01, 2015 5:26 am
by sigvatr
I've been investigating Irrlicht's OpenGL and GLSL support and notice something interesting:

Code: Select all

 
COpenGLExtensionHandler::extGlUniform1fv(GLint loc, GLsizei count, const GLfloat *v) // pointer to data, using OpenGL function "glUniform1fv"
 
While there is an Irrlicht method to use this "glUniform1fv" function, there is no singular "glUniform1f" function that takes a copy of a GLfloat as a parameter (1-4 or otherwise, also for ints).

Unless there is a massive compatibility problem that will be invoked, I think we should include this function in Irrlicht:

Code: Select all

 
COpenGLExtensionHandler::extGlUniform1f(GLint location, GLfloat v0) // to invoke "glUniform1f"
 
I can't really think of any reasons why this function isn't already included in Irrlicht, aside from it being simply overlooked. This goes for all relevant functions respective of vX0-3 and GLfloat/GLint.

Thanks!

Re: OpenGL Shader Uniform Functions Incomplete

Posted: Sun Feb 01, 2015 9:50 am
by hendu
I believe it's not necessary. Passing the float var as a pointer works just as well.

Re: OpenGL Shader Uniform Functions Incomplete

Posted: Mon Feb 02, 2015 11:44 pm
by sigvatr
I don't believe it is entirely necessary either, but I was in the process of converting some raw OpenGL code to Irrlicht code and the incompatibility problem only arose then. 99% of the people who use Irrlicht will never find this to be a problem, but for the people with an interest in game engine frameworks and development it might be worth considering.