-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
frexp and ldexp definitions: return a pair? #31
Comments
No, I try to maintain compatibility with glm, which does in fact not return a pair. I'm not sure I've tried the function, but it should work as intended looking at the code. |
the problem is that the second argument should be passed as reference, which is not possible in python unless it is an array. Note that these are the only functions in GLSL that have an "out" parameter. |
Ah yeah right, sorry about that. Anyway what your saying is not true. |
Agreed, class objects are passed by reference, so it would work for vectors of int (remember that the second argument must be an integer type as per the definition, so no vec2, vec3 or vec4), but not with integers. And, by the way, I had to comment out the definitions of frexp and ldexp in the current version of PyGLM, because it resulted in undefined symbols (check with nm). The resulting shared object would load fine on Linux, because symbols are resolved when executing them, but not on macOS, where symbols are resolved when loading the shared object: |
I'm working on a future version of PyGLM right now, that does support additional types, including integer types. It will take a while to finish though. The reason why it doesn't compile is because there was an issue in glm itself, where the forward declarations were missing (see g-truc/glm#895). |
Okay. It should work now. |
I think the frexp and ldexp functions should take a single argument and return a pair, just like the standard python version https://docs.python.org/3.5/library/math.html#math.frexp, because python parameters are passed by value. That's more python-friendly.
Another solution would be to pass an array of ints as the second parameter.
The text was updated successfully, but these errors were encountered: