glGetUniformfv, glGetUniformiv

This topic contains 3 replies, has 2 voices, and was last updated by  Slion 7 years, 5 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #30207

    todi1856
    Member

    This is probably another bug:

    void glGetUniformfv(     GLuint program,

         GLint location,

         GLfloat *params);

    void glGetUniformiv(     GLuint program,

         GLint location,

         GLint *params);

    in both functions, after invoking them, params is always NULL… 🙁

    It should return at least something because the program is linked

    #34113

    Slion
    Member

    It sounds like you misunderstand the usage of those functions.
    You can find the documentation there:
    http://www.khronos.org/opengles/sdk/docs/man/

    I think you need to provide a valid pointer yourself and the requested value will be written at this address. So params should not be NULL even if the function failed.

    You are supposed to be writing something like that:
    GLint myValue;
    glGetUniformiv(…,…,&myValue);

    It’s basically C style output parameter. If the OpenGL API were written in C++ one would rather use reference parameter instead of pointer.

    #34114

    todi1856
    Member

    I was probably blind or overheated at that time 😐

    Thanks… You’re 100% correct

    I am very ashamed at the moment…

    #34115

    Slion
    Member

    It happens to the best of us Wink

Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.