This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Am I doing this right? It works, but is it right?
Create:
var _surf_width = 918;
var _surf_height = 544;
draw_layer_surface = surface_create(_surf_width,_surf_height);
draw_layer_buffer = buffer_create(_surf_width * _surf_height * 4, buffer_fixed, 1);
buffer_get_surface(draw_layer_buffer, draw_layer_surface, 0);
Draw:
if not surface_exists(draw_layer_surface_textbox)
`{`
`var _surf_width = 918;`
`var _surf_height = 544;`
`draw_layer_surface = surface_create(_surf_width,_surf_height);`
`draw_layer_buffer = buffer_create(_surf_width * _surf_height * 4, buffer_fixed, 1);`
`buffer_get_surface(draw_layer_buffer, draw_layer_surface, 0);`
`}`
End Game:
surface_free(draw_layer_surface);
buffer_delete(draw_layer_buffer);
My reason for questioning this despite it working is that I figured that using the buffer would keep my surface from deleting, but going full screen, changing resolution, and almost anything deletes it. Since it doesn't free the buffer data when reassigning the surface and buffer, wouldn't that eventually eat computer resources or does that call the same buffer to the new surface. What does the buffer even do - I guess is my ultimate question here? I feel,, I might be wrong in this. I just want to get another's view on this.
Subreddit
Post Details
- Posted
- 3 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/gamemaker/c...