Closed Schneegans closed 9 years ago
Hi,
Thanks for catching this one. Your method of setting the array of vec3 is correct. There was a bug but in the other overload of SetValue(n, v)
.
I've fixed it in bffc6a0e3e4fb701dfa6d3df90168724e3cd4794 please let me know it it works for You.
Works like a charm! Thank you very much! Just one small issue with current develop: GL_CONTEXT_RELEASE_BEHAVIOR
and glGetGraphicsResetStatus
(used by https://github.com/matus-chochlik/oglplus/blob/develop/include/oglplus/context/numeric_queries.hpp) are not defined on my system (Ubuntu 14.04 with glew 1.10 and nvidia 331.38).
Again thank you for the quick fix!
This seems like a problem in GLEW (they sometimes define GL_VERSION_X_Y even when they don't define all required symbols).
Would adding #ifdef GL_CONTEXT_RELEASE_BEHAVIOR
and/or #ifdef GL_RESET_NOTIFICATION_STRATEGY
around the affected functions help?
Adding #ifdef GL_CONTEXT_RELEASE_BEHAVIOR
around
static ContextReleaseBehavior ReleaseBehavior(void)
and
static oglplus::ResetNotificationStrategy ResetNotificationStrategy(void)
helps.
Ok, I've updated the GL version detection in the build system, so that it checks if (nearly) all required symbols for a particular GL version are available. If some are missing as in your case it #undefs
the GL_VERSION_X_Y
macro. The #undef
directive is placed in the $(build_dir)/include/oglplus/config/fix_gl_version.hpp
file so if you include that (after glew.h
but before oglplus' headers) then things should work fine.
HTH
Hey there! I stumbled upon an issue I failed to solve:
Let's make an example. Assume I want to set a uniform array of vec3's (
vec3 colors[4];
). For that purpose I create a suitable uniform and set it's value from astd::vector
:If done this way, this leads to a call of
glUniform3fv(0, 12, ...)
which tries to set too many values (12 should only be 4). I guess this is due to line https://github.com/matus-chochlik/oglplus/blob/develop/include/oglplus/uniform.hpp#L183 It works properly when this line is onlySetValues(n, temp);
but I'm not sure about any side effects.So my question is: Is this way of setting arrays not intended? If so, is there another way? Thank you very much for your awesome work!