Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: manual cleanup capability of text and memory #7700#7890

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
uppathidev wants to merge1 commit intoprocessing:main
base:main
Choose a base branch
Loading
fromuppathidev:uppathidev/issue7700

Conversation

uppathidev
Copy link

@uppathidevuppathidev commentedJun 8, 2025
edited
Loading

Resolves#7700

Changes:FIX: manual cleanup capability of text and memory

Screenshots of the change:

PR Checklist

@welcomeWelcome
Copy link

welcomebot commentedJun 8, 2025

🎉 Thanks for opening this pull request! Please check out ourcontributing guidelines if you haven't already. And be sure to add yourself to thelist of contributors on the readme page!

@davepagurek
Copy link
Contributor

Hi@uppathidev! Currently we're only adding new features to p5 2.x, which is in thedev-2.0 branch. Do you think you could base your changes off of that branch and create a PR into it instead?

@@ -455,6 +455,15 @@ p5.Texture = class Texture {
}
};

// manual cleanup capability
p5.Texture.prototype.free = function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can just make this method directly in the texture class in this file rather than adding it to the prototype here.

@davepagurek
Copy link
Contributor

davepagurek commentedJun 11, 2025
edited
Loading

Also, some general thoughts:

  • I think we maybe don't want to add methods directly onto things like a p5.Image, as they can actually be used on multiple renderers, and their textures will exist separately on each renderer. Instead, we likely want a method onp5.RendererGL that you call on a visual, likefreeTexture(myImg) (similar to howfreeGeometry works forp5.Geometry.)
  • When we remove text textures, this is currently what we do:

    p5.js/src/webgl/text.js

    Lines 809 to 813 in3eae276

    consttex=this.textures.get(data);
    if(tex){
    tex.remove();
    this.textures.delete(data);
    }
    This is probably all we need inside of afreeTexture method.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@davepagurekdavepagurekdavepagurek left review comments

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Add a way to clean up image texture resources in WebGL
2 participants
@uppathidev@davepagurek

[8]ページ先頭

©2009-2025 Movatter.jp