Skip to content
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

Some methods of the QOpenGLFunctions_3_2_Core class do not work as expected #55

Closed
Alex7634 opened this issue May 19, 2022 · 6 comments
Closed

Comments

@Alex7634
Copy link

Hello!

The glVertexAttribPointer, glDrawElements, QOpenGLVertexArrayObject.Binder methods cause the program to crash.
I was able to partially restore the functionality of the glVertexAttribPointer methods, glDrawElements by removing the null check in QOpenGLFunctions_3_2_Core.

The example (https://drive.google.com/file/d/1TL1i81L8NvztQx0VlHbcd7P9KkQASQ1k/view?usp=sharing) uses alternative methods of non-working methods.

I think that in methods void glVertexAttribPointer(int index, int size, int type, boolean normalized, int stride, java.nio.Buffer pointer) and void glDrawElements(int mode, int count, int type, java.nio.Buffer indices ) the problem is with the java.nio.Buffer argument.

In the QOpenGLVertexArrayObject.Binder method, I was unable to determine the cause.

@Alex7634
Copy link
Author

Quite a lot of time has passed.

I understand that there is no interest in restoring the functionality of OpenGL functions in QtJambi.

@omix
Copy link
Contributor

omix commented Jun 21, 2022

Hi, sorry for my late response. I am deeply busy with porting QtJambi to Android.
I am definitely interested in OpenGL functionality. Coupe of weeks ago, I took a look at your code. The only thing I can confirm is, that QtJambi translates java.nio.Buffer null to void* nullptr.

@Alex7634
Copy link
Author

Thanks for the clarification on this matter.

Will wait.

@omix
Copy link
Contributor

omix commented Jun 21, 2022

Is the only problem the Java null reference check throwing a NullPointerException?
I an not sure why there are null checks for Java Buffers. I will remove them.

@Alex7634
Copy link
Author

Alex7634 commented Jun 21, 2022

Unfortunately my English is not good enough.

Is the only problem the Java null reference check throwing a NullPointerException?

This is not the only problem. The const void *ptr argument to the void QOpenGLFunctions::glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *ptr) function can have a non-zero value.
With a non-null value, this function does not work for me with the NullPointerException removed.

I an not sure why there are null checks for Java Buffers. I will remove them.

I am not a big expert in this matter, and I could be wrong. It seems to me that this is the standard script behavior for such arguments in a function. Everything is somewhat more complicated and the const void *ptr argument must be handled by the script in some other way.

omix added a commit that referenced this issue Jul 6, 2022
Bugfix Issue #57
Bugfix Issue #56
Bugfix Issue #55
@omix
Copy link
Contributor

omix commented Jul 6, 2022

Solved

@omix omix closed this as completed Jul 6, 2022
omix added a commit that referenced this issue Jul 25, 2023
Bugfix Issue #57
Bugfix Issue #56
Bugfix Issue #55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants