YoYoGames / GameMaker-Bugs

Public tracking for GameMaker bugs
24 stars 8 forks source link

Surface Permanent! Option (to prevent deletion of surfaces on window resize, for data oriented surfaces) #3183

Open Lanthie opened 1 year ago

Lanthie commented 1 year ago

Is your feature request related to a problem?

Currently gamemaker surfaces gets deleted automatically on resize now that might make sense for post processing and rendering purposes. But if you use it to store data to assist rendering or shaders, it makes no sense to have it deleted, which makes it painfull todo certain things in gamemaker as you have to store a buffer copy at all times & each time you perform an edit on said surface.

Describe the solution you'd like

an optional "flag" on each surface created so that when gamemaker resizes and frees the surfaces , surfaces with said flag will be ignored from the deletion proccess. example: surface_create(width,height,type,permanent?); or surface_set_permanent(true); or surface_set_usage(surface_data / surface_render );

Describe alternatives you've considered

Currently the only work around sucks, which tend to cause slowdown and noticeable lags on resize or edits. And can cost more memory as you need to store copies. You may also have to disable the window border so that you can control when the window is resized in order to perform a surface save to buffer before applying the resize. (and ofc set the surface from buffer afterwards) slow...

Additional context

No response

stuckie commented 1 year ago

There may be technical limitations to this, so we will need to investigate it.

WangleLine commented 1 year ago

Yeah. I use surfaces for complex decals in my games. It sucks to have them just disappear when the window changes size.