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

Don't use framebuffer for pdlua, as context changes (when using multi… #1843

Closed

Conversation

alcomposer
Copy link
Collaborator

…ple editors) will corrupt the graphics context. Use a command cache to replay the last state if it is needed during repaint. WIP

…ple editors) will corrupt the graphics context. Use a command cache to replay the last state if it is needed during repaint. WIP
@timothyschoen
Copy link
Collaborator

Unfortunately, I think we can't do this, because there is a multi-layer drawing feature coming to pdlua soon that depends on framebuffers

@alcomposer
Copy link
Collaborator Author

alcomposer commented Sep 5, 2024

Yeah, I like the idea of having a pass over FBO objects in the main loop.

However I think we need to keep the guiCommandBufferCache code so we can update the state of this on its own timer, then use that when rendering into the FBO (at callback rate)

Eg, timer updates cache 60hz
Callback can happen at 60-170hz

@alcomposer alcomposer marked this pull request as ready for review September 5, 2024 11:19
@alcomposer
Copy link
Collaborator Author

I have updated this PR to use Framebuffers again, but with them being rendered in the updateFramebuffers canvas function.

The framebuffer is registered when a pdlua graphical object is added, and removed when the SafePointer becomes null.

@alcomposer alcomposer force-pushed the pdlua-cached-render branch 3 times, most recently from 47e5a2f to 18047fb Compare September 6, 2024 08:22
…gister framebuffers into the objectFrameBuffers map, and remove them when they are null. Make sure to unregister pdlua listeners, even when they are null
@alcomposer
Copy link
Collaborator Author

Had to move the updateFramebuffer for lua objects to editor, so it will update when canvas is closed.

@timothyschoen
Copy link
Collaborator

Merged changes manually

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.

2 participants