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

analyze pointer usage for OpenGL API for generate-XS.pl implementation #51

Open
devel-chm opened this issue Mar 1, 2017 · 5 comments
Open

Comments

@devel-chm
Copy link
Collaborator

This issue is to track the progress of analyzing the OpenGL pointer usages which started with issue #7.
Per discussion on #pogl, the plan is to determine from the OpenGL specification and documentation what the various pointer arguments and return values mean for each function and to categorize all the arguments to each function as well. These non-pointer arguments often determine the details of the pointer usages:

  • Number of elements
  • Number of bytes
  • Types of elements
  • Are the arguments inputs, outputs, or both?
  • Is the pointer "just a pointer" or an "offset"?
  • ...

Work is underway to provide OpenGL::GLUT and OpenGL::Array as standalone modules for back compatibility. OpenGL::GLUT is almost released. OpenGL::Array should follow within the week.

The hope is that this analysis will be done enough that work to improve code generation
can begin once they are released.

@wchristian
Copy link
Collaborator

First step of that will be to parse badp-XS-signatures.pl into a data structure that can be edited easily.

@devel-chm
Copy link
Collaborator Author

If you could get annotated signatures for the priority list by Saturday that would be great! That is when I plan to get to improving the code generation in generate-XS.pl.

@wchristian
Copy link
Collaborator

#52 contains a first shot at parsing the arguments and batching them.

@devel-chm
Copy link
Collaborator Author

We're on track for the CPAN releases of OpenGL::GLUT and OpenGL::Array by tomorrow. Now that legacy OpenGL functionality is supportable, we need to finish the OpenGL::Modern bindings for "bad" routines with pointer/array arguments.

@devel-chm
Copy link
Collaborator Author

This is a list of the routines implemented in Perl OpenGL. I recommend completing them so that following the test with the required set of functions, we can be sure that the XS code generation includes these for compatibility with the OpenGL module.

pogl_compat_funs.txt

Notice that a number of the routines with '_p' suffixes appear to actually be implementations using OpenGL::Array objects rather than native perl. I think it would have been more consistent if the OGA-using routines were named '_a' or '_o' instead. However, my current plan is that the basic OpenGL::Modern implementation with perl data types and others will not have or need special suffixes. In that case, leaving the '_p' as such will provide compatibility.

devel-chm added a commit that referenced this issue Mar 12, 2017
Most routines all have similar implementations.  I've
attached this file to github issue #51 for reference with
the annotation work and included here since factoring out
common structures is important to clean up and clarify the
OpenGL::Modern implemtation.
devel-chm added a commit that referenced this issue Apr 10, 2017
Most routines all have similar implementations.  I've
attached this file to github issue #51 for reference with
the annotation work and included here since factoring out
common structures is important to clean up and clarify the
OpenGL::Modern implemtation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants