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

Vapor API WIP #2856

Merged
merged 7 commits into from
Oct 29, 2021
Merged

Vapor API WIP #2856

merged 7 commits into from
Oct 29, 2021

Conversation

StasJ
Copy link
Collaborator

@StasJ StasJ commented Sep 24, 2021

This is an initial version of the Vapor API. It provides a basis to utilize the vapor through a scripting interface. It will also provide the ability to remove the majority of the control code from the GUI. The current functionality allows for rendering session files. For demo purposes, it compiles as an executable rather than as a library. In vapi/main.cpp, you can specify a session file to load as well as an image to output.

Note: you need to enable BUILD_PYTHON in cmake to build. Also, the test driver looks for a file named 'session.vs3' and outputs a file named 'out.png'

@clyne clyne requested review from shaomeng and clyne September 29, 2021 20:25
apps/vapi/RenderManager.cpp Outdated Show resolved Hide resolved
if (!_glManager) _glManager = new GLManager;

static bool temp = false;
if (!temp) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use a member variable here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is some temporary code so the demo works for the WIP and there is a TODO reminder to remove it 2 lines down. It will be removed later.

apps/vapi/Session.cpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@clyne clyne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, Stas. A few comments and questions:

  1. Presumably most of the new source file will move from apps/vapi to somewhere in 'lib'?
  2. Is there a reason that we need yet another logging facility? For the sake of consistency it would certainly be preferable to find a way to make use of our existing error reporting mechanism (even if some refactoring is needed).
  3. Given that this is work in progress would it make sense to create a feature branch rather than merging into main? I don't think there is any harm in merging this PR into main because it doesn't touch the existing code in any significant way. But as we move forward that may change. What are your thoughts, @sam, @StasJ?

@StasJ
Copy link
Collaborator Author

StasJ commented Sep 30, 2021

Nice work, Stas. A few comments and questions:

  1. Presumably most of the new source file will move from apps/vapi to somewhere in 'lib'?

Yes, it is currently acting as a command line utility which is why I placed it in apps but I will move it eventually.

  1. Is there a reason that we need yet another logging facility? For the sake of consistency it would certainly be preferable to find a way to make use of our existing error reporting mechanism (even if some refactoring is needed).

I added this because I believe it is a better fit for a python API than WASP::MyBase which works better for a GUI application. I can remove it eventually but I'd prefer to leave it during development as it has features that make debugging easier.

  1. Given that this is work in progress would it make sense to create a feature branch rather than merging into main? I don't think there is any harm in merging this PR into main because it doesn't touch the existing code in any significant way. But as we move forward that may change. What are your thoughts, @sam, @StasJ?

I'm fine with doing either. We could just close the PR once the comments are addressed and have this be the feature branch.

@clyne
Copy link
Collaborator

clyne commented Oct 1, 2021

Nice work, Stas. A few comments and questions:

  1. Presumably most of the new source file will move from apps/vapi to somewhere in 'lib'?

Yes, it is currently acting as a command line utility which is why I placed it in apps but I will move it eventually.

  1. Is there a reason that we need yet another logging facility? For the sake of consistency it would certainly be preferable to find a way to make use of our existing error reporting mechanism (even if some refactoring is needed).

I added this because I believe it is a better fit for a python API than WASP::MyBase which works better for a GUI application. I can remove it eventually but I'd prefer to leave it during development as it has features that make debugging easier.

  1. Given that this is work in progress would it make sense to create a feature branch rather than merging into main? I don't think there is any harm in merging this PR into main because it doesn't touch the existing code in any significant way. But as we move forward that may change. What are your thoughts, @sam, @StasJ?

I'm fine with doing either. We could just close the PR once the comments are addressed and have this be the feature branch.

@StasJ, what I'm hoping to avoid is having to re-review the same code later, but at the same time I understand the need to have some of the code be a WIP that should be cleaned up later. I also don't want us to rely on anyone's memory to go back and remove temporary code, commented out code etc. Perhaps the way to proceed here is to open an issue that identifies the cleanup items, and get this PR merged. Whether it should be merged to main or to a feature branch is another topic. Thoughts on this?

@StasJ
Copy link
Collaborator Author

StasJ commented Oct 1, 2021

Nice work, Stas. A few comments and questions:

  1. Presumably most of the new source file will move from apps/vapi to somewhere in 'lib'?

Yes, it is currently acting as a command line utility which is why I placed it in apps but I will move it eventually.

  1. Is there a reason that we need yet another logging facility? For the sake of consistency it would certainly be preferable to find a way to make use of our existing error reporting mechanism (even if some refactoring is needed).

I added this because I believe it is a better fit for a python API than WASP::MyBase which works better for a GUI application. I can remove it eventually but I'd prefer to leave it during development as it has features that make debugging easier.

  1. Given that this is work in progress would it make sense to create a feature branch rather than merging into main? I don't think there is any harm in merging this PR into main because it doesn't touch the existing code in any significant way. But as we move forward that may change. What are your thoughts, @sam, @StasJ?

I'm fine with doing either. We could just close the PR once the comments are addressed and have this be the feature branch.

@StasJ, what I'm hoping to avoid is having to re-review the same code later, but at the same time I understand the need to have some of the code be a WIP that should be cleaned up later. I also don't want us to rely on anyone's memory to go back and remove temporary code, commented out code etc. Perhaps the way to proceed here is to open an issue that identifies the cleanup items, and get this PR merged. Whether it should be merged to main or to a feature branch is another topic. Thoughts on this?

I am okay with opening an issue. We could just leave those comments unresolved and open an issue linking to this PR to resolve the unresolved comments before the final PR is accepted.

@clyne
Copy link
Collaborator

clyne commented Oct 4, 2021

Opening a separate issue to resolve unresolved comments in this PR seems both efficient, and the least likely to missing something. Let's try that.

@StasJ
Copy link
Collaborator Author

StasJ commented Oct 4, 2021

Opening a separate issue to resolve unresolved comments in this PR seems both efficient, and the least likely to missing something. Let's try that.

Done: #2869

@clyne
Copy link
Collaborator

clyne commented Oct 4, 2021

Great. I will approve as soon as the ubuntu test failures are resolved.

apps/vapi/GLContextProvider.cpp Show resolved Hide resolved
apps/vapi/GLContextProvider.h Show resolved Hide resolved
apps/vapi/GLContextProviderEGL.h Show resolved Hide resolved
apps/vapi/GLContextProviderEGL.cpp Show resolved Hide resolved
apps/vapi/GLContextProviderMacOS.h Show resolved Hide resolved
@sgpearse sgpearse mentioned this pull request Oct 19, 2021
@shaomeng shaomeng self-requested a review October 25, 2021 04:24
@clyne clyne merged commit b8cfee1 into main Oct 29, 2021
@clyne clyne deleted the vapi branch October 29, 2021 19:38
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

Successfully merging this pull request may close these issues.

3 participants